Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
to set breakpoints on fatal error routines or diagnostic routines.
On some configurations of GDB, the init file is known by a different name (these are
typically environments where a specialized form of GDB may need to coexist with other
forms, hence a different name for the specialized version's init file). These are the
environments with special init file names:
VxWorks (Wind River Systems real-time OS): .vxgdbinit
OS68K (Enea Data Systems real-time OS): .os68gdbinit
ES-1800 (Ericsson Telecom AB M68000 emulator): .esgdbinit
You can also request the execution of a command file with the source command:
source filename Execute the command file filename.
The lines in a command file are executed sequentially. They are not printed as they are
executed. An error in any command terminates execution of the command file.
Commands that would ask for confirmation if used interactively proceed without asking
when used in a command file. Many GDB commands that normally print messages to
say what they are doing omit the messages when called from command files.
4
18.4 Commands for controlled output
During the execution of a command file or a user-defined command, normal GDB output
is suppressed; the only output that appears is what is explicitly printed by the commands
in the definition. This section describes three commands useful for generating exactly the
output you want.
echo text Print text. Nonprinting characters can be
included in text using C escape sequences, such
as \n to print a newline. No newline is printed
unless you specify one. In addition to the standard
C escape sequences, a backslash followed by a
space stands for a space. This is useful for
displaying a string with spaces at the beginning
or the end, since leading and trailing spaces are
otherwise trimmed from all arguments. To print
and foo = , use the command echo \ and foo
= \ .
A backslash at the end of text can be used, as in
C, to continue the command onto subsequent lines.
For example,
echo This is some text\n\
which is continued\n\
onto several lines.\n
produces the same output as
4. On DOS/Windows systems, the home directory is the one pointed to by the HOME environment variable.
292 Canned Sequences of Commands