In This Book

Examining Variables and Expressions

Variables are evaluated in the scope of the current location, as indicated in the Current Location: line above the source ￿le display. Usually the current location follo ws the PC (program counter) location, so variables are evaluated in the environment where your program is executing. For example, when you are single-stepping through your source, the current location is in the procedure you are stepping through.

If you want to evaluate a variable in the scope of another function on the current call stack, use the 485 and 495 buttons next to the Stack Frame: label in the current location line. (Or choose Show:Stack and choose a stack frame in the Stack View dialog box.) This sets the current location to the speci￿ed function in the call stack.

To evaluate in the scope of a function that is not in the current call stack, enter the function name in the ( ): input box and choose Visit:Procedure() to set the current location to that function.

Finally, you can always specify the variable fully with the appropriate DDE syntax (see Chapter 7). This syntax overrides the current location.

The PC arrow points to the line that will be executed next. (The PC location arrow changes to a broken variant to indicate when the current point of execution is either at another source statement on the same line or at an instruction beyond the statement's ￿rst instruction.) When the arrow points to an assignment statement, the assignment has not yet been executed. To see the result of an assignment statement, step past it (or step over it if it calls a function).

When reporting a value, the debugger uses quali￿ers in the form:

\\module name[\routine name[\subroutine name]...]\ object name

For example, the follo wing print command output indicates that x is local to the routine sum of the module test:

print x \\test\sum\x:3

You can eliminate quali￿ers b y entering the command property qual_max 0 . For more information on quali￿ers, see \Using Quali￿ed Names" in Chapter 7.

4-2 Viewing and Manipulating Target Program Data