Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 171
Size: 3 \*Total Number of Branch Paths in Current Function
Effective entries: 2 \*Number of Branches executed till this instant
Current entry: 2 \* Last executed branch number
(gdb) i gep
Global execution path table:
G0 0x4000a80:2 main (execpath.c:10)
G1 0x4000bd0:2 main (execpath.c:16)
(gdb) i gep summary
Summary for global execution path table
Size: 65536 \*Maximum execution path entries to be stored
Effective entries: 2 \*Number of global execution path entries
Current entry: 1 \*The last Global Path ID executed
(gdb)
14.16 Invoking GDB Before a Program Aborts
This -crashdebug option enables GDB to monitor the execution of a process or a
program. It invokes GDB when the program execution is about to abort. Once the
debugger is invoked, you can debug the application using the normal debugger com-
mands. This option enables you to debug a live process instead of getting a core dump
if the program is about to abort.
You can examine the state of the process, make changes to the state and continue
program execution, force a core dump, or terminate execution. It enables you to
control program execution under the debugger if the program is about to abort. You
can load a new process or attach to a running process for monitoring.
To monitor a new process, enter the following command:
gdb -crashdebug <command> <options>
To monitor a running process, attach to the process using the following command:
gdb -crashdebug -pid <pid>
14.17 Aborting a Command Line Call
When a command line call is issued and it is interrupted by a breakpoint or a signal
before completing the program execution, the abort command enables the user to
abort the command line call without allowing the signal to modify the state of the
debugged process.
When a signal interrupts program execution, it can modify the process state of the de-
bugged program and result in an abrupt termination of the program (due to addressing
errors from a call that is not a part of the source program). In such cases, the abort
command is particularly useful in exiting the command line call without modifying the
process state of the debugged program.
The following example illustrates the use of the abort command:
(gdb) break main
Breakpoint 1 at 0x2c74: file .../address_error.c, line 41.