Contents
Keyword
Index
Using the WDB
GUI
Reference
Information
Troubleshooting
Using
Help |
|
|
The WDB GUI offers two main
views for looking at your code: the
Source view and the Disassembly view. Use the Source
view to see the contents of a file, and use the Disassembly
view to see the corresponding assembly code.
The dwell feature allows you to quickly view the value of a variable or
expression. It is available from both the Source view and Disassembly
view.
Before you can view your source code, you must have an executable
loaded and running in the WDB GUI. Once you have loaded a file, you
can use the Source view to see and manipulate your source
code. Specifically, you can use the Source view to:
- See the current file's source path.
- See the source file contents.
- See the current location of the program counter. The program
counter is set to the point in your program where the debugger will
begin executing.
- See the location and status of breakpoints.
- See a stack marker that indicates the current context, determined
by the stack frame selected in the Call Stack view.
- Access the pop-up menu to perform actions that will affect how
the code executes.
- Use dwell to quickly view the value of a
variable or expression.
To view your source code in the Source view
- In the main window, click the Source tab.
- View the file's source path by looking below the Source
tab label.
- View the source code content in the right column of the Source
view.
- View the location of the program counter, breakpoints, and the
stack marker in the left column of the Source view.
NOTE: You cannot display the Source view in a
separate window. |
To use the pop-up menu in the Source view
- In the Source view, click the right mouse button to
display a pop-up menu that contains the following commands:
- Show Next Statement
- Quick Watch
- Insert/Remove Breakpoint
- Enable/Disable Breakpoint
- Edit Breakpoint...
- Run to Cursor
- Set Next Statement
- Edit File
- Open File in $EDITOR
See the Source View reference topic
for descriptions of these commands.
Before you can use the Disassembly view, your executable
must be running. You can use the Disassembly view to:
- See the assembly code associated with the currently executing
function.
- See the instruction that corresponds to the current location of
the program counter. The program counter is set to the point in your
program where the debugger will begin executing.
- See the location and status of breakpoints.
- See a stack marker that indicates the current context, determined
by the stack frame selected in the Call Stack view.
- Access the pop-up menu to perform actions that will affect how
the code executes.
- Perform debug actions, such as stepping through a program and
setting breakpoints.
- Use dwell to quickly view the value of a
variable, register, or expression.
To view code in the Disassembly view
- In the main window, click the Disassembly tab.
- View the assembly code content in the right column of the Disassembly
view.
- View the location of the program counter, breakpoints, and the
stack marker in the left column of the Disassembly view.
To see the Disassembly view in a separate window
- Click the right mouse button, then click Open Separate View.
The separate window behaves the same as the tabbed Disassembly
view.
- To close the separate window, click the right mouse button, then
click Close.
To use the pop-up menu in the Disassembly view
- In the Disassembly view, click the right mouse button to
display a pop-up menu that contains the following commands:
- Show Next Statement
- Quick Watch
- Insert/Remove Breakpoint
- Enable/Disable Breakpoint
- Edit Breakpoint...
- Run to Cursor
- Set Next Statement
- Open Separate View
- Close
See the Disassembly View
reference topic for descriptions of these commands.
The dwell feature displays the value of the variable or expression
on which the mouse pointer is paused. Dwell works in both the Source
view and the Disassembly view.
Dwell gives you quick information about a variable. For more
detailed information, use Quick Watch, Watch view, or
Local Variables view.
To view the value of a variable or expression
- Use the mouse to position the pointer over a variable. For an
expression (such as
a+b ), highlight the expression to
select it, then point to the highlighted text.
- Don't move the pointer. After a short time (about a half-second),
a window appears that displays the value of the variable or
expression.
- Move the mouse or press a key or button to close the dwell
window.
- You can view the decimal and hexadecimal value of a numeric variable or
expression by changing the preference in the Source View section of the
Edit > Preferences dialog box. See Setting Debugger Preferences. The displayed decimal and hexadecimal values are separated by a semicolon(;)
Limitations of Dwell
Dwell does not display the value of certain types of variables and
expressions. It will not display the value of complex variables such
as arrays and structs, but it will display the value of elements in an
array, fields in a struct, and pointers.
Expressions are not displayed if there may be a potential side
effect on the program being debugged (such as i++ or
exit(1) ). Expressions containing ) ,
= , ++ , and -- are not
displayed with dwell.
Examples with Complex VariablesDwell displays the value of
fields as well as variables. Dwelling on
bar of foo->bar displays the value of
foo->bar , while dwelling on foo displays
only the value of foo .
In the expression a[i] there are several places to use
dwell:
- If
a is a pointer, dwelling on a
displays the value of variable a .
- If
a is an array, dwelling on a
displays the text [...] . This indicates that the
variable is an array and cannot be viewed with dwell. You can use
dwell to view the value of individual elements within an array.
- Dwelling on
i displays the value of i .
- Dwelling on
[ displays the value of a[i] .
In the expression *p , you can use dwell in the
following ways:
- Dwelling on the
* displays the value of *p .
- Dwelling on the
p displays the value of p .
- Use the function browser to view source for a particular function.
(See Browsing Functions for details.)
- Click the
toolbar button to open and close the Disassembly view in a
separate window.
- On the View menu, click Source or Disassembly
to quickly bring that view to the top.
- You can customize the WDB GUI to display line numbers in the Source
view. On the Edit menu, click Preferences and use
the Display Line Numbers check box to set whether line
numbers are displayed in the Source view.

Return
to Top |