Contents
Keyword
Index
Using the WDB
GUI
Reference
Information
Troubleshooting
Using
Help |
|
|
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.
|
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:
- On the File menu, click Load Program, then click
the Run tab.
- 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.
- 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.
- When the proper path and file appear in the Selection
box, click OK.
- In the Load Executable dialog, verify that the proper
path and file appear in the Executable Name box.
- In the Arguments box, type the command line arguments
that you want to pass to the executable when it runs.
- Click OK.
To load a core file for debugging
- On the File menu, click Load Program, then click
the Run tab.
- Select the Core File option, then type the path and name
of the core file. To browse for the file, click the [...]
button.
- Click OK.
To attach to an existing process for debugging
- On the File menu, click Load Program, then click
the Run tab.
- Select the Attach Process ID option, then type the
process ID number (PID).
- 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.
You can set environment variables that will be in effect for
the current debug session.
To view current environment variables
- On the File menu, click Load Program, then click
the Environment tab.
- Look in the Debug Environment Variables list box to see a
list of current environment variables.
- 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
- On the File menu, click Load Program, then click
the Environment tab.
- In the Add/Modify Environment Variable section, in the
Variable box, type the name of the variable you want to set.
- 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.
- Click Set, then click OK.
To delete environment variables
- On the File menu, click Load Program, then click
the Environment tab.
- In the Debug Environment Variables list box, select the
variable that you want to delete.
- Click Delete, then click OK.
- In the Command view, enter the command
unset env
Varname where VarName is the
name of the environment variable you want to remove.
- Use the
show env command in the Command
view to verify that the environment variable has been removed.
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
- On the File menu, click Load Program, then click
the Input/Output tab.
- In the stdin box, type or browse to the file that you
want to specify for standard input.
- 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.
- 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. |
- 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.

Return
to Top |