HP WDB v6.3 Advanced Reference Card (August 2012)

2
set thread-check {[
on
/
off
] | [
option
] [
on
/
off
] | [
option
] [
num
]}
Set thread debugging commands. Options are as shown below:
recursive-relock Detect attempts of relock non-recursive
[
on
/
off
] mutexes that the thread currently holds.
unlock-not-own Detect attempts to unlock mutexes or
[
on
/
off
] rwlocks not owned by the current thread.
mixed-sched-policy Detect attempts to synchronize threads
[
on
/
off
] using different scheduling policies.
cv-multiple-mxs Detect when a condition variable is
[
on
/
off
] associated with more than one mutex.
cv-wait-no-mx Detect attempts to wait on a condition
[
on
/
off
] variable when a mutex is not locked.
thread-exit-own-mutex Detect attempts to exit a thread
[
on
/
off
] while it's holding a mutex or an rwlock.
thread-exit-no-join Detect when a terminated thread is neither
-detach [
on
/
off
] joined nor detached.
stack-util [
num
] Detect when thread stack utilization
exceeds a given threshold num (0100%).
num-waiters [num] Detect when the number of waiters on any
object exceeds a given threshold num.
info mutex [
m utex - id
] Display the list of all mutexes or details of
specified mutex with mutex-id.
info condvar [
con dv ar- id
] Display the list of all condvars or details of
specified mutex with condvar-id.
info rwlock [
rw lock - id
] Display the list of all rwlocks or details of
specified mutex with rwlock-id.
Inline Debugging
set inline debug Set inline debugging preferences:
[
options
] [
on
|
off
] Enable or disable inline debugging (Without
breakpoint feature); Default is on.
[
inline_bp_all
] Enable inline debugging with breakpoint
feature for all instances of an inline function.
[
inline_bp_indiv idual
] Enable inline debugging with breakpoint
feature for individual instance of an inline
function.
Macros Debugging
macro show
[
m acro- name
] Display macro definition and source
|info macro location of macro macro-name.
macro expand [
expr
] Fully expand the C/C++ preprocessor macro
invocations in the expression expr.
Java Debugging
help java List Java and JVM debugging commands.
java List Java subcommands.
java [
args
] Print the current or specified Java frame
arguments args information.
java bytecodes Disassemble the given Java method
[
methodOop
] methodOop bytecodes.
java heap-histogram Display the Java heap object histogram.
java instances Locate all instances of the given klassOop
[
klassOop
] in the Java heap.
java jvm-state Print current state information of the Java
virtual machine.
java locals Show the current or specified Java frame
locals information.
java mutex-info Print details of the static mutexes.
java object [
object_ptr
] Print the given Java object object_ptr field
information.
java oop Locate Java object oop of the given Java
[
Java_heap_address
] heap address Java_heap_address.
java references [
oop
] Locate references to the given Java object
oop in the Java heap.
java unwind-info [
pc
] Print unwind information of the code where
the pc is located.
java unwind-table Print the dynamically generated Java
unwind table.
Command-Line Function Call
call [
func
] Call a function func present in the program
([
arg1
] [,
arg2
] ... ) from the gdb command line expected
arguments arg1, arg2 and so on are
passed to it. The result is printed and saved
in the value history, if it is not void.
abort_call Abort current gdb command line call if any.
Viewing the Execution Path Entries
info exec-path
[
start_index
] List the local execution path entries in the
[
end_index
] current frame or print local table
[
summary/detail
] summary information.
info global-exec-path
[
start_index
] List the global execution path entries for
[
end_index
] the current thread or print global table
[
summary/detail
] summary information.
exec-path [
up
] [
dow n
] Select, print, and navigate through
[
path_index
] execution paths.
Object File Directories
objectdir [
dir1
] [:
dir2
]… Add directory DIR to beginning of search path
for object files.
objectload Load the debug information for file.c or index
[file.c]|[
index no
] no (reported by info object) immediately.
objectretry [
file.c
] Force GDB to retry loading an object file if
GDB encounters a file error while reading
an object module.
pathmap Define a list of substitution rules to be applied
to path names to identify object files and the
corresponding source files.
Search Pattern
find [
options
] [
expr
] … Search a pattern in given memory address
range; options and expr can be:
[/size-char] Size of the pattern.
[/max-count] Maximum number of matching patterns to be
displayed.
start-address Start address of memory address range.
end-address End address of memory address range.
+length Length of the memory address range.
expr1, expr2, … Variable or pattern to be searched.
Search GDB Commands
apropos [
regex
] Search for commands matching a regex.
Debugging Multi-Process
set follow-fork-mode Set debugger response to a program’s call
ask|child|parent of fork or vfork.
|serial
Special Behaviour
gdb -src_no_g= [
options
] Invokes gdb with limited source level
debugging feature enabled. Used when the
program is compiled without –g.
Following are the possible options:
none No source level debugging possible without
-g.
no_sys_libs For all source files except those in system
libraries.
all For all source files.
gdb -crashdebug Monitors program execution and invokes
gdb when the program execution is about to
abort.
set MPI_FLAGS=egdb Set MPI_FLAGS environment variable before
launching the MPI process, so that GDB can
be attached to Message Passing Interface
(MPI) programs for debugging.
Special Breakpoints
rbp Set a breakpoint for all functions and
[cmd-list] associate a set of commands for the
End breakpoints (commands are specified one
per line in cmd-list).
rdp Delete all breakpoints set by the rbp.
© Copyright 2012 Hewlett-Packard Development Company, L.P.