Command Files - Red Hat ENTERPRISE LINUX 3 - DEBUGGING WITH GDB Manual

Debugging with gdb
Hide thumbs Also See for ENTERPRISE LINUX 3 - DEBUGGING WITH GDB:
Table of Contents

Advertisement

Chapter 22. Canned Sequences of Commands
handle SIGALRM pass
end
define hook-continue
handle SIGLARM pass
end
As a further example, to hook at the begining and end of the
the beginning and end of the message, you could define:
define hook-echo
echo
---
end
define hookpost-echo
echo ---
\n
end
(gdb) echo Hello World
---Hello World---
(gdb)
You can define a hook for any single-word command in gdb, but not for command aliases; you should
define a hook for the basic command name, e.g.
the execution of your hook, execution of gdb commands stops and gdb issues a prompt (before the
command that you actually typed had a chance to run).
If you try to define a hook which does not match any known command, you get a warning from the
command.
define
22.3. Command files
A command file for gdb is a file of lines that are gdb commands. Comments (lines starting with #)
may also be included. An empty line in a command file does nothing; it does not mean to repeat the
last command, as it would from the terminal.
When you start gdb, it automatically executes commands from its init files, normally called
1
. During startup, gdb does the following:
.gdbinit
1. Reads the init file (if any) in your home directory
2. Processes command line options and operands.
3. Reads the init file (if any) in the current working directory.
4. Reads command files specified by the
The init file in your home directory can set options (such as
processing of command line options and operands. Init files are not executed if you use the
(refer to Section 4.1.2 Choosing modes).
1. The DJGPP port of gdb uses the name
DOS filesystems.
2. On DOS/Windows systems, the home directory is the one pointed to by the
echo
backtrace
2
.
option.
-x
set complaints
instead, due to the limitations of file names imposed by
gdb.ini
command, and to add extra text to
rather than
. If an error occurs during
bt
) that affect subsequent
environment variable.
HOME
191
option
-nx

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - DEBUGGING WITH GDB and is the answer not in the manual?

Questions and answers

Table of Contents