Go to the first, previous, next, last section, table of contents.


Debugging Programs

Jade allows you to run the GDB debugger in a buffer. Some of the advantages of this over the usual terminal based interaction are,

To start a gdb subprocess use the Meta-x gdb command, you will be asked to enter the name of the program to debug then gdb will be started in a new buffer (called `*gdb*' or similar). You are then able to type commands into the buffer, they will be sent to gdb each time you type the RET key.

The commands for controlling the gdb subprocess are as follows (the Ctrl-c prefixed commands are only available within the *gdb* buffer whereas the Ctrl-x Ctrl-a variations are accessible globally so that they can be invoked from within the target's source files),

Ctrl-c Ctrl-n
Ctrl-x Ctrl-a Ctrl-n
Continue execution to the next source line, this is the gdb command next.
Ctrl-c Ctrl-s
Ctrl-x Ctrl-a Ctrl-s
Continue execution until a different source line is reached, this is the gdb command step.
Ctrl-c Ctrl-f
Ctrl-x Ctrl-a Ctrl-f
Continue running until the current stack frame exits, the finish command.
Ctrl-c Ctrl-r
Ctrl-x Ctrl-a Ctrl-r
Resume execution until a breakpoint is reached or the target exits.
Ctrl-c Ctrl-<
Ctrl-x Ctrl-a Ctrl-<
Display the stack frame above the current one.
Ctrl-c Ctrl->
Ctrl-x Ctrl-a Ctrl->
Display the stack frame under the current one.
Ctrl-c Ctrl-b
Ctrl-x Ctrl-a Ctrl-b
Set a breakpoint at the current source line, if the *gdb* buffer is active the line selected is where the program last stopped.
Ctrl-c Ctrl-t
Ctrl-x Ctrl-a Ctrl-t
Set a temporary breakpoint at the current source line.
Ctrl-c Ctrl-d
Ctrl-x Ctrl-a Ctrl-d
Remove all breakpoints which are set at the current source line.
Ctrl-c Ctrl-l
Ctrl-x Ctrl-a Ctrl-l
Redisplay the current frame, centring it in its window.

For a summary of these commands type Ctrl-h m in the *gdb* buffer.

Since the gdb process runs on top of the Shell mode the bindings from that mode are also available.

There is no limit to the number of gdb processes you may run at once, each will get its own buffer. When a gdb command is invoked in a buffer which doesn't have a gdb subprocess (i.e. a source file's buffer) the command will be sent to the gdb process which either was last sent a command, or last made the editor display a new frame. Hopefully this will work fairly intuitively.


Go to the first, previous, next, last section, table of contents.