In This Book

2

Using the tb Command

Use the tb command to display a traceback of the call/return stack in the debugger output area.

The tb command numbers each frame in the stack using the notation `main (n), where n increases in the direction of the most recent frame. The following example illustrates this notation which was displayed after stepping to line 33 of the sample program average :

tb

 

 

`main(4):

Stopped at: \\average\print_average\33

`main(3):

Called

from: \\average\main\44 (0000203C)

`main(2):

Called from: _start+0068 (80041D9C)

`main:

Called

from: $START$+0094 (0000192C)

Using the environment Command

To move up and down the call/return stack to view the associated source code, enter the environment command. Use the notation `env(-1)to represent the caller of the current routine, as shown in the following example:

environment `env(-1)

After you enter the preceding command, you can easily examine the program data local to the routine shown in the source ￿le display area.

To move down the stack, enter the following command:

environment `env(+1)

To return to the current point of execution, regardless of the source currently displayed, enter the following command:

environment `run

For details on the `env and `run notation, see \Frame Block Quali￿ed Names" in Chapter 7. For a description of the HP/DDE concept of environment, see \Understanding Bloc ks and Environments" in Chapter 7.

Compiling, Loading, and Executing the Target Program 2-19