Using the WDB GUI ·
Advancing Through Your Program
Home and Help Icons Keyword Index Home Using Help
Line Graphic
Line Graphic

Contents

Keyword Index

Using the WDB GUI
Starting and Exiting the WDB GUI
Loading a Program and Changing Program Settings
Opening Source Files
Changing the Working Directory
Saving and Restoring Debug Sessions
Setting Source Paths
Setting Object Paths
Viewing Your Code
Browsing Functions
Setting Signal Handling
Finding Specific Text in Your Code
Using the Command View
Using the Watch View
Using Quick Watch
Using the Local Variables View
Using the Call Stack View
Using the Threads View
Using the Registers View
Examining Memory Use
Using the Program Console
Using Breakpoints
{short description of image} Advancing Through Your Program
Fixing Code from within the Debugger
Starting and Stopping the Debug Process
Setting Debugger Preferences
Customizing Colors and Fonts

Reference Information

Troubleshooting

Using Help



Bullet Overview
Bullet Stepping Into Functions
Bullet Stepping Over Functions
Bullet Stepping Out of Functions
Bullet Stepping Last Functions
Bullet Running to the Cursor
Bullet Setting the Next Statement To Execute
Bullet Showing the Next Statement to Execute
Bullet See Also

Line Graphic

Overview

You can use the commands in this section to advance through your program during the debugging process.

You can use the Step commands to help you locate the section of your program that is causing a problem. For example, you can set a breakpoint at the beginning of a section, step through the code, and examine variables until you isolate the problem.

You can use the other commands in this section to change or show the location of the program counter. Line Graphic

Stepping Into Functions

The Step Into command provides a single step execution of the current instruction. If the instruction is a function call, Step Into enters the function and single-steps through it.

You can use Step Into to traverse a program in detail by stepping into each instruction as it is called.

To step into a function or instruction

  • On the Debug menu, click Step Into.
  • Or, click the Step Into toolbar button.
Line Graphic

Stepping Over Functions

The Step Over command provides a single step execution of the current instruction, unless the instruction is a function call. If the instruction is a function call, Step Over executes the entire function, then pauses at the instruction immediately following the function call. Program execution also pauses at breakpoints that are set in a function.

You can use Step Over to traverse the current stack frame without stepping through the detail of each function call.

To step over a function or instruction

  • On the Debug menu, click Step Over.
  • Or, click the Step Over toolbar button.
Line Graphic

Stepping Out of Functions

The Step Out command executes the program through completion of the current function. Then the debugger pauses at the statement immediately following the function call.

You can use Step Out to return execution to the calling stack frame when you no longer want to look at the detail of a function.

To step out of a function or instruction

  • On the Debug menu, click Step Out.
  • Or, click the Step Out toolbar button.
Line Graphic

Stepping Last Functions

The Step Last command steps into the function call without stepping into the argument evaluation function calls.

You can use Step Last to step into a function call without stepping through the detail of each of its argument evaluation function calls. If a function call has arguments which further makes function calls, steplast executes all argument evaluation function calls and will step into the function. Program execution also pauses at breakpoints that are set in argument function.
If steplast is not meaningful at the current line, gdb will display the following warning message: "Steplast is not meaningful for the current line; behaviour undefined."

To steplast a function

  • On the Debug menu, click Step Last.
  • Or, click the Step Last toolbar button.


  • Note: Steplast feature is supported for both C and C++ languages in WDB-GUI with HP WDB version 3.2 or higher.
Line Graphic

Running to the Cursor

The Run To Cursor command continues executing the program until it reaches the current cursor location. The program begins execution at the program counter (indicated by a yellow arrow) and pauses at the current cursor location.

You can use the Run To Cursor command to advance to a specific location without having to set a temporary breakpoint.

To run to the current cursor location

  1. In the Source or Disassembly view, place the cursor at the location where you want program execution to pause.
  2. On the Debug menu, click Run to Cursor.
    • Or, in the Source or Disassembly view, click the right mouse button, then click Run to Cursor.
    • Or, click the Run to Cursor toolbar button.
Line Graphic

Setting the Next Statement to Execute

The Set Next Statement command sets the program counter at the current cursor location. The program begins execution from the newly set statement instead of from the previous program counter location.

You can use the Set Next Statement command to change the flow of execution if you want to re-execute or skip a portion of the program.

To set the next statement to execute

  1. In the Source or Disassembly view, place the cursor on the statement that you want to execute next.
  2. Click the right mouse button, then click Set Next Statement.
Line Graphic

Showing the Next Statement to Execute

The Show Next Statement command updates the WDB GUI to show the next statement to be executed. The command updates all applicable views, such as the Source, Disassembly, and Call Stack views.

You can use the Show Next Statement command to return to the current stack frame and instruction when you have been looking at a different source file or stack frame.

To show the next statement to execute

  • On the Debug menu, click Show Next Statement.
    • Or, in the Source or Disassembly view, click the right mouse button, then click Show Next Statement.
    • Or, click the Show Next Statement toolbar button.
Line Graphic

See Also

Line Graphic

Return to Top