Using the WDB GUI ·
Starting and Exiting the WDB GUI
Home and Help Icons Keyword Index Home Using Help
Line Graphic
Line Graphic

Contents

Keyword Index

Using the WDB GUI
{short description of image} 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
Advancing Through Your Program
Fixing Code from within the Debugger
Starting and Stopping the Debug Process
Setting Debugger Preferences
Creating Buttons Dynamically
Customizing Colors and Fonts

Reference Information

Troubleshooting

Using Help



Bullet Overview
Bullet Starting the WDB GUI
Bullet Creating the .gdbinit File
Bullet Exiting the WDB GUI
Bullet Tips
Bullet See Also

Line Graphic

Overview

You can start the WDB GUI without an executable file loaded, or you can load a target program in three ways:
  • Load the executable you want to debug.
  • Load the executable and specify a core file produced by an aborted program.
  • Load the executable by attaching to a process that is already running.

For information on installing the WDB GUI, see the WDB GUI Release Notes.

Line Graphic

Starting the WDB GUI

To start the WDB GUI

From the command line, type:
wdb [wdb options][other options][executable [core_file | process_id]]
For example, to start the WDB GUI with a white background, the executable blackjack loaded, and the debugger attached to process 1408, type:
wdb -bg white blackjack 1408
Each component of the wdb command is described below:
wdb options Options that display information about the WDB GUI:
  • -session filename causes the debugger to restore the debug information stored in the file filename when it starts up.
  • -help or -? displays usage information for the wdb command and exits.
  • -version displays the WDB GUI version and exits.
other options Options that control the initial state of the debugger after the WDB GUI is started. These include:
  • gdb options

  • standard X Toolkit Intrinsics options

    To see a list of these options, refer to the "OPTIONS" section in the X(1) man page.
See Tips for more information on these options.
executable The path and file name of the program you want to execute through the debugger.

When specifying a core file, executable is the path and name of the program that aborted. When attaching to an existing process, executable is the path and name of the running program.
core_file The path and file name of the core file you want to inspect.
process_id The process ID (PID) of a program running outside of the WDB GUI. To obtain a process ID, type: ps -ef
NOTES:
  • You must have owner permissions for a process in order to attach to it.
  • You cannot attach to an existing process if the executable you are running resides on an NFS-mounted file system. To work around this problem, copy the executable onto your local machine's file system and run the debugger using the local executable.
  • You cannot load a core file and attach to an existing process at the same time.
  • You cannot attach to a process already being debugged.

Depending on the options you specify, the WDB GUI starts with the following displayed:

  • If you did not specify an executable, the GUI displays a blank window with no file loaded.
  • If you specified an executable file, the source file containing the entry point of the requested program is loaded into the GUI.
  • If you specified a core file, the executable is loaded into WDB and the GUI displays the appropriate source file. The program counter points to the position of the core dump, and the current stack frame data is displayed.
  • If you specified a process ID, the process pauses execution when it is loaded into WDB. The executable is also loaded, and the program counter points to the position in the program where the process stopped running. The current stack frame data is displayed.
Line Graphic

Creating the .gdbinit File

When WDB starts, it reads the .gdbinit file and executes the commands in it. You can create this file so that WDB and the WDB GUI will start in a desired state.

Create the .gdbinit file in the current working directory or in your $HOME directory. Enter commands in the .gdbinit file so that each command is on a separate line.

For example, if you are debugging a single application and want to have it loaded every time you start WDB or the WDB GUI, add the following line to the .gdbinit file:

file executable
NOTES:

While using WDB-GUI, ensure that 'set editing' option is set to off . The GUI might behave differently when the option 'set editing' is set to on. The problem will appear mainly when you use the Local/Watch/Dwell/ QuickWatch Views. These views will not show the value of the variables, instead will show the commands send to the debugger, when the editing is set to on. Disable 'set editing' to see proper values in all these views.


See the following topics for specific tips on automating GUI behavior using the .gdbinit file.

Line Graphic

Exiting the WDB GUI

To exit the WDB GUI

  1. On the File menu, click Exit.
  2. In the Exit dialog box, click Exit.
NOTES:
  • When you exit the WDB GUI with the Exit dialog box, the size and location of the main window and any other separate debug windows are saved in the file $HOME/.wdbguirc. When you restart the WDB GUI, the windows are restored as they looked when you last exited the WDB GUI.
Line Graphic

Tips

  • It is sometimes better to save and restore a debug session file than to modify the .gdbinit file. Check the list of information you can save in a session file before modifying the .gdbinit file.
  • The gdb options --nw and --tui are not supported.
  • Although there are several ways to modify your X resources, you may want to specify X Toolkit Intrinsics Options when starting the WDB GUI if:
    • you only want to change your X resources for a single invocation of the GUI.
    • you want to specify an option for testing purposes.
    • you don't want to modify your X resources database or file.
    For information on other methods of customizing your X resources, refer to the X(1) man page or to the documentation for your window manager.
  • The Xt option -geometry is ignored. The window position and size from your previous WDB GUI session is used instead.
  • For detailed information on customizing the colors and fonts used by the WDB GUI, see Customizing Colors and Fonts.
Line Graphic

See Also

Line Graphic

Return to Top