next up previous contents index
Next: 4.3 Running and Stopping Up: 4 Debugging Previous: 4.1 Entering the Debugger

4.2 Values and Expressions

 Addresses may accessed symbolically. All global functions and variables in the library and native application are available to the user. Also, any exported function and variable names in binary libraries and applications are available to the user. Finally, the user is able define new symbols at the debugger command line.

For example:

Addresses may also be entered numerically as linear addresses in the native address space or as a segment:offset pair.

For example:

It is important to note that all numbers are enter in decimal by default except when entered as a segment offset pair.

The debugger also supports expressions.

For example, to set a breakpoint at 100 bytes into MS Solitaire's window procedure:

break sol.solwndproc + 100

The following table 4.1 lists the expression operators that are accepted by the debugger:


 
OPERATOR MEANING
x + y add x and y
x - y subtract y from x
x * y multiply x and y
x / y divide x by y
x = y 1 if x equals y, 0 otherwise
x != y 1 if x does not equal y, 0 otherwise
( x ) parentheses are used to force precedence
*x the 32-bit value stored at address x
-x 2's complement of x
! logical not of x
``string'' address of memory containing the string
. the current value of cs:ip
Table 4.1: Debugger Expression Operators

The contents of the registers may used. The following special symbols may be used to access the registers: $pc, $sp, $eip, $esp, $ebp, $eax, $ebx, $ecx, $edx, $esi, $edi, $es, $ds, $cs, $ss.

Finally, any expression may use the return value from a function.

For example, to determine which window currently has focus:

print GetFocus()


next up previous contents index
Next: 4.3 Running and Stopping Up: 4 Debugging Previous: 4.1 Entering the Debugger
Send corrections/suggestions via e-mail to: Rob Penrose