[Contents] [Prev. Chapter] [Next Section] [Next Chapter] [Index] [Help]

12    Debugger

This chapter provides an overview of the Ladebug Debugger's features and capabilities. For detailed information on tasks using this tool, choose Help: On Debugger. You can print Help topics using the HyperHelp Viewer.

You locate errors with the Ladebug Debugger by observing and manipulating your program interactively as it executes.

Figure Figure 12-1 shows the Ladebug main window.

Figure 12-1:  Debugger Main Window

Key elements are the major window panes running from the top to the bottom of the window:

Breakpoint annotation area

Displays the line numbers of your source file and lets you click next to a line number to insert a breakpoint.

Source display area

Displays your source code.

Controls area

Provides you with ways to display and manipulate such features as the call stack, processes, and threads. Also provides buttons for stepping through your program.

Communications area

Displays status information that results from work you do using the Debugger.


[Contents] [Prev. Chapter] [Next Section] [Next Chapter] [Index] [Help]

12.1    Summary of Features

The Debugger helps you locate run-time programming or logic errors. You use the debugger with a program that has been compiled and linked successfully but does not run correctly. For example, the program might give incorrect output, go into an infinite loop, or terminate prematurely.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.1.1    Major Features


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.1.2    Basic Debugging Techniques

These are the basic debugging techniques. When you find errors in the program, you can edit the source code and compile, link, execute, and test the corrected version. As you use the Debugger, you will discover variations on these techniques.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.1.3    Convenience Features

The complete documentation for the Debugger is contained in other manuals, FUSE online Help, and reference pages installed with your system (see Section Section 12.6). The rest of this chapter is mostly confined to information you might need to set up and start your debugging environment on FUSE and a general orientation to the following:


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.2    Requirements for Using the Debugger

The basic requirement for using the Debugger is to have access to the complete symbolic information in your program while debugging. You must compile its source files with the debug option (-g on most systems). See your compiler documentation for complete information about compiler options.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.3    Starting the Debugger

You can start the Debugger in several ways:


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.3.1    Use the Command Line

You can start the Debugger from the command line using the following command:

% fusedebug [Xt-Options] [filepath]

See Appendix Appendix D and the specific reference pages for the command syntax and options.

If the Control Panel is not running, it starts automatically as a minimized icon. If FUSE is already running, the Debugger is placed in the current tool group.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.3.2    Use the Debugger Icon from CDE

When you have CDE installed, FUSE provides a FUSE application group icon and icons for the individual tools that make up the FUSE environment.

To invoke the Debugger:

  1. Double click on the Application Manager icon in the CDE Front Panel to display the application group icons.

  2. Double click on the FUSE application group icon to display the icons in the FUSE application group.

  3. Double click on the Debugger icon to start the tool.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.3.3    Use the FUSE Control Panel

To start Debugger from the FUSE Control Panel, select Ladebug Debugger from the Tools menu.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.3.4    Use the Tools Menu from Most FUSE Tools

Most FUSE tools have a Tools menu. To start a tool, select the tool from the Tools menu.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.3.5    Completing the Run New Program Dialog Box

When you start the Debugger, the Debugger main window appears, along with the Run New Program dialog box.

To complete the Run New Program dialog box:

  1. Enter the pathname of the executable target to be debugged in the Select a program to run field.

  2. If applicable, enter debugger command-line options, program arguments, and a core file name in the corresponding fields.

  3. Click on OK. This causes the source code of the program to appear in the source pane of the Debugger main window (see Figure Figure 12-1). The User Program I/O window is also displayed to the right of the main window. It separates program I/O from debugger I/O, which is displayed in the communications pane of the main window.

You can now debug your program.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.4    Debugger Engine and User Interface

The Debugger consists of a window interface (see Figure Figure 12-1) layered on a command-driven debugger engine that is provided with the operating system. The Ladebug engine determines the exact behavior of the Debugger (language support, response to user input, and so on). The window interface provides the basic debugging and convenience features that you will probably need most of the time.

The Debugger provides a command interface that is accessible from the window interface. You can enter debugger engine commands at a command-entry prompt in the Command Message view of the Debugger main window.

The command interface is useful under the following circumstances:

Because the two interfaces are integrated, in many cases you can use either to achieve the same result. Mouse actions cause the underlying commands to be displayed to help you associate the two.

You can customize the window interface with many of the special features of the command interface by modifying the push buttons and their associated Debugger commands or by adding new push buttons.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.5    Language Support

The Debugger is a symbolic debugger; thus, you can specify variable names, function names, and so on, precisely as they appear in your source code. In most cases, the Debugger recognizes the syntax, data types, operators, expressions, scoping rules, and other constructs of a supported language.

Ladebug supports C, DEC C++, DEC Ada, and DEC COBOL. Therefore, use only C, C++, DEC Ada, or DEC COBOL mixed-language applications.

For a complete description of the language support and restrictions, see:


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.6    Debugger Documentation


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

12.7    Using an Editor with the Debugger

When you start up the Debugger, you specify an executable target. The Debugger displays the source file for that target.

The Debugger source view is read-only. To edit a source file, you can access the editor either directly from the Debugger or from the Tools menu.

If you want to edit the source file whose code is currently being displayed by the Debugger, the quickest way is to choose Edit File from the Debugger's Commands menu. This invokes your default FUSE editor (FUSE Editor, Emacs, or vi). The editor displays the target's source code in its own window. As in the Debugger main window, the source code in the editor window is positioned where execution is currently paused.

You can also invoke an editor from the Tools menu, but the executable target set for the project (which the editor inherits) must be the same as the target that is being debugged. If this is the case, the editor displays the source code, which is also positioned where execution is currently paused.

When you then execute the program with the Debugger, the breakpoints are updated in both the Debugger and the editor.

If you are using the FUSE Editor or emacs, you can set breakpoints from within the editor:

Similarly, when you set or deactivate a breakpoint from within the Debugger, the FUSE or emacs editor's annotation area is updated accordingly. No breakpoints set before the editor was invoked are visible in the annotation area.


[Contents] [Prev. Chapter] [Prev. Section] [Next Chapter] [Index] [Help]

12.8    Customizing the Debugger Environment

In addition to the standard FUSE customizations that are available from the FUSE control panel, the Debugger offers several options for customizing your debugging environment:


[Contents] [Prev. Chapter] [Prev. Section] [Next Chapter] [Index] [Help]