DeBUG
with GDB
<< CONTENTS
>>
DATA MAN PAGES
DATA
Examining
data.
COMMANDS
call
delete display
disable display
disassemble
display
dump2file
enable display
inspect
out_no_values
output
print
printf
ptype
undisplay
whatis
x
call
Call a function in the program.
The argument is the function name
and arguments, in the notation of the
current working language.
The result is printed and saved in the value
history, if it is not void.
delete
display
Cancel some expressions to be displayed when program
stops.
Arguments are the code numbers of
the expressions to stop displaying.
No argument means cancel all
automatic-display expressions.
Do
"info display" to see current list of code numbers.
disable
display
Disable some expressions to be displayed when
program stops.
Arguments are the code numbers of
the expressions to stop displaying.
No argument means disable all
automatic-display expressions.
Do
"info display" to see current list of code numbers.
disassemble
Disassemble a specified section of memory.
Default is the function
surrounding the pc of the selected frame.
With a single argument, the
function surrounding that address is d
display
Print value of expression EXP each time the program
stops.
/FMT may be used before EXP as in
the "print" command.
/FMT "i" or "s" or including a
size-letter is allowed,
as in the "x" command, and then
EXP is used to get the address to examine
and examining is done as in the
"x" command.
With no argument, display all
currently requested auto-display expressions.
Use
"undisplay" to cancel display requests previously made.
dump2file
To dump the value of an array into a file in a
matrix form
enable
display
Enable some expressions to be displayed when program
stops.
Arguments are the code numbers of
the expressions to resume displaying.
No argument means enable all
automatic-display expressions.
Do
"info display" to see current list of code numbers.
inspect
Same as "print" command, except
that if you are running in the epoch
environment, the value is printed in
its own window.
out_no_values
Output value of expression EXP.
Same as "output"
except it does not output values of aggregates
arrays, structs, classes, unions.
output
Like "print" but
don't put in value history and don't print newline.
This is useful in user-defined commands.
print
Print value of expression EXP.
Variables accessible are those of the
lexical environment of the selected
stack frame, plus all those whose scope
is global or an entire file.
$NUM gets previous value number
NUM. $ and $$ are the last two values.
$$NUM refers to NUM'th value back from
the last one.
Names starting with $ refer to
registers (with the values they would have
if the program were to return to the
stack frame now selected, restoring
all registers saved by frames farther
in) or else to debugger
"convenience" variables (any such name
not a known register).
Use assignment expressions to give
values to convenience variables.
{TYPE}ADREXP refers to a datum of data
type TYPE, located at address ADREXP.
@ is a binary operator for treating
consecutive data objects
anywhere in memory as an array.
FOO@NUM gives an array whose first
element is FOO, whose second element is
stored in the space following
where FOO is stored, etc. FOO
must be an expression whose value
resides in memory.
EXP may be preceded with /FMT, where
FMT is a format letter
but no count or size letter (see "x"
command).
printf
printf "printf format string", arg1, arg2, arg3, ..., argn
This is useful for formatted output in
user-defined commands.
ptype
Print definition of type TYPE.
Argument may be a type name defined by
typedef, or "struct STRUCT-TAG"
or "class CLASS-NAME" or "union
UNION-TAG" or "enum ENUM-TAG".
The selected stack frame's lexical
context is used to look up the name.
undisplay
Cancel some expressions to be displayed
when program stops.
Arguments are the code numbers of the
expressions to stop displaying.
No argument means cancel all
automatic-display expressions.
"delete display" has the same effect as
this command.
Do "info display" to see current list
of code numbers.
whatis
Print data type of expression EXP.
x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory
address to examine.
FMT is a repeat count followed by a
format letter and a size letter.
Format letters are o(octal), x(hex),
d(decimal), u(unsigned decimal),
t(binary), f(float), a(address),
i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword),
w(word), g(giant, 8 bytes).
The specified number of objects of the
specified size are printed
according to the format.
Defaults for format and size letters
are those previously used.
Default count is 1. Default
address is following last thing printed
with this command or "print".
HELP DATA
Muthukumar Kandasamy <[email protected]>