Using the WDB GUI ·
Loading a Program and Changing Program Settings
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
{short description of image} 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
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 Setting Run Options
Bullet Setting Environment Variables
Bullet Setting Program Input/Output Redirection
Bullet Tips
Bullet See Also

Line Graphic

Overview

You can set the following types of options for your debug sessions:
  • run options
  • environment variables
  • standard input/output redirection
NOTES:
  • Changing any debug settings or clicking OK in the Load Program dialog box will cause your executable to be reloaded. An executable that is running will be unloaded.
  • When you click OK in the Load Program dialog box, any settings that you have specified in the Command view will be overridden.
Line Graphic

Setting Run Options

In the Load Program dialog box, use the Run tab to set options that will specify the executable name, program arguments, core file name, and existing process to be used for the current debug session.

To specify an executable:

  1. On the File menu, click Load Program, then click the Run tab.
  2. In the Executable Name box, type the path and name of the executable. To browse for the file, click the [...] button.

    If you browse for the file, the Executable Name dialog box displays.
    1. In the Executable Name dialog box, double-click to select the appropriate directory from the Directories list. Then, click to select the appropriate file from the Files list.
    2. When the proper path and file appear in the Selection box, click OK.

  3. In the Load Executable dialog, verify that the proper path and file appear in the Executable Name box.
  4. In the Arguments box, type the command line arguments that you want to pass to the executable when it runs.
  5. Click OK.

To load a core file for debugging

  1. On the File menu, click Load Program, then click the Run tab.
  2. Select the Core File option, then type the path and name of the core file. To browse for the file, click the [...] button.
  3. Click OK.

To attach to an existing process for debugging

  1. On the File menu, click Load Program, then click the Run tab.
  2. Select the Attach Process ID option, then type the process ID number (PID).
  3. Click OK.

The process execution is paused and the program is loaded into the WDB GUI. You can now set breakpoints, view variables, and perform other debugging tasks.

Set desired breakpoints at this time because once you continue executing the process, you will not have control of execution until a breakpoint has been reached.

NOTES:
  • You can debug executables that are stored on NFS-mounted file systems, but you cannot attach to an existing process if the executable you are running resides on an NFS-mounted file system instead of on your local machine's file system. To work around this problem, copy the executable onto your local machine's file system, restart the process on your local machine, run the debugger, and attach to the process.

  • If you want to attach to a running process that contains shared libraries, before you run your program, you need to run the command /usr/bin/pxdb -s enable executable_file where executable_file is the name of your program executable.
  • To detach the process, click Stop Debugging on the Debug menu.

    After the process is detached, the process continues running independently of the WDB GUI, and the WDB GUI no longer has any control of the process.
Line Graphic

Setting Environment Variables

You can set environment variables that will be in effect for the current debug session.

To view current environment variables

  1. On the File menu, click Load Program, then click the Environment tab.
  2. Look in the Debug Environment Variables list box to see a list of current environment variables.
  3. Click OK.

NOTES:
  • Environment variables that you specify using the Command view will not appear in the Load Program dialog box.
  • Environment variables that were inherited from the shell from which the WDB GUI was launched are also not displayed in the Load Program dialog box.
  • To see a list of all the environment variables that are currently set, use the show env command in the Command view.

To set new environment variables

  1. On the File menu, click Load Program, then click the Environment tab.
  2. In the Add/Modify Environment Variable section, in the Variable box, type the name of the variable you want to set.
  3. In the Value box, type the value you want to assign to the specified variable.

    For example, to assign the variable "DISPLAY" a value of "test:0", type DISPLAY in the Variable box, and type test:0 in the Value box.

  4. Click Set, then click OK.

To delete environment variables

  1. On the File menu, click Load Program, then click the Environment tab.
  2. In the Debug Environment Variables list box, select the variable that you want to delete.
  3. Click Delete, then click OK.
  4. In the Command view, enter the command unset env Varname where VarName is the name of the environment variable you want to remove.
  5. Use the show env command in the Command view to verify that the environment variable has been removed.
Line Graphic

Setting Program Input/Output Redirection

You can specify where you want to accept standard input and send output information for the current debug session. When these fields are blank, the Program Console is used for standard input and output.

NOTES: Files you redirect using the Command view will not appear in the Load Program dialog box.

To redirect standard input and output information

  1. On the File menu, click Load Program, then click the Input/Output tab.
  2. In the stdin box, type or browse to the file that you want to specify for standard input.
  3. In the stdout box, type or browse to the file that you want to specify for standard output. Click the Append button if you want to append information to the standard output file rather than overwrite existing information in the file.
  4. When you have the correct file name in each box, click OK.
NOTE: You cannot redirect standard error from the WDB GUI. It will display in the Program Console. If you want to redirect standard error output, start your program in a terminal window outside of the WDB GUI and then attach to the process. This allows you to control standard error output.
Line Graphic

Tips

  • To save the program settings that you set in the Load Program dialog box, click Save Session on the File menu and make sure that the Program Settings (Load Program) check box is checked.
Line Graphic

See Also

Line Graphic

Return to Top