Debugging Core Files Using HP WDB
Table 2 Commonly Used Commands for Core File Debugging (continued)
DescriptionCommand
Debugging
Feature
The info thread command enables you to view the list of
all the threads in the process at the time of core dump.
The thread <thread-id> command enables you to switch
the thread view under the debugger from one thread to
another. The thread that created the un-handled signal is the
current thread when the core file is loaded in to the debugger.
The thread apply command allows you to apply a
command to one or more threads. You can specify the numbers
of the threads, where the command must be applied, with the
command argument<thread-id>. the command
argument<thread-id> is the internal GDB thread number,
as shown in the first field of theinfo threads display. To
apply a command to all threads, use thread apply all
args.
The backtrace-other-thread command prints the
backtrace of all stack frames for a thread with stack pointer
SP, and program counter PC. This command is useful in cases
where the debugger does not support a user thread package
fully.
info thread
thread <thread-id>
thread apply
<thread-id>[all]args
backtrace-other-thread
Viewing thread
information
Displays information about the global and local variables in
the program.
The <expr> is an expression (in the source language). By
default the value of <expr> is printed in a format appropriate
to its data type. To change the display format, you can use the
where </f> option, where f is a letter specifying the display
format, [x|d|u|o|t|a|c|f].
print </f><expr>
Printing global
and local
variables
Prints the description of a data type,<typename>, where
<typename> can be the name of a type, or it can have the
form class class-name, struct <structtag>, union
<union-tag> or enum <enum-tag> in the case of C code.
ptype <typename>
Printing the
description of a
data type
Enables you to navigate the source code if it has been compiled
with the -g option.
When no arguments are specified, it lists ten lines after or
around the previous listing.
The list - command lists the ten lines before a previous
ten-line listing.
The list <line-number> command lists the source code
around the specified line in the current file. You can also
specify the starting line number and the ending line number
of the source code to be displayed (separated by a comma).
The list <function> command lists the source code
around the beginning of the specified function.
The list <*address> command lists the source code around
the line containing the specified address.
list [- | <line-number>
|<function> | <*address>
]
Navigating the
source code
Disassembles a specified section of the memory. The default
disassembled memory is the function surrounding the pc of
the selected frame.
If an address is specified, the function surrounding the
specified address is disassembled.
If <func-name> is specified, the range of addresses for that
function are disassembled.
If two addresses are specified, the function surrounding the
specified address range is disassembled.
disassemble <address>
disassemble <func-name>
disassemble <address> -
<address>
Disassembling
the core file
Commands For Core File Debugging 17