DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using the graphical interface of debug

View menu

The View menu in the debugger's default configuration allows you to examine different aspects of the threads and processes being debugged. Clicking MENU on the View button brings up a menu with different options, depending on which panes are present in the window. The following options appear in the View menu of one or more windows in the default configuration (remember that you can configure the View menu to have different options, or can move these options to different menus):

Dump

The Dump popup window lets you see the contents of memory at a specific address in the selected process or thread. Enter an expression in the ``Location'' field. The result of evaluating the expression is used as the address to begin the dump. Any expression that evaluates to an address may be entered.

You may enter the number of bytes to be displayed in the ``Count'' field. If you do not enter a number there, debug will display 256 bytes, 16 bytes per line. The bytes will be displayed in both hexadecimal and ASCII.

You may select the format of the result from one of the choices given by Dump format. Choosing the Format as words option tells dump to organize its output into words, of a size appropriate for the target architecture. For little-endian architectures, this means that the hexadecimal values for each byte will appear in a different order than the values actually appear in memory. To suppress this word organization, choose Format as bytes. When this choice is selected, Dump will output each byte individually, as it is laid out in memory.

If there is a variable selected in the ``Symbol pane'' or text selected in the ``Disassembly pane'', ``Registers pane'' or ``Source pane'' when the Dump option is selected, the selection is used to initialize the ``Location'' field. If you have selected a process or thread in the ``Process pane'' the contents of the location in that process or thread are shown. If you have not selected a process or thread, the current process or thread is used.

The ``Show Value'' window provides another way to examine the address space of a process or thread.

In the debugger's default configuration, the Dump option is available in the ``View menu'' of the Disassembly and Symbols windows and in the popup menus in the panes in those windows.

Map

The Map popup window displays the virtual address map for the selected process or the parent process of the selected thread. The information displayed includes the start and end addresses, size, and access permissions for each segment.

If a process is selected in the ``Process pane'', the address map for that process will be displayed. Only one process may be selected. If no process is selected, the address map for the current process is displayed.

In the debugger's default configuration, the Map option is available in the ``View menu'' of the Disassembly and Process windows.

Search

The Search popup window lets you enter an ed(1)-style regular expression to search for in the ``Source pane'' or ``Disassembly pane''. Enter the expression to be searched for in the ``Text'' field. The expression may contain any combination of the following elements:

. Matches any character except a newline
[. . .] Matches any one of the enclosed characters,
  ranges are allowed, and ^ indicates negation
* Indicates zero or more of the preceding RE
^ Matches the null string at the beginning of a line
$ Matches the null string at the end of a line
\ {m\} Indicates exactly m occurrences of the preceding RE
\ {m,\} Indicates at least m occurrences of the preceding RE
\ {m,n\} Indicates m to n, inclusive, occurrences
\ (. . .\) Matches the same thing as . . . matches
\ digit Matches the nth parenthesized RE in the same expression
\< Matches the null string at the beginning of a word
\> Matches the null string at the end of a word

Search Window Character Table

If there is any text selected in one of those panes, it is used to initialize the ``Text'' field. If the parent window contains both Source and Disassembly panes, there will be a selection available to choose which pane to search.

You may search forwards or backwards. If text is selected, the search begins after (or before) the selected string; otherwise the search begins from the current position of the cursor.

In the debugger's default configuration, the Search option is available in the ``View menu'' of the Disassembly and Source windows.

Set value

The Set Value popup window lets you set a debugger built-in or debugger-maintained user variable or evaluate any language expression. To set a debugger or user variable, enter an expression of the form:


variable = expression [,expression ...]

in the ``Expression'' field. The legal values of expression depend on the variable. If you enter a comma-separated list of strings and user variables, the string values of these expressions are concatenated.

If you click SELECT on the Export toggle and the variable whose value you are setting is a debugger-maintained user variable (for example, $myvariable) the debugger will export that variable with its new value to the debugger's environment. The variable and its value will appear in the environment of any processes subsequently created by the debugger. Note that the variable is exported without the $ prefix. See also ``Export''.

You may also enter any expression in the current language in the ``Expression'' field, although the typical use would be to evaluate an assignment expression. For details on what expressions are accepted, see the section on the specific language: ``Support for the C language'' or ``Support for the C++ language''.

If you have selected a variable in the ``Source pane'', ``Symbol pane'' or ``Disassembly pane'' when the Set Value window is popped up, the name of that variable will be used to initialize the ``Expression'' field. If you have selected any processes or threads in the ``Process pane'', the expression will be evaluated in the context of each of those processes and threads in turn. If you have not selected any processes or threads, the current process or thread is used.

In the debugger's default configuration, the Set Value option is available in the ``View menu'' of the Disassembly, Source and Symbols windows.

Show Function Dis

The Show Function Dis popup window lets you display the disassembly for any function in the current process or thread.

The popup window displays two scrolling lists. The first list displays the objects making up the selected process or the parent process of the selected thread; the objects are the executable file and any shared libraries the executable depends on. The selection in this list determines the functions that are displayed in the second list. The popup window also provides a ``Filter'' field. This field accepts a ``Pattern'' that can be used to further restrict the list of functions displayed. The pattern is a sh(1) style regular expression. Changing the pattern and then de-selecting and re-selecting the same object from the Objects list, will apply the new filter to the functions in the selected object.

The Functions list is searchable. See ``Searching in lists''.

You may select one function in the Functions list. Clicking SELECT on the Show Function button will cause that function to be displayed in the ``Disassembly pane'' of the parent Disassembly Window. You may also drag the selected function and drop it on the Disassembly pane.

The Show Function Dis option may only be configured in windows that contain a ``Disassembly pane''. In the debugger's default configuration, the Show Function Dis option is available in the ``View menu'' of the Disassembly window.

Show Function Source

The Show Function Source popup window lets you display the source for any function in the current process or thread that was compiled with debugging information.

The popup window displays two scrolling lists. The first list displays the objects making up the selected process or the parent process of the selected thread; the objects are the executable file and any shared libraries it depends on. The second list shows a list of functions. If the Show Functions from Current compilation unit option is set, the Objects scrolling list is ignored, and only the functions that are defined in the compilation unit for the current frame are shown in the Functions list. If the Show Functions from Selected Object option is set, the selection in the Objects list determines the functions listed. The list of functions may be blank if the selected object does not contain any functions compiled with debugging information.

The popup window also provides a a ``Filter'' field. This field accepts a ``Pattern'' that can be used to further restrict the list of functions displayed. The pattern is a sh(1) style regular expression. Changing the pattern and then de-selecting and re-selecting the same object from the Objects list will apply the new filter to the functions in the selected object.

The Functions list is searchable. See ``Searching in lists''.

You may select one function in the Functions list. Clicking SELECT on the Show Function button will cause that function to be displayed in the ``Source pane'' of the parent window. You may also drag the selected function and drop it on the ``Source pane''.

The Show Function Source option may only be configured in windows that contain a ``Source pane'' or a Secondary Source pane. In the debugger's default configuration, the Show Function Source option is available in the ``View menu'' of the Source window.

Show Line

The Show Line option brings up a popup window that lets you position the file displayed in the Source pane at a specific line. Enter the line number in the ``Line'' field.

The Show Line option may only be configured in windows that contain a ``Source pane'' or a Secondary Source pane. In the debugger's default configuration, the Show Line option is available in the ``View menu'' of the Source window.

Show Location

The Show Location option brings up a popup window that lets you position the ``Disassembly pane'' to show a specific address. Enter the ``Location'' in the ``Location'' field.

The Show Location option may only be configured in windows that contain a ``Disassembly pane''. In the debugger's default configuration, the Show Location option is available in the ``View menu'' of the Disassembly window.

Show Type

The Show Type popup window lets you see the type of an expression in the current language. Enter the expression in the ``Expression'' field. Clicking SELECT on the Show Type button will cause the type to be displayed in the ``Type'' area. For details on what expressions are accepted, see the section on the specific language: ``Support for the C language'' or ``Support for the C++ language''.

You may also enter a type name in the ``Expression'' field. The debugger will then display the definition of the named type, including the members if the type is a class, structure, union, or enumeration type.

If you enter an unadorned identifier in the ``Expression'' field, the debugger will display all objects, functions, or types with that name that are visible from the current scope, along with information about where they are defined.

If you have selected a variable in the ``Source pane'' or ``Symbol pane'' when the Show Type window is popped up, the name of that variable will be used to initialize the ``Expression'' field. If you have selected any processes or threads in the ``Process pane'' the type will be displayed in the context of each of those processes and threads in turn. If you have not selected any processes or threads, the current process or thread is used.

In the debugger's default configuration, the Show Type option is available in the ``View menu'' of the Source and Symbols windows and in the popup menus in the ``Source pane'' and ``Symbol pane''.

Show Value

The Show Value popup window lets you see the value of an expression in the current language. Enter the expression you want evaluated in the ``Expression'' field. You may also enter a comma-separated list of expressions. The expressions may contain program variables, built-in debugger variables, and user-defined variables. Clicking SELECT on the Show Value button will cause the expressions to be evaluated and the results to be displayed in the ``Result of Evaluated Expression'' area. For details on what expressions are accepted, see the section on the specific language: ``Support for the C language'' or ``Support for the C++ language''.

Evaluating a function call results in the debugger creating a stack frame for that function and executing it. Except for exceptions, debugger events are disabled during the function's execution. If the function throws an exception, the debugger will abort the function call and reset the stack. Any side effects of the expression, such as objects created on the stack, will be left in an indeterminate state.

The Expand button lets you see the contents of a structure that a pointer variable points to, follow a chain of pointers, or display the contents of an array. If the ``Result'' area displays structure, class, or array members which are themselves pointers, you may dereference one of the pointers by selecting that member in the ``Result'' area and clicking SELECT on the Expand button. The ``Expression'' field and ``Result'' area will then be updated to show the current pointer chain. There is no limit to the number of pointers you may dereference in this manner, but you may not dereference null pointers (pointers that show a value of 0), pointers of type void *, or pointers with no information about the type pointed to. This will happen if the compilation unit included only a forward declaration of the type name and did not also include the definition of the class or structure pointed to.

At any point in following a chain of pointers, you may backtrack by clicking SELECT on the Backtrack button. That will go back one link in the chain, or one level of dereference. You may click SELECT on Backtrack as many times as you have clicked SELECT on Expand or Show Value.

The Peel button "peels off" the current display in the Show Value window and creates a new window initialized to that display. Both the original and new Show Value windows can be updated independently.

You may select the format of the result from one of the choices in the Format column. Choosing Default will let the debugger print the result in the format it chooses based on the type of the result. There are several other choices, such as Octal, Decimal, and Character. Choosing Other lets you enter a printf-like [see fprintf(3S)] format string in the ``Specify format'' field. You may not enter anything in this field without first selecting ``Other''.

You may choose to get more verbose information by clicking SELECT on the Verbose output toggle. The additional information includes function prototypes of all functions called by the debugger while evaluating the expression. This is useful in C++ to see how overloaded functions are resolved. The verbose output also includes compiler-generated structure and class members such as pointers to virtual function tables.

If you have selected a variable in the ``Disassembly pane'', ``Source pane'', or ``Symbol pane'' when the Show Value window is popped up, the name of that variable will be used to initialize the ``Expression'' field. Double-clicking on a variable in the ``Symbol pane'' will automatically bring up the Show Value window, with the name of the variable used to initialize the ``Expression'' field. If you have selected any processes or threads in the ``Process pane'', the expression will be evaluated in the context of each of those processes and threads in turn. If you have not selected any processes or threads, the current process or thread is used.

In the debugger's default configuration, the Show Value option is available in the ``View menu'' of the Disassembly, Source and Symbols windows, and in the popup menus in the ``Source pane'', ``Symbol pane'', ``Disassembly pane'', and ``Registers pane''.


Next topic: Control menu
Previous topic: Unpin

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004