gdb has a command-line interface similar to a Unix shell. You type a command and then press the Enter key to execute it. If you have never worked with gdb before, begin by executing the help command, which produces the following output:
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.
The instructions in the preceding output give you a starting point from which you can continue a more in-depth study of gdb. For example, if you want to learn about how to run a program being debugged, execute help running, which in turn gives you the following:
Running the program. List of commands: advance --Continue the program up to the given location (same form as args for break command) attach -- Attach to a process or file outside of GDB continue -- Continue program being debugged detach -- Detach a process or file previously attached disconnect -- Disconnect from ...