Command-Line Syntax
GDB is invoked as follows:
gdb [options] [executable[corefile-or-PID]] gdb [options] --argsexecutable[program args...]
The gdbtui command is equivalent to gdb --tui; it invokes GDB with the Text User Interface (TUI). The TUI is described in the later section "The GDB Text User Interface.”
GDB has both traditional short options and GNU-style long options. Long options may start with either one or two hyphens. The command-line options are as follows.
--argsPass on arguments after executable to the program being debugged.
--async,--noasyncEnable/disable the asynchronous version of the command-line interface.
-bbaudrate,--baudbaudrateSet the serial port baud rate used for remote debugging.
--batchProcess options and then exit.
--cddirChange current directory to dir.
-cfile,--corefileAnalyze the core dump file.
-ddir,--directorydirSearch for source files in dir.
-efile,--execfileUse file as the executable.
-f,--fullnameOutput information used by the Emacs-GDB interface.
--helpPrint a usage and option summary and then exit.
--interpreterinterpSelect a specific interpreter/user interface. The command-line interface is the default, although there are other interfaces for use by frontend programs.
-m,--mappedUse mapped symbol files if supported on this system.
-n,--nxDo not read the .gdbinit file.
-nw,--nowindowsForce the use of the command-line interface, even if a windows interface is available.
-ppidnum,-cpidnum,--pidpidnumAttach to running process pidnum ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access