Debugging with GDB (September 2007)

Chapter 2: Getting In and Out of GDB 13
The .syms file is specific to the host machine where GDB is run. It holds
an exact image of the internal GDB symb ol table. It cannot be shared across
multiple host platforms.
-r
-readnow Read each symbol file’s entire symbol table immediately, rather than the default,
which is to read it incrementally as it is needed. This make s startup slower,
but makes future op e rations faster.
You typically combine the -mapped and -readnow options in order to build a .syms
file that contains complete symbol information. (See Section 12.1 [Commands to specify
files], page 103, for information on .syms files.) A simple GDB invocation to do nothing
but build a .syms file for future use is:
gdb -batch -nx -mapped -readnow programname
2.1.2 Choosing modes
You can run GDB in various alternative modes—for example, in batch mode or quiet
mode.
-nx
-n Do not execute commands found in any initialization files (normally called
.gdbinit’, or gdb.ini on PCs). Normally, GDB executes the commands in
these files after all the command options and arguments have been processed.
See Section 18.3 [Command files], page 253.
-quiet
-silent
-q “Quiet”. Do not print the introductory and copyright messages. These mes -
sages are also suppressed in batch mode.
-batch Run in batch mode. Exit with status 0 after processing all the command files
specified with -x (and all commands from initialization files, if not inhibited
with -n’). Exit with nonzero status if an error occurs in executing the GDB
commands in the command files.
Batch mode may be useful for running GDB as a filter, for example to download
and run a program on another c omputer; in order to make this more useful, the
message
Program exited normally.
(which is ordinarily issued whenever a program running under GDB control
terminates) is not issued when running in batch mode.
-nowindows
-nw “No windows”. If GDB comes with a graphical user interface (GUI) built in,
then this option tells GDB to only use the command-line interface. If no GUI
is available, this option has no effect.
-windows
-w If GDB includes a GUI, then this option requires it to be used if possible.