GDB has several user interfaces. Although the command-line interface is the most common and most familiar, there are others.
The command interpreter in GDB is fairly simple. It is designed to allow for the set of commands to be augmented dynamically, and also has a recursive subcommand capability, where the first argument to a command may itself direct a lookup on a different command list.
For instance, the set command just starts a lookup on the
setlist command list, while set thread recurses
to the set_thread_cmd_list.
To add commands in general, use add_cmd. add_com adds to
the main command list, and should be used for those commands. The usual
place to add commands is in the _initialize_xyz routines at
the ends of most source files.
Before removing commands from the command set it is a good idea to
deprecate them for some time. Use deprecate_cmd on commands or
aliases to set the deprecated flag. deprecate_cmd takes a
struct cmd_list_element as it's first argument. You can use the
return value from add_com or add_cmd to deprecate the
command immediately after it is created.
The first time a comamnd is used the user will be warned and offered a
replacement (if one exists). Note that the replacement string passed to
deprecate_cmd should be the full name of the command, i.e. the
entire string the user should type at the command line.
libgdb was an abortive project of years ago. The theory was to
provide an API to GDB's functionality.
Packaging copyright © 1988-2000 OAR Corporation Context copyright by each document's author. See Free Software Foundation for information.