gdb(1)gdb(1)NAMEgdb - HP WDB, the HP supported implementation of the GNU Debugger (GDB)
SYNOPSIS
executable-name] corefile-name] option] option] device] level] interp]
directory] directory] directory] filename] executable-name]
filename] bps]
DESCRIPTION
enables you to view the process state of a program at a specific
instant of program execution, or program crash. You can use to debug
programs that are written in C, C++, and Fortran. also provides mini‐
mal support for debugging Java programs.
To debug a program using GDB, complete the following tasks:
· Load the executable with any arguments that are required.
· Stop the program execution by placing required breakpoints in the
code.
· Examine the process state of the program, when the program stops
execution.
The HP implementation of the open source debugger (HP WDB) additionally
provides the following advanced debugging capabilities:
· Memory Debugging Capabilities
· Thread Debugging Capabilities
· Debugging of Optimized Code
· Enhanced Corefile Debugging
To invoke enter the following command at the shell prompt:
To invoke the online help for the commands in enter the following com‐
mand at prompt:
For more information on the command line options for enter the follow‐
ing command at the shell prompt:
Options
When invoking you can specify the command line options and the associ‐
ated arguments, as follows:
For example:
analyzes the core, filename.
The following command line options are available for
Lists all command line options, with brief explanations.
Invokes on the specified executable, executable-
name. You can additionally use this
option in a corefile debugging session to
examine the data.
Attaches to the specified process,
procID, for debugging.
Examines the core that is dumped in the
file,
corefile-name.
Debugs a corefile that is generated by
dumpcore command on 11.22 system.
Monitors program execution and invokes
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 analyzing a core
dump.
To monitor a new process,
enter the following command:
To monitor and attach to a
running process, enter the
following command:
Invokes and enables leak detection.
Invokes and enables inline debugging
with the appropriate mode of
setting breakpoints on
inline functions.
Sets the source level debugging feature
when the program is compiled without
When the program is compiled
without the debugger uses
the minimal line table
information that is avail‐
able, to provide limited
source level debugging.
This option is available
only on Integrity systems.
Valid options for are:
Source level debugging is
not available when the pro‐
gram is compiled without
Source level debugging is
available for all the source
files except the source
files in the sys‐
tem libraries.
This option is
the default set‐
ting, when no
options are speci‐
fied.
Source level debugging is
available for all the source
files.
Invokes with the terminal user
interface
Invokes and uses as the stan‐
dard input and output
for the program.
Invokes in the XDB compati‐
bility mode, which
allows the limited
use of some XDB com‐
mands.
Enables support for additional dbx
commands such as
and (different from
the command in
Prints the version number and the
introductory message.
The quiet mode suppresses the
printing of introductory and
copyright messages
in These mes‐
sages are also
suppressed in
the batch
mode.
Sets the annotation level
inside
(similar to
the set anno‐
tate level
command).
Annotation
level controls
the extent of
information
that is
printed by
such as the
values of
expressions,
source lines,
and other
types of out‐
put. The lev‐
els are:
0 is the nor‐
mal default
output.
1 is for
cases when
is run as a
subprocess
of gnu
Emacs.
2 is the max‐
imum anno‐
tation for
programs
that con‐
trol such
as
Uses the interpreter,
for interface
with the con‐
trolling pro‐
gram or
device. This
option is
meant to be
set by pro‐
grams which
communicate
with by using
it as a back
end.
For example,
causes to use
the interface.
Adds the directory,
to the
direc‐
tory
list‐
ings in
the
search
path
when
search‐
ing for
source
files.
Adds the directory,
to the
direc‐
tory
list‐
ings in
the
search
path
when
search‐
ing for
object
files.
Runs using
the
direc‐
tory,
direc‐
tory,
instead
of
the
cur‐
rent
work‐
ing
direc‐
tory.
Suppresses the
mapping of all
shared
libraries in a
process as pri‐
vate
(regard‐
less
of
whether
the
com‐
mand
is
run
for
a
par‐
tic‐
u‐
lar
shared
library
with
the
option,
or
not.).
This
option
enables
new
func‐
tions
in
the
dynamic
loader
(patch
PHSSS_33110
or
later)
to
des‐
ig‐
nate
indi‐
vid‐
ual
shared
libraries
for
debug‐
ging.
The
option
ensures
that
the
text
seg‐
ments
of
all
the
shared
libraries
are
shared
across
the
sys‐
tem.
You
can
use
this
option
to
limit
the
pri‐
vate
map‐
ping
of
the
shared
libraries
that
are
explic‐
itly
des‐
ig‐
nated
for
debug‐
ging
by
or
the
envi‐
ron‐
ment
vari‐
able.
Reads
symbol
table
from
file file‐
name.
Reads
symbol
table
from exe‐
cutable-
name
file
and
use
it
as
the
exe‐
cutable
file.
Enables to
store
the
sym‐
bols
in
the
exe‐
cutable
in
a
re‐
us‐
able
mem‐
ory-
mapped
file
if
mem‐
ory-
mapped
files
are
avail‐
able
on
the
sys‐
tem
through
the
mmap
sys‐
tem
call.
For
exam‐
ple,
when
debug‐
ging
an
exe‐
cutable,
the
mapped
sym‐
bol
file
is
This
file
is
used
in
future
ses‐
sions
to
quickly
map
the
sym‐
bol
infor‐
ma‐
tion
in
the
file
instead
of
read‐
ing
the
sym‐
bol
ta‐
ble
from
the
exe‐
cutable.
The
file
is
spe‐
cific
to
the
host
machine
where
is
run.
The
mapped
sym‐
bol
file
holds
an
exact
image
of
the
inter‐
nal
sym‐
bol
ta‐
ble.
This
file
can‐
not
be
shared
across
mul‐
ti‐
ple
host
plat‐
forms.
(This
option
may
or
may
not
be
sup‐
ported
on
all
oper‐
at‐
ing
sys‐
tems.)
Enables
imme‐
di‐
ate
read
of
the
sym‐
bol
ta‐
ble
from
the
sym‐
bol
file instead
of
the
default
mode
of
read‐
ing
the
sym‐
bol
ta‐
ble
incre‐
men‐
tally.
This
results
in
slower
startup
time.
How‐
ever,
the
future
oper‐
a‐
tions
are
faster.
Exe‐
cutes com‐
mands
in
the
com‐
mand
file,
file‐
name.
Exe‐
cutes
the com‐
mands
in
the
com‐
mand
files
that
are
spec‐
i‐
fied
with
(Also
appli‐
ca‐
ble
for
com‐
mands
in
if
the
ini‐
tial‐
iza‐
tion
files
are
not
inhib‐
ited
with
Exits
with
sta‐
tus,
'0'
if
all
the
com‐
mands
in
the
file
are
suc‐
cess‐
fully
exe‐
cuted.
Exits
with
a
non-
zero
sta‐
tus,
if
any
errors
are
encoun‐
tered,
when
exe‐
cut‐
ing
the
com‐
mands
in
the
file.
The
"Pro‐
gram
exited
nor‐
mally."
noti‐
fi‐
ca‐
tion
is
not
issued
if
a
pro‐
gram
exits
nor‐
mally
in
the
batch
mode.
Skips
exe‐
cu‐
tion
of
the
com‐
mands
from
the
ini‐
tial‐
iza‐
tion
files If
this
option
is
not
spec‐
i‐
fied,
the
com‐
mands
in
the
ini‐
tial‐
iza‐
tion
files
are
exe‐
cuted
after
all
the
com‐
mand
options
and
argu‐
ments
are
pro‐
cessed.
Directs
Emacs
to
set
the
option
for
run‐
ning as
a
sub-
process.
Emacs
directs
to
report
the
com‐
plete
file
names
and
the
line
num‐
bers
in
a
stan‐
dard
for‐
mat,
when
dis‐
play‐
ing
the
stack
frame
(includes
every
instance
that
the
pro‐
gram
exe‐
cu‐
tion
stops
within
The
stan‐
dard
for‐
mat
for
report‐
ing
the
file
names
and
the
line
num‐
bers
is
to
dis‐
play
two
`\\032'
char‐
ac‐
ters,
fol‐
lowed
by
the
file
name,
the
line
num‐
ber
and
the
char‐
ac‐
ter
posi‐
tion,
sep‐
a‐
rated
by
colon
(The
lines
are
sep‐
a‐
rated
by
a
new‐
line
char‐
ac‐
ter.).
The
two
`\\032'
char‐
ac‐
ters
are
used
as
a
sig‐
nal,
by
the
Emacs-
to-
inter‐
face
pro‐
gram,
to
dis‐
play
the
source
code
for
each
frame.
Sets
the
line
speed
(baud
rate
or
bits
per
sec‐
ond)
of
any
serial inter‐
face
that
is
used
by
for
remote
debug‐
ging.
ENVI‐
RON‐
MENT
VARI‐
ABLES
Spec‐
i‐
fies
an
alter‐
nate
root
for
Sets
the
tar‐
get
appli‐
ca‐
tion
to
load The
option
can
also
be
used
to
load
and
map
the
shared
library
as
pri‐
vate.
To
set
a
tar‐
get
appli‐
ca‐
tion
to
load
enter
the
fol‐
low‐
ing
com‐
mand:
<exe‐
cutable>
<argu‐
ments>
Dur‐
ing
oper‐
a‐
tions
such
as sys‐
tem(3S)
and
which
invoke
a
new
shell,
must
not
be
loaded
to
the
invoked
shell.
You
must
use
instead
of
to
exclu‐
sively
load
to
the
call‐
ing
process
only.
If
the
debug‐
ger
is
installed
in
a
direc‐
tory
other
than
the
default direc‐
tory,
you
must
use
the
envi‐
ron‐
ment
vari‐
able,
to
export
the
path
of
the
appro‐
pri‐
ate
ver‐
sion
of
If is
installed
at
a
dif‐
fer‐
ent
loca‐
tion
from
the
default
path,
you
must
use
to
over‐
ride
the
default
path
and
pro‐
vide
the
installed
path
for
Stores
the
loca‐
tion
of
the
required
shared
libraries. The
loca‐
tion
of
the
shared
libraries
can
be
spec‐
i‐
fied
with
a
list
of
direc‐
tory
path
names
that
are
sep‐
a‐
rated
by
a
colon
The
list
of
spec‐
i‐
fied
direc‐
to‐
ries
is
searched
for
the
shared
libraries
before
search‐
ing
the
default
sys‐
tem
direc‐
to‐
ries.
This
envi‐
ron‐
ment
vari‐
able
is
par‐
tic‐
u‐
larly
use‐
ful
when
debug‐
ging
core
files.
Stores
the
root
loca‐
tion
of
the
required
shared
libraries. The
set‐
tings
over‐
ride
the
set‐
tings.
To
enable
debug‐
ging
of
Java
pro‐
grams,
you
must
set
the envi‐
ron‐
ment
vari‐
able,
to
the
path
of
This
library
is
part
of
the
Java
SDK
ver‐
sion
1.3.1.02
or
later
for
HP-
UX.
When
is
set
to
the
path
for
a
valid
Java
unwind
library,
stack
traces
dis‐
play
Java
and
C/C++
frames
To
debug
Mes‐
sage
Pass‐
ing
Inter‐
face
(MPI)
pro‐
grams,
you
must
set the
one
of
the
fol‐
low‐
ing
envi‐
ron‐
ment
vari‐
ables
before
you
launch
the
MPI
process:
· To
invoke
set
· Or,
to
invoke
set
For
more
infor‐
ma‐
tion,
see
the
mpi‐
de‐
bug(1)
and
mpi‐
env(1)
man‐
pages.
Sets
the
loca‐
tion
of
the
file
where
the
com‐
mand
his‐
tory
list
is
stored. If
this
vari‐
able
is
not
set,
the
com‐
mand
his‐
tory
file
is
stored
by
default
at
Sets
the
default
num‐
ber
of
com‐
mands
which
are
stored
in
the com‐
mand
his‐
tory
file.
Stores
the
search
path
for
locat‐
ing
the
exe‐
cuta‐
bles.
Spec‐
i‐
fies
the
shell,
which
is
used.
Sets
the
ter‐
mi‐
nal
type
for
edit‐
ing
in with
this
envi‐
ron‐
ment
vari‐
able.
BATCH
MODE
ENVI‐
RON‐
MEN‐
TAL
VARI‐
ABLES
Stores
the
loca‐
tion
of
the con‐
fig‐
u‐
ra‐
tion
file.
If
this
loca‐
tion
is
not
spec‐
i‐
fied,
the
con‐
fig‐
u‐
ra‐
tion
file
is
assumed
to
be
located
at
the
cur‐
rent
work‐
ing
direc‐
tory.
The
path
of
the
con‐
fig‐
u‐
ra‐
tion
file
must
include
the
file‐
name
of
the
con‐
fig‐
u‐
ra‐
tion
file.
Enables
or
dis‐
ables
the
batch
mode
mem‐
ory
debug‐
ging.
Over‐
rides
the
the
default
rtc‐
con‐
fig
file
set‐
tings.
Syn‐
tax:
The
set‐
tings
of are
depen‐
dent
on
the
global
envi‐
ron‐
ment
vari‐
able
set‐
ting.
must
not
be
set
if
the
con‐
fig‐
u‐
ra‐
tion
strings
must
abort
the
exe‐
cu‐
tion
of
the
pro‐
gram
on
detec‐
tion
of
the
first
occur‐
rence
of
bounds,
dou‐
ble-
free,
or
out-
of-
mem‐
ory
con‐
di‐
tions.
If
is
set
to
1,
the
pro‐
gram
does
not
abort
for
failed
checks
and
you
can
view
the
log‐
files
for
all
the
failed
checks
in
a
sin‐
gle
exe‐
cu‐
tion
run.
For
more
infor‐
ma‐
tion
on
batch
mode
envi‐
ron‐
ment
vari‐
ables,
see
the
whitepa‐
per
avail‐
able
at:
BASIC
DEBUG‐
GING
COM‐
MANDS
The
fol‐
low‐
ing
are
basic
debug‐
ging
com‐
mands.
Sets
break‐
point
at
a
spec‐
i‐
fied
func‐
tion
or
line
num‐
ber
(in file),
or
at
a
spe‐
cific
address.
Begin
exe‐
cu‐
tion
of
the
pro‐
gram,
with
the
argu‐
ments
spec‐
i‐
fied
in arglist.
Prints
the
trace
of
all
the
frames
in
the
pro‐
gram
stack.
Prints
the
value
of
an
expres‐
sion. By
default
the
value
of
[expr]
is
printed
in
a
for‐
mat
appro‐
pri‐
ate
to
its
data
type.
To
change
the
dis‐
play
for‐
mat,
you
can
use
the
where
where
f
is
a
let‐
ter
spec‐
i‐
fy‐
ing
the
dis‐
play
for‐
mat:
Con‐
tin‐
ues
run‐
ning
the
pro‐
gram
after
a
stop
in
the
pro‐
gram
exe‐
cu‐
tion.
Exe‐
cutes
the
instruc‐
tion
at
the
next
line
of
the
pro‐
gram
and
steps over
any
func‐
tion
call
that
may
occur
in
the
cor‐
re‐
spond‐
ing
line.
Exe‐
cutes
the
instruc‐
tion
at
the
next
line
of
the
pro‐
gram
and
steps into
any
func‐
tion
call
that
may
occur
in
the
cor‐
re‐
spond‐
ing
line.
Dis‐
plays
help
infor‐
ma‐
tion
on
the
spec‐
i‐
fied
com‐
mand, com‐
mand.
If
com‐
mand
is
not
spec‐
i‐
fied,
the
help
clas‐
si‐
fi‐
ca‐
tion
for
all
the
com‐
mands
is
listed.
Exits
from
FILES
Files
for
librtc
(Run
Time
Check‐
ing
Library)
For
32
bit
IPF
appli‐
ca‐
tions
For
64
bit
IPF
appli‐
ca‐
tions
For
32
bit
PA
appli‐
ca‐
tions
For
64-bit
PA
appli‐
ca‐
tions
Files
for
libpthread
(pthread
Library)
For
32
bit
IPF
appli‐
ca‐
tions
For
64
bit
IPF
appli‐
ca‐
tions
For
32
bit
PA
appli‐
ca‐
tions
For
64-bit
PA
appli‐
ca‐
tions
RELATED
INFOR‐
MA‐
TION
HP
WDB
doc‐
u‐
men‐
ta‐
tion
is
avail‐
able
at
the
fol‐
low‐
ing
loca‐
tion:
The
fol‐
low‐
ing
HP
WDB
doc‐
u‐
ments
are
avail‐
able
on
your
sys‐
tem:
· Debug‐
ging
with
GDB:
· Emacs
(copy
the
files
to
the
info
direc‐
tory
first):
· HP
WDB
Release
Notes:
· GDB
Quick
Ref‐
er‐
ence
Card:
· Get‐
ting
Started
with
HP
WDB:
· XDB
to
WDB
Tran‐
si‐
tion
Guide:
· Using
the
HP
WDB:
· Ter‐
mi‐
nal
User
Inter‐
face
· GDB
man‐
page
gdb(1)
The
lat‐
est
ver‐
sion
of
HP
WDB
doc‐
u‐
men‐
ta‐
tion
is
also
avail‐
able
on
the
web
at:
The
HP
WDB
Online
Doc‐
u‐
men‐
ta‐
tion
addi‐
tion‐
ally
pro‐
vides
the
fol‐
low‐
ing
doc‐
u‐
ments:
· Debug‐
ging
Dynamic
Mem‐
ory
Usage
Errors
Using
HP
WDB
· Debug‐
ging
Core
Files
Using
HP
WDB
RELATED
TOOLS
Pro‐
fil‐
ing
and
debug‐
ging
tools:
wdb(1) Graph‐
i‐
cal
inter‐
face
for
HP
WDB
dde(1) C,
C++,
For‐
tran,
and
Pas‐
cal
sym‐
bolic
debug‐
ger
adb(1) Abso‐
lute
debug‐
ger
Sys‐
tem
tools:
as(1) Trans‐
lates
assem‐
bly
code
to
machine
code
cpp(1) Invokes
the
the
C
lan‐
guage
pre‐
proces‐
sor
cc(1) C
com‐
piler
aCC(1) C++
com‐
piler
ld(1) Invokes
the
link
edi‐
tor
f90(1) For‐
tran
com‐
piler
Mis‐
cel‐
la‐
neous:
strip(1) Strips
sym‐
bol
and
line
num‐
ber
infor‐
ma‐
tion
from
an
object
file
crt0(3) Exe‐
cu‐
tion
startup
rou‐
tine
end(3C) Sym‐
bol
of
the
last
loca‐
tions
in
pro‐
gram
exit(2) Ter‐
mi‐
na‐
tion
of
a
process
CON‐
TACT
US
To
report
any
defects,
com‐
ments,
any
sug‐
ges‐
tions
on
HP
WDB,
send
an
email
to:
COPY‐
RIGHT
Copy‐
right
1986
-
2001
Free
Soft‐
ware
Foun‐
da‐
tion,
Inc.
Hewlett-
Packard
Wilde‐
beest
(based
on
GDB)
is
cov‐
ered
by
the
GNU
Gen‐
eral
Pub‐
lic
License.
Type
to
see
the
con‐
di‐
tions
to
change
it
and/or
dis‐
trib‐
ute
copies.
Type
for
war‐
ranty/sup‐
port.
gdb(1)