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.
libgdb was an abortive project of years ago. The theory was to
provide an API to GDB's functionality.
Go to the first, previous, next, last section, table of contents.