The .gdbinit File
At startup, GDB reads its initialization
file. This is a file of commands, such as option
settings, that you tell GDB to run every time it starts up. The
initialization file is named .gdbinit on Unix (BSD, Linux, etc.)
systems. Some MS-Windows versions of GDB use gdb.ini instead. Empty lines (they do
nothing) are allowed, and comments in initialization files start with a # and
continue to the end of the line. GDB executes commands from
initialization files and from the command line in the following
order:
Commands in $HOME/.gdbinit. This acts as a “global” initialization; settings that should always be used go here.
Command-line options and operands.
Commands in ./.gdbinit. This allows for option settings that apply to a particular program by keeping the file in the same directory as the program’s source code.
Command files specified with the
-xoption.
You may use the -nx option to make GDB skip
the execution of the initialization files.
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