Using SoftBench Debugger

Examining and Changing Data in Your Program

in the "Debugger Input" input box. The tptr variable can then be used in any expressions in the "()" input box. For example, if counter is an integer in your program, you could store a pointer to it by entering

tptr = &counter

in the "()" input box, and selecting Print ( ). If you then enter "tptr" in the "()" input box, you can print its value by selecting Print ( ), or print the value of counter by selecting Print* ( ).

See "Help: DDE Reference" for detailed information on the declare statement.

You can use these special variables as local memory. For example, suppose your program defines a tree structure. To examine several nodes under a node of the tree:

1.Create two DDE variables by entering "declare node-type*top, *here" in the "Debugger Input" input box, using whatever node type is appropriate for your tree.

2.Set top to the root of your tree, or wherever you want to start.

3.Traverse down to the node of interest by setting here to top->leftor whatever is appropriate for your example.

4.View or modify the here node of the tree, using Print ( ), Print* ( ), and any other appropriate commands.

5.When you finish accessing the current node, set here to the next node you want to work with (such as top->rightor here->left).

Enter "list declarations" into the "Debugger Input" input box to list all DDE variables you have defined in the Debugger Output Area. You can scroll this area to examine them if you have more than fit in the screen area.

Using Expressions

Expressions are composed of any combination of variables, constants, and operators. SoftBench Debugger keeps track of the language the program was written in, and recognizes language-specific operators used by that language.

You can change the language used by DDE to evaluate expressions using the DDE "prop lang" command. "list prop lang" shows the current language. See "Help: DDE Reference" for detailed information.

184

Chapter 7