The sections in this chapter are:
The debugger is integrated with the common UNIX desktop user environment, CDE (Common Desktop Environment). For more information about using CDE, see the CDE User's Guide. This section explains the most common ways to start the debugger from within this environment. Section 3.2 explains optional ways to start the debugger.
To start the debugger and bring your program under debugger control:
You can move icons from the Developer's Toolkit group into another group or to the front of the Control Panel depending on your preference. See the CDE User's Guide for more information.
To access the Ladebug release notes, double click on the README.Ladebug icon.
Alternatively, you can drag an executable file from the CDE File Manager onto the Ladebug icon in the Developer's Toolkit group to start the debugger using that executable.
If you do not specify a file to debug, click on OK and the debugger starts up as shown in Figure 3-4. The Main Window remains empty until you bring a program under debugger control (see step 6). Upon startup, the debugger executes any user-defined initialization file.
The default position for the Set Initial Breakpoint and Run toggle is on. If the toggle is on, the debugger:
If the toggle is off:
The off toggle selection is useful for the following tasks:
Type of Debugger User | Task |
---|---|
All debugger users | Examine a core file. |
Expert debugger users | Set initial breakpoints in the command- line or window interface. |
Ada debugger users | Debug Ada package elaboration routines. |
When the program is under debugger control and the Set Initial Breakpoint and Run toggle is on, the debugger:
You can now debug your program, (see Chapter 4).
You can start the debugger by specifying the program to be debugged with the shell command. For example, you can invoke the debugger from a terminal window and debug a program named eightqueens, by entering the following:
% dxladebug eightqueens
To display a separate Debugger I/O Window, specify the -iow option.
The source code is displayed if the module was compiled with -g.
By default, the debugger starts up as shown in Figure 4-1, executing any user-defined initialization file. The debugger inserts a breakpoint on the program's entry point and runs to that point, displaying the program's source code in the main window. The current-location pointer (to the left of the source code) shows the line whose code will be executed next.
You can now debug your program.
For more information about debugger startup, see Section 3.1.
When your program completes execution normally during a debugging session, the debugger issues the following message:
Process has exited with status...
You then have the following options:
You can rerun the program currently under debugger control at any time during a debugging session. If you modified the program (created a new binary) during the debugging session, choosing File:Rerun Same Program will bring the new binary under debugger control. The Rerun Same Program dialog box appears (Figure 3-6).
Enter any arguments to be passed to the program in the Arguments: field. Choose whether to keep or not to keep the user-set breakpoints that you previously set, activated, or deactivated (see Section 4.4). Click on OK. An initial breakpoint will be set unless you previously turned the Set Initial Breakpoint and Run button off in the Run New Program dialog box.
When you rerun a program, it is in the same initial state as when you first brought it under debugger control. Any breakpoints that were set in the program remain set. The source display and current location pointer are updated accordingly.
After you revise the program and create a new version of the program file with a new name, choose File:Run New Program... in the main window to bring the new version under debugger control.
You can bring another program under debugger control at any time during a debugging session, if you started the debugger as explained in Section 3.1. Follow the procedure in that section to bring another program under debugger control.
To interrupt program execution or to abort a debugger operation during a debugging session, click on the Interrupt button on the push-button panel (see Figure 2-4). This is useful if, for example, the program is in an infinite loop.
Clicking on Interrupt does not end the debugging session. Clicking on Interrupt has no effect when the program is not running nor does it have any affect when the debugger is not performing an operation. Click on Continue to resume program execution.
To end a debugging session and terminate the debugger, choose File:Exit Debugger on the main window or enter quit from the command prompt. This returns control to system level.
To run another program from the current debugging session, see Section 3.5.