HPlogo HP/DDE Debugger User's Guide: HP 9000 Series 700/800 Computers > Chapter 2 Compiling, Loading, and Executing the Target Program

Looking at the Call/Return Stack

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Select Show:Stack to display the Stack View dialog box.

Figure 2-3 Stack View Dialog Box

[Stack View Dialog Box]

The Stack View dialog box, shown in Figure 2-3 “Stack View Dialog Box ”, contains:

  1. Arrow buttons to move to the top of the stack, up one level, down one level, or to the bottom of the stack. The associated source code is displayed in the source file display area. (You can also use the arrow buttons above the source file display area.)

  2. A scrollable listing of the call/return stack. When you click on an item in the list, the associated source code is displayed in the source file display area.

  3. A button that invokes the Stack Options dialog box, which allows you to limit stack depth globally and to modify stack numbering behavior.

  4. An input box that allows you the limit the stack depth displayed.

  5. A toggle button to display or hide parameters for each entry in the call/return stack.

  6. A toggle button to control when the display is updated.

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 file 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 Qualified Names ”. For a description of the HP/DDE concept of environment, see “Understanding Blocks and Environments”.