How to Use
Clone this wiki locally
Table of Contents
- Loading and Unloading realgud
- Supported Debuggers
- History Ring
- Short-key mode
- Editor marks in source buffer
- Backtrace buffer
See also the notes for specific buffers:
Loading and Unloading
To load the package:
M-x load-library realgud
To unload the package
And, of course, to reload do an unload followed by a load.
See Debuggers Supported for a list of debuggers that are supported.
When there is no conflict with command from another package like gud, there are function aliases to the names without
realgud:. For example:
is the same as
jdb (among possibly others) need to have the
realgud: prefix if you want the realgud to run these.
You can also attach a debugger tracking mode to an existing comint shell. Inside a shell buffer:
You will be asked for the name of a buffer. Use one of the names above without
realgud-. For example,
Some debuggers have the ability to call the debugger from inside a
running program rather than at the outset. In those debuggers, there
is often an alternate command you can run which appends
after the debugger-name. Specifically:
trepan2 but the program is run from the outset via invoking
Python and it will stop only after the debugger is called from the
with program such as via
from trepan.api import debug; debug().
For gdb, in order to track source automatically, inside gdb issue:
set annotate 1
The debugger saves marks in a history ring at the places in source buffers that you have stopped at. To move around M-up and M-down in the debugger command buffer. (The command buffer is where you enter debugger commands which is attached to the debugger process. It is some sort of comint shell.
There is a "short-key" mode which can be used in source buffers which allows single-keystroke commands, like "s" for step (into). And "n" for "next" or step through.
The short-key mode makes the source read only. To get out of short-key mode, you can use the insert key. To get back in use
If you're having key mapping conflicts with other mode (e.g.
evil-mode), you can assign a prefix to the same key shortcuts by adding the following hook:
(add-hook 'realgud-short-key-mode-hook (lambda () (local-set-key "\C-c" realgud:shortkey-mode-map)))
You may want to launch the debugger against one file (e.g.
main.py) and use
short-key mode on other files (e.g. if
main.py uses a function defined in a module that you want to debug). You need to attach each file where you want to use
short-key mode to the debugger command buffer. You can do so with the shortcut
C-x C-a C-q. It will prompt you to choose one that it's running. Once you enter it, you are all set.
The editor uses marks in the source buffer. However if you edit the program and then restart the debugger you may need to clear these marks with
I've been working on a backtrace buffer. To get that set up, issue from a debugger command window:
Or in a source buffer in short-key mode:
which is by default bound to the key "F" (for frame).