3.3 Getting Help
- You can use
h) with no arguments to display a short list of named classes of commands:
(gdb) help List of classes of commands: aliases -- Aliases of other commands breakpoints -- Making program stop at certain points data -- Examining data files -- Specifying and examining files internals -- Maintenance commands obscure -- Obscure features running -- Running the program stack -- Examining the stack status -- Status inquiries support -- Support facilities tracepoints -- Tracing of program execution without stopping the program user-defined -- User-defined commands Type "help" followed by a class name for a list of commands in that class. Type "help" followed by command name for full documentation. Command name abbreviations are allowed if unambiguous. (gdb)
- Using one of the general help classes as an argument, you can get a
list of the individual commands in that class. For example, here is the
help display for the class
(gdb) help status Status inquiries. List of commands: info -- Generic command for showing things about the program being debugged show -- Generic command for showing things about the debugger Type "help" followed by command name for full documentation. Command name abbreviations are allowed if unambiguous. (gdb)
- With a command name as
helpargument, gdb displays a short paragraph on how to use that command.
aproposcommand searches through all of the gdb commands, and their documentation, for the regular expression specified in args. It prints out all matches found. For example:
set symbol-reloading -- Set dynamic symbol table reloading multiple times in one run show symbol-reloading -- Show dynamic symbol table reloading multiple times in one run
completeargs command lists all the possible completions for the beginning of a command. Use args to specify the beginning of the command you want completed. For example:
if ignore info inspect
This is intended for use by gnu Emacs.
In addition to
help, you can use the gdb commands
show to inquire about the state of your program, or the state
of gdb itself. Each command supports many topics of inquiry; this
manual introduces each of them in the appropriate context. The listings
info and under
show in the Index point to
all the sub-commands. See Index.
- This command (abbreviated
i) is for describing the state of your program. For example, you can show the arguments passed to a function with
info args, list the registers currently in use with
info registers, or list the breakpoints you have set with
info breakpoints. You can get a complete list of the
- You can assign the result of an expression to an environment variable with
set. For example, you can set the gdb prompt to a $-sign with
set prompt $.
- In contrast to
showis for describing the state of gdb itself. You can change most of the things you can
show, by using the related command
set; for example, you can control what number system is used for displays with
set radix, or simply inquire which is currently in use with
- Show what version of gdb is running. You should include this information in gdb bug-reports. If multiple versions of gdb are in use at your site, you may need to determine which version of gdb you are running; as gdb evolves, new commands are introduced, and old ones may wither away. Also, many system vendors ship variant versions of gdb, and there are variant versions of gdb in gnu/Linux distributions as well. The version number is the same as the one announced when you start gdb.
- Display information about permission for copying gdb.
- Display the gnu “NO WARRANTY” statement, or a warranty, if your version of gdb comes with one.