Quitting Gdb; Shell Commands; Logging Output - Red Hat ENTERPRISE LINUX 4 - DEBUGGING WITH GDB Manual

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

Advertisement

16
-version
This option causes gdb to print its version number and no-warranty blurb, and exit.

4.2. Quitting gdb

quit [
]
expression
q
To exit gdb, use the
C-d). If you do not supply
using the result of
An interrupt (often C-c) does not exit from gdb, but rather terminates the action of any gdb command
that is in progress and returns to gdb command level. It is safe to type the interrupt character at any
time because gdb does not allow it to take effect until a time when it is safe.
If you have been using gdb to control an attached process or device, you can release it with the
command (refer to Section 6.7 Debugging an already-running process).

4.3. Shell commands

If you need to execute occasional shell commands during your debugging session, there is no need to
leave or suspend gdb; you can just use the
shell
command string
Invoke a standard shell to execute
determines which shell to run. Otherwise gdb uses the default shell (
on MS-DOS, etc.).
COMMAND.COM
The utility
is often needed in development environments. You do not have to use the
make
command for this purpose in gdb:
make
make-args
Execute the
make
.
make-args

4.4. Logging output

You may want to save the output of gdb commands to a file. There are several commands to control
gdb's logging.
set logging on
Enable logging.
set logging off
Disable logging.
command (abbreviated
quit
expression
as the error code.
expression
shell
command string
program with the specified arguments. This is equivalent to
Chapter 4. Getting In and Out of gdb
), or type an end-of-file character (usually
q
, gdb will terminate normally; otherwise it will terminate
command.
. If it exists, the environment variable
detach
SHELL
on Unix systems,
/bin/sh
shell
shell make

Advertisement

Table of Contents
loading

Table of Contents