A Using Ladebug Within emacs

This chapter describes how to invoke and use the Ladebug debugger within the emacs editing environment. You can control your debugger process entirely through the emacs GUD buffer (see Section A.3), which is a variant of Shell mode. All the Ladebug commands are available, and you can use the Shell mode history commands to repeat them.

Ladebug Version 3.0 supports GNU Emacs Version 19.22 and above.

The information in the following sections assumes the user is familiar with emacs and is using the emacs notation for naming keys and key sequences.

A.1 Loading Ladebug-Specific emacs Lisp Code

For each emacs session, before you can invoke Ladebug, you must load the Ladebug-specific emacs lisp code, as follows:

M-x load-file /usr/lib/emacs/lisp/ladebug.el

You can also place a load-file command in your emacs initialization file (~/.emacs). For example,

load-file " . . . /ladebug.el"

A.2 Invoking Ladebug Within emacs

To start Ladebug within emacs and specify the name of the target program you want to debug, enter:

M-x ladebug [target-program]

A.3 emacs Debugging Buffers

When you start Ladebug, emacs displays the GUD (Grand Unified Debugger) buffer in which the (ladebug) prompt is displayed. The GUD buffer saves all of the commands you enter and the program output for you to edit.

When you issue the Ladebug run command in the GUD buffer and hit a breakpoint, emacs displays the source of your program in a second buffer (source buffer) and indicates the current execution line with =>.

By default, emacs sets its current working directory to be the directory containing the target program. Ladebug does not do this when invoked directly, therefore you may need to change the source code search path when using Ladebug from within emacs. To set an alternate source code search path, enter the use command with a directory argument, for example:

(ladebug) use usr/prog/test

All emacs editing functions and GUD key bindings are available. For example:

For more information on emacs functionality and key bindings, refer to emacs documentation.