(1) Updated to reflect renamed commands;

(2) Reorganized, bringing more common commands forward, merging
    "print" and "x" into one section;
(3) New sections: "Essential Commands", "GDB Scripts";
(4) Material on convenience vars and value history added to "Expressions";
(5) Uses PostScript fonts by default, also includes (commented out) alternative
    Computer Modern font definitions that format similarly.
This commit is contained in:
Roland Pesch 1991-05-07 19:38:33 +00:00
parent d6079be71e
commit 98088880f3

View File

@ -1,4 +1,5 @@
%This file is TeX source for a reference card describing GDB, the GNU debugger. %This file is TeX source for a reference card describing GDB, the GNU debugger.
%$Id$
%Copyright (C) 1991 Free Software Foundation, Inc. %Copyright (C) 1991 Free Software Foundation, Inc.
%Permission is granted to make and distribute verbatim copies of %Permission is granted to make and distribute verbatim copies of
%this reference provided the copyright notices and permission notices %this reference provided the copyright notices and permission notices
@ -34,6 +35,12 @@
% support of free software. For general information % support of free software. For general information
% contact ``info@cygnus.com'' % contact ``info@cygnus.com''
% %
% NOTE ON INTENTIONAL OMISSIONS: This reference card includes most GDB
% commands, but due to space constraints there are some things I chose
% to omit. In general, not all synonyms for commands are covered.
% The GDB-under-Emacs section omits gdb-mode functions without default
% keybindings. GDB startup options are not described.
%
% %
\input threecol \input threecol
{% {%
@ -41,15 +48,34 @@
\xdef\manvers{\$Revision$}% \xdef\manvers{\$Revision$}%
} }
\vsize=8in \vsize=8in
\hyphenpenalty=5000\tolerance=2000\raggedright \hyphenpenalty=5000\tolerance=2000\raggedright\raggedbottom
% %
\font\bbf=cmbx10 %The Times-Roman family is used below because it is both more
\font\vbbf=cmbx12 %attractive and more compact than Computer Modern. On the other hand,
\font\smrm=cmr6 %while common, it is not Free. The commented-out font definitions
\font\brm=cmr10 %will be close (but may cause some column overflows) if you must use
\font\rm=cmr8 %the CM fonts.
\font\it=cmti8 %\font\bbf=cmbx10
\font\bbf=Times-Bold at 10pt
%\font\vbbf=cmbx12
\font\vbbf=Times-Bold at 12pt
%\font\smrm=cmr5
\font\smrm=Times-Roman at 6pt
%\font\brm=cmr10
\font\brm=Times-Roman at 10pt
%\font\rm=cmr7
\font\rm=Times-Roman at 8pt
%\font\it=cmti7
\font\it=Times-Italic at 8pt
% We *do* use CMtt rather than Courier because TeX and PS fonts have
% different ideas about where ``funny'' chars go.
\font\tt=cmtt8 \font\tt=cmtt8
% Finally, the following common-but-not-free font (Symbol) is used
% only for the copyright symbol. Comment out the whole definition of
% \copyright if you insist on using only Free fonts, and you'll pick
% up the kluge in plain.tex that defines \copyright by overstriking.
\font\sym=Symbol at 7pt
\def\copyright{{\sym\char'323}}
\normalbaselineskip=9pt\baselineskip=9pt \normalbaselineskip=9pt\baselineskip=9pt
% %
\parindent=0pt \parindent=0pt
@ -77,7 +103,19 @@
{\vbbf GDB QUICK REFERENCE} {\vbbf GDB QUICK REFERENCE}
\vskip 5pt \vskip 5pt
{\smrm GDB Version 4.00---Cygnus Support 1991} {\smrm GDB Version 4.0---Cygnus Support 1991}
\sec Essential Commands;
gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{using
coredump {\it core}}\cr
bt& backtrace: display program stack\cr
b \opt{\it file\tt:}{\it function}&set breakpoint at {\it function} \opt{in \it file}\cr
run \opt{{\it arglist}}&start your program \opt{with {\it arglist}}\cr
p {\it expr}&display the value of an expression\cr
c &continue running your program\cr
n &execute next line, including function calls\cr
s &execute until another line is reached\cr
\endsec
\sec Starting GDB; \sec Starting GDB;
gdb&starts GDB, with no debugging files\cr gdb&starts GDB, with no debugging files\cr
@ -86,14 +124,14 @@ gdb {\it program core}&debug coredump {\it core} produced by {\it program}\cr
\endsec \endsec
\sec Stopping GDB; \sec Stopping GDB;
quit&Exit GDB; abbreviate as {\tt q} or {\tt EOF}\par (eg \ctl{d})\cr quit&exit GDB; also {\tt q} or {\tt EOF} (eg \ctl{d})\cr
INTERRUPT&(eg \ctl{c}) terminate current command\cr INTERRUPT&(eg \ctl{c}) terminate current command, or send to running process\cr
\endsec \endsec
\sec Getting Help; \sec Getting Help;
help&List classes of commands\cr help&list classes of commands\cr
help {\it class}&One-line descriptions for commands in {\it class}\cr help {\it class}&one-line descriptions for commands in {\it class}\cr
help {\it command}&Describe {\it command}\cr help {\it command}&describe {\it command}\cr
\endsec \endsec
\sec Executing your Program; \sec Executing your Program;
@ -102,9 +140,9 @@ run&start your program with current argument list\cr
run $\ldots$ <{\it inf} >{\it outf}&start program with input, output run $\ldots$ <{\it inf} >{\it outf}&start program with input, output
redirected\cr redirected\cr
\cr \cr
kill&Kill running program\cr kill&kill running program\cr
\cr \cr
tty {\it dev}&Use {\it dev} as default i/o for next {\tt run}\cr tty {\it dev}&use {\it dev} as stdin and stdout for next {\tt run}\cr
set args {\it arglist}&specify {\it arglist} for next set args {\it arglist}&specify {\it arglist} for next
{\tt run}\cr {\tt run}\cr
set args&specify empty argument list\cr set args&specify empty argument list\cr
@ -112,279 +150,315 @@ show args&display argument list\cr
\cr \cr
show environment&show all environment variables\cr show environment&show all environment variables\cr
show env {\it var}&show value of environment variable {\it var}\cr show env {\it var}&show value of environment variable {\it var}\cr
set env {\it var} {\it expr}&set environment variable {\it var}\cr set env {\it var} {\it string}&set environment variable {\it var}\cr
delete env {\it var}&Remove {\it var} from environment\cr unset env {\it var}&remove {\it var} from environment\cr
\endsec \endsec
\sec Shell Commands; \sec Shell Commands;
cd {\it dir}&Change working directory to {\it dir}\cr cd {\it dir}&change working directory to {\it dir}\cr
pwd&Print working directory\cr pwd&Print working directory\cr
make $\ldots$&Call ``{\tt make}''\cr make $\ldots$&call ``{\tt make}''\cr
shell {\it cmd}&Execute arbitrary shell command string\cr shell {\it cmd}&execute arbitrary shell command string\cr
\endsec \endsec
\vfill \vfill
\centerline{\smrm \copyright 1991 Free Software Foundation, Inc.\qquad Permissions on back} \centerline{\smrm \copyright 1991 Free Software Foundation, Inc.\qquad Permissions on back}
\eject \eject
\sec Breakpoints and Watchpoints; \sec Breakpoints and Watchpoints;
break \opt{\it file\tt:}{\it line}&Set breakpoint at {\it line} number \opt{in \it file}\par break \opt{\it file\tt:}{\it line}\par
b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par
eg:\quad{\tt break main.c:37}\quad\cr eg:\quad{\tt break main.c:37}\quad\cr
break \opt{\it file\tt:}{\it fun}&Set breakpoint at {\it break \opt{\it file\tt:}{\it function}&set breakpoint at {\it
fun}() \opt{in \it file}\cr function} \opt{in \it file}\cr
break +{\it offset}\par break +{\it offset}\par
break -{\it offset}&Set break at offset from current stop\cr break -{\it offset}&set break at {\it offset} lines from current stop\cr
break *{\it addr}&Set breakpoint at address {\it addr}\cr break *{\it addr}&set breakpoint at address {\it addr}\cr
break&Set breakpoint at next instruction\cr break&set breakpoint at next instruction\cr
break $\ldots$ if {\it expr}&Break conditionally on nonzero {\it expr}\cr break $\ldots$ if {\it expr}&break conditionally on nonzero {\it expr}\cr
cond {\it bno} \opt{\it expr}&New conditional expression on breakpoint cond {\it n} \opt{\it expr}&new conditional expression on breakpoint
number {\it bno}; make unconditional if no {\it expr}\cr {\it n}; make unconditional if no {\it expr}\cr
tbreak $\ldots$&Temporary break; disable when reached\cr tbreak $\ldots$&temporary break; disable when reached\cr
rbreak {\it regex}&Break on all functions matching {\it regex}\cr rbreak {\it regex}&break on all functions matching {\it regex}\cr
watch {\it expr}&Set a watchpoint for expression {\it expr}\cr watch {\it expr}&set a watchpoint for expression {\it expr}\cr
catch {\it x}&Set breakpoint at C++ handler for exception {\it x}\cr catch {\it x}&break at C++ handler for exception {\it x}\cr
\cr \cr
info break&Show defined breakpoints\cr info break&show defined breakpoints\cr
info watch&Show defined watchpoints\cr info watch&show defined watchpoints\cr
\cr \cr
clear&Delete breakpoints at next instruction\cr clear&delete breakpoints at next instruction\cr
clear \opt{\it file\tt:}{\it fun}&Delete breakpoints at entry to {\it fun}()\cr clear \opt{\it file\tt:}{\it fun}&delete breakpoints at entry to {\it fun}()\cr
clear \opt{\it file\tt:}{\it line}&Delete breakpoints on source line \cr clear \opt{\it file\tt:}{\it line}&delete breakpoints on source line \cr
delete \opt{{\it bnos}}&Delete breakpoints numbered {\it bnos}; delete \opt{{\it n}}&delete breakpoints {\it n};
\opt{or all breakpoints}\cr \opt{or all breakpoints}\cr
\cr \cr
disable \opt{{\it bnos}}&Disable breakpoints {\it bnos} \opt{or all}\cr disable \opt{{\it n}}&disable breakpoints {\it n} \opt{or all}\cr
enable {\it bnos}&Enable breakpoints {\it bnos} \opt{or all}\cr enable \opt{{\it n}}&enable breakpoints {\it n} \opt{or all}\cr
enable once {\it bnos}&Enable breakpoints; disable again when enable once \opt{{\it n}}&enable breakpoints; disable again when
reached\cr reached\cr
enable del {\it bnos}&Enable breakpoints; delete when reached\cr enable del \opt{{\it n}}&enable breakpoints; delete when reached\cr
\cr \cr
ignore {\it bno} {\it count}&Ignore breakpoint number {\it bno}, {\it count} ignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count}
times\cr times\cr
\cr \cr
commands {\it bno}\par commands {\it n}\par
\qquad {\it command list}&Execute GDB {\it command list} every time breakpoint {\it bno} is reached\cr \qquad {\it command list}&execute GDB {\it command list} every time breakpoint {\it n} is reached\cr
end&(use only with {\tt commands}) End of {\it command list}\cr end&end of {\it command list}\cr
\endsec \endsec
\sec Signals; \sec Program Stack;
handle {\it signal} {\it act}&Specify GDB actions when {\it signal} occurs:\cr backtrace \opt{\it n}\par
\quad print&Announce when signal occurs\cr bt \opt{\it n}&print trace of all frames in stack; or of {\it n}
\quad noprint&Be silent when signal occurs\cr frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\cr
\quad stop&Halt execution on signal\cr frame \opt{\it n}&select frame number {\it n} or frame at address {\it
\quad nostop&Do not halt execution\cr n}; if no {\it n}, display current frame\cr
\quad pass&Allow your program to handle signal\cr up {\it n}&select frame {\it n} frames up\cr
\quad nopass&Do not allow your program to see signal\cr down {\it n}&select frame {\it n} frames down\cr
info signal&Show table of signals and GDB action for each\cr info frame \opt{\it addr}&describe selected frame, or frame at
{\it addr}\cr
info args&arguments of selected frame\cr
info locals&local variables of selected frame\cr
info reg \opt{\it{rn}}&register values \opt{for reg {\it rn\/}} in selected frame\cr
info catch&exception handlers active in selected frame\cr
\endsec \endsec
\vfill\eject \vfill\eject
\sec Execution Control; \sec Execution Control;
continue \opt{\it count}\par continue \opt{\it count}\par
c \opt{\it count}&Continue running; if {\it count} specified, ignore c \opt{\it count}&continue running; if {\it count} specified, ignore
this breakpoint next {\it count} times\cr this breakpoint next {\it count} times\cr
\cr \cr
step \opt{\it count}\par step \opt{\it count}\par
s \opt{\it count}&Execute until another line reached; repeat {\it count} times if s \opt{\it count}&execute until another line reached; repeat {\it count} times if
specified\cr specified\cr
\cr \cr
stepi \opt{\it count}\par stepi \opt{\it count}\par
si \opt{\it count}&Step by machine instructions rather than source si \opt{\it count}&step by machine instructions rather than source
lines\cr lines\cr
\cr \cr
next \opt{\it count}\par next \opt{\it count}\par
n \opt{\it count}&Execute next line, including any function calls.\cr n \opt{\it count}&execute next line, including any function calls\cr
\cr \cr
nexti \opt{\it count}\par nexti \opt{\it count}\par
ni \opt{\it count}&Next machine instruction rather than source ni \opt{\it count}&next machine instruction rather than source
line\cr line\cr
\cr \cr
until \opt{\it location}&Run until next instruction (or {\it until \opt{\it location}&run until next instruction (or {\it
location}) reached\cr location})\cr
\cr finish&run until selected stack frame returns\cr
finish&Run until selected stack frame returns\cr return \opt{\it expr}&pop selected stack frame without executing
return \opt{\it expr}&Pop selected stack frame without executing, \opt{setting return value}\cr
optionally setting return value\cr signal {\it num}&resume execution with signal {\it s} (none if {\tt 0})\cr
\cr
signal {\it num}&Resume execution with signal {\it num} (none if {\tt 0})\cr
jump {\it line}\par jump {\it line}\par
jump *{\it address}&Resume execution at specified {\it line} number or jump *{\it address}&resume execution at specified {\it line} number or
{\it address}\cr {\it address}\cr
set var {\it expr}&Evaluate {\it expr} without displaying it; use for set var={\it expr}&evaluate {\it expr} without displaying it; use for
altering program variables\cr altering program variables\cr
\endsec \endsec
\sec Debugging Targets; \sec Display;
target {\it type} {\it param}&Connect to target machine, process, or file\cr
info targets&Display available targets\cr
attach {\it param}&Connect to another target of same type\cr
detach&Release target from GDB control\cr
\endsec
\sec Expressions;
{\it expr}&An expression in C or C++ (including function calls), or:\cr
{\it addr\/}@{\it len}&An array of {\it len} elements beginning at {\it
addr}\cr
{\it file}::{\it nm}&A variable or function {\it nm} defined in {\it
file}\cr
$\tt\{${\it type}$\tt\}${\it addr}&Read memory at {\it addr} as specified
{\it type}\cr
print \opt{\tt/{\it f}\/} {\it expr}\par print \opt{\tt/{\it f}\/} {\it expr}\par
p \opt{\tt/{\it f}\/} {\it expr}&Display the value of an expression\par p \opt{\tt/{\it f}\/} {\it expr}&show value of {\it expr} according to format {\it f}:\cr
in format {\it f}:\cr
\qquad x&hexadecimal\cr \qquad x&hexadecimal\cr
\qquad d&signed decimal\cr \qquad d&signed decimal\cr
\qquad u&unsigned decimal\cr \qquad u&unsigned decimal\cr
\qquad o&octal\cr \qquad o&octal\cr
\qquad a&address, absolute and relative\cr \qquad a&address, absolute and relative\cr
\qquad c&character constant\cr \qquad c&character\cr
\qquad f&floating point\cr \qquad f&floating point\cr
call \opt{\tt /{\it f}\/} {\it expr}&Like {\tt print} but does not display call \opt{\tt /{\it f}\/} {\it expr}&like {\tt print} but does not display
{\tt void}\cr {\tt void}\cr
\endsec x \opt{\tt/{\it Nuf}\/} {\it expr}&examine memory at address {\it expr};
optional format spec follows slash\cr
\vfill\eject \quad {\it N}&count of how many units to display\cr
\sec Memory; \quad {\it u}&unit size; one of\cr
x \opt{\tt/{\it Nuf}\/} {\it expr}&Examine memory at address {\it expr};
optional format spec follows slash.\cr
\quad {\it N}&Count of how many units to display;\cr
\quad {\it u}&Unit size; one of\cr
&{\tt\qquad b}\ individual bytes\cr &{\tt\qquad b}\ individual bytes\cr
&{\tt\qquad h}\ halfwords (two bytes)\cr &{\tt\qquad h}\ halfwords (two bytes)\cr
&{\tt\qquad w}\ words (four bytes)\cr &{\tt\qquad w}\ words (four bytes)\cr
&{\tt\qquad g}\ giant words (eight bytes)\cr &{\tt\qquad g}\ giant words (eight bytes)\cr
\quad {\it f}&Printing format. Any {\tt print} format, or\cr \quad {\it f}&printing format. Any {\tt print} format, or\cr
&{\tt\qquad s}\ Null-terminated string\cr &{\tt\qquad s}\ null-terminated string\cr
&{\tt\qquad i}\ Machine instructions\cr &{\tt\qquad i}\ machine instructions\cr
disassem \opt{\it addr}&Display range of memory as machine disassemble \opt{\it addr}&display memory as machine instructions\cr
instructions; function surrounding {\it addr} or program counter, or range between two arguments\cr
\endsec \endsec
\sec Automatic Display; \sec Automatic Display;
display \opt{\tt/\it f\/} {\it expr}&Show value of {\it expr} each time display \opt{\tt/\it f\/} {\it expr}&show value of {\it expr} each time
program stops \opt{according to format {\it f}\/}\cr program stops \opt{according to format {\it f}\/}\cr
display&Display all enabled expressions on list\cr display&display all enabled expressions on list\cr
undisplay {\it dnos}&Remove number(s) {\it dnos} from list of undisplay {\it n}&remove number(s) {\it n} from list of
automatically displayed expressions\cr automatically displayed expressions\cr
disable dis {\it dnos}&Disable display for expression(s) number {\it disable display {\it n}&disable display for expression(s) number {\it
dnos}\cr n}\cr
enable dis {\it dnos}&Enable display for expression(s) number {\it enable display {\it n}&enable display for expression(s) number {\it
dnos}\cr n}\cr
info display&Show numbered list of expressions to display\cr info display&numbered list of display expressions\cr
\endsec \endsec
\sec Program Stack; \vfill\eject
backtrace \opt{\it n}\par
bt \opt{\it n}&Print trace of all frames in stack; or of {\it n} \sec Expressions;
frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\cr {\it expr}&an expression in C or C++ (including function calls), or:\cr
frame \opt{\it n}&Select frame number {\it n} or frame at address {\it {\it addr\/}@{\it len}&an array of {\it len} elements beginning at {\it
n}; if no {\it n}, display current frame\cr addr}\cr
up {\it n}&Select frame {\it n} frames up\cr {\it file}::{\it nm}&a variable or function {\it nm} defined in {\it
down {\it n}&Select frame {\it n} frames down\cr file}\cr
info frame \opt{\it addr}&Description of selected frame, or frame at $\tt\{${\it type}$\tt\}${\it addr}&read memory at {\it addr} as specified
{\it addr}\cr {\it type}\cr
info args&Arguments of selected frame\cr \$&most recent displayed value\cr
info locals&Local variables of selected frame\cr \${\it n}&{\it n}th displayed value\cr
info catch&Exception handlers active in selected frame\cr \$\$&displayed value previous to \$\cr
\$\${\it n}&{\it n}th displayed value back from \$\cr
\$\_&last address examined with {\tt x}\cr
\$\_\_&value at address \$\_\cr
\${\it var}&convenience variable; assign any value\cr
\cr
show values \opt{{\it n}}&show last 10 values \opt{or surrounding
\${\it n}}\cr
show convenience&display all convenience variables\cr
\endsec \endsec
\sec Symbol Table; \sec Symbol Table;
info address {\it s}&Show where symbol {\it s} is stored\cr info address {\it s}&show where symbol {\it s} is stored\cr
info func \opt{\it regex}&Show names, types of defined functions info func \opt{\it regex}&show names, types of defined functions
(all, or matching {\it regex})\cr (all, or matching {\it regex})\cr
info var \opt{\it regex}&Show names, types of global variables (all, info var \opt{\it regex}&show names, types of global variables (all,
or matching {\it regex})\cr or matching {\it regex})\cr
info sources&Show all sources having debugging information\cr
whatis {\it expr}\par whatis {\it expr}\par
ptype {\it expr}&Show data type of {\it expr} without evaluating; {\tt ptype {\it expr}&show data type of {\it expr} without evaluating; {\tt
ptype} gives more detail\cr ptype} gives more detail\cr
ptype {\it type}&Describe type, struct, union, or enum\cr ptype {\it type}&describe type, struct, union, or enum\cr
\endsec
\sec GDB Scripts;
source {\it script}&read, execute GDB commands from file {\it
script}\cr
\cr
define {\it cmd}\par
\qquad {\it command list}&new GDB command {\it cmd}, executes script
defined by {\it command list} \cr
end&end of {\it command list}\cr
document {\it cmd}\par
\qquad {\it help text}&new online documentation for GDB command {\it
cmd}\cr
end&end of {\it help text}\cr
\endsec
\sec Signals;
handle {\it signal} {\it act}&specify GDB actions when {\it signal} occurs:\cr
\quad print&announce when signal occurs\cr
\quad noprint&be silent when signal occurs\cr
\quad stop&halt execution on signal\cr
\quad nostop&do not halt execution\cr
\quad pass&allow your program to handle signal\cr
\quad nopass&do not allow your program to see signal\cr
info signals&show table of signals, GDB action for each\cr
\endsec
\sec Debugging Targets;
target {\it type} {\it param}&connect to target machine, process, or file\cr
help target&display available targets\cr
attach {\it param}&connect to another process\cr
detach&release target from GDB control\cr
\endsec \endsec
\vfill\eject \vfill\eject
\sec Controlling GDB; \sec Controlling GDB;
set {\it param} {\it expr}&Set one of GDB's internal parameters, set {\it param} {\it expr}&set one of GDB's internal parameters\cr
controlling its interaction with you\cr show {\it param}&display current setting of a GDB parameter\cr
show {\it param}&Display current setting of a GDB parameter\cr
\xtra{\rm Parameters understood by {\tt set} and {\tt show}:} \xtra{\rm Parameters understood by {\tt set} and {\tt show}:}
\quad addressp {\it on/off}&print memory addresses in stacks, \quad complaints {\it limit}&number of messages on unusual symbols\cr
structs\cr \quad confirm {\it on/off}&enable or disable cautionary queries\cr
\quad array-max {\it limit}&Number of elements to display from an \quad editing {\it on/off}&control {\tt readline} command-line editing\cr
array\cr \quad height {\it lpp}&number of lines before pause in
\quad arraypr {\it off/on}&Compact or attractive format for display\cr
arrays\cr \quad prompt {\it str}&use {\it str} as GDB prompt\cr
\quad caution {\it on/off}&Enable or disable cautionary queries\cr \quad radix {\it base}&octal, decimal, or hex number representation\cr
\quad editing {\it on/off}&Control {\tt readline} command-line editing\cr \quad verbose {\it on/off}&control messages when loading
\quad history&({\tt h}) covers a number of options:\cr symbol table\cr
\quad h exp {\it off/on}&Disable or enable {\tt readline} history expansion\cr \quad width {\it cpl}&number of characters before line folded\cr
\quad h file {\it filename}&File for recording GDB command history\cr \cr
\quad h size {\it size}&Number of commands kept in history list\cr \quad history $\ldots$&({\tt h}) groups the following options:\cr
\quad h write {\it off/on}&Control use of external file for \quad h exp {\it off/on}&disable or enable {\tt readline} history expansion\cr
\quad h file {\it filename}&file for recording GDB command history\cr
\quad h size {\it size}&number of commands kept in history list\cr
\quad h save {\it off/on}&control use of external file for
command history\cr command history\cr
\cr \cr
\quad pretty {\it off/on}&Compact or indented format for struct \quad print $\ldots$&({\tt p}) groups the following options:\cr
display\cr \quad p address {\it on/off}&print memory addresses in stacks,
\quad prompt {\it str}&Use {\it str} as GDB prompt\cr values\cr
\quad radix {\it base}&Octal, decimal, or hex number representation\cr \quad p array {\it off/on}&compact or attractive format for
\quad screen-h {\it lpp}&Number of lines before pause in arrays\cr
display\cr \quad p demangle {\it on/off}&source or internal form for C++
\quad screen-w {\it cpl}&Number of characters before line folded\cr symbols\cr
\quad unionpr {\it on/off}&Enable or disable display of unions in \quad p asm-dem {\it on/off}&demangle C++ symbols in
structs\cr machine-instruction output\cr
\quad verbose {\it on/off}&Control messages when loading \quad p elements {\it limit}&number of elements to display from an
symbol table\cr array\cr
\quad vtblpr {\it off/on}&Display of C++ virtual function tables\cr \quad p object {\it on/off}&print C++ derived types for objects\cr
info editing&Show last 10 commands\cr \quad p pretty {\it off/on}&struct display: compact or indented\cr
info editing {\it n}&Show 10 commands around number {\it n}\cr \quad p union {\it on/off}&enable or disable display of union members\cr
info editing +&Show next 10 commands\cr \quad p vtbl {\it off/on}&display of C++ virtual function
tables\cr
\cr
show commands&show last 10 commands\cr
show commands {\it n}&show 10 commands around number {\it n}\cr
show commands +&show next 10 commands\cr
\endsec \endsec
\sec Working Files; \sec Working Files;
file {\it name}&Use {\it file} for symbols and executable\cr file {\it name}&use {\it file} for symbols and executable\cr
core {\it name}&Read {\it file} as coredump\cr core {\it name}&read {\it file} as coredump\cr
exec {\it name}&Use {\it file} as executable only\cr exec {\it name}&use {\it file} as executable only\cr
symbol {\it name}&Use only symbol table from {\it file}\cr symbol {\it name}&use only symbol table from {\it file}\cr
load {\it file} {\it addr}&Read additional symbols from {\it file}, load {\it file}&dynamically link {\it file\/} and add its symbols\cr
add-sym {\it file} {\it addr}&read additional symbols from {\it file},
dynamically loaded at {\it addr}\cr dynamically loaded at {\it addr}\cr
info files&Display working files and targets in use\cr info files&display working files and targets in use\cr
\cr path {\it dirs}&add {\it dirs} to front of path searched for
share \opt{\it regex}&Add symbol information for shared libraries executable and symbol files\cr
info path&display executable and symbol file path\cr
share \opt{\it regex}&add symbol information for shared libraries
matching {\it regex}, or all shared libraries\cr matching {\it regex}, or all shared libraries\cr
info share&List names of shared libraries currently loaded\cr info share&list names of shared libraries currently loaded\cr
\endsec \endsec
\vfill\eject \vfill\eject
\sec Source Files; \sec Source Files;
dir {\it name}&Add directory {\it name} to front of source path\cr dir {\it names}&add directory {\it names} to front of source path\cr
dir&Clear source path\cr dir&clear source path\cr
info dir&Show current source path\cr show dir&show current source path\cr
\cr \cr
list&Show next ten lines of source\cr list&show next ten lines of source\cr
list -&Show previous ten lines\cr list -&show previous ten lines\cr
list {\it lines}&Display source centered around {\it lines}, list {\it lines}&display source centered around {\it lines},
specified as one of:\cr specified as one of:\cr
\quad{\opt{\it file\tt:}\it num}&Line number \opt{in named file}\cr \quad{\opt{\it file\tt:}\it num}&line number \opt{in named file}\cr
\quad{\opt{\it file\tt:}\it function}&Beginning of function \opt{in \quad{\opt{\it file\tt:}\it function}&beginning of function \opt{in
named file}\cr named file}\cr
\quad{\tt +\it off}&{\it off} lines after last printed\cr \quad{\tt +\it off}&{\it off} lines after last printed\cr
\quad{\tt -\it off}&{\it off} lines previous to last printed\cr \quad{\tt -\it off}&{\it off} lines previous to last printed\cr
\quad{\tt*\it address}&Line containing {\it address}\cr \quad{\tt*\it address}&line containing {\it address}\cr
list {\it f},{\it l}&from line {\it f} to line {\it l}\cr list {\it f},{\it l}&from line {\it f} to line {\it l}\cr
info line {\it num}&Show starting, ending addresses of compiled code for info line {\it num}&show starting, ending addresses of compiled code for
source line {\it num}\cr source line {\it num}\cr
forw {\it regex}&Search following source lines for {\it regex}\cr info source&show name of current source file\cr
rev {\it regex}&Search preceding source lines for {\it regex}\cr info sources&list all source files in use\cr
forw {\it regex}&search following source lines for {\it regex}\cr
rev {\it regex}&search preceding source lines for {\it regex}\cr
\endsec \endsec
\sec GDB under GNU Emacs; \sec GDB under GNU Emacs;
M-x gdb&Run GDB under Emacs\cr M-x gdb&run GDB under Emacs\cr
\ctl{h} m&Describe GDB mode\cr \ctl{h} m&describe GDB mode\cr
M-s&Step one line ({\tt step})\cr M-s&step one line ({\tt step})\cr
M-n&Next line ({\tt next})\cr M-n&next line ({\tt next})\cr
M-i&Step one instruction ({\tt stepi})\cr M-i&step one instruction ({\tt stepi})\cr
\ctl{c} \ctl{f}&Finish current stack frame ({\tt finish})\cr \ctl{c} \ctl{f}&finish current stack frame ({\tt finish})\cr
M-c&Continue ({\tt cont})\cr M-c&continue ({\tt cont})\cr
M-u&Up {\it arg} frames ({\tt up})\cr M-u&up {\it arg} frames ({\tt up})\cr
M-d&Down {\it arg} frames ({\tt down})\cr M-d&down {\it arg} frames ({\tt down})\cr
\ctl{x} \&&copy number from point, insert at end\cr
\ctl{x} SPC&(in source file) set break at point\cr \ctl{x} SPC&(in source file) set break at point\cr
\endsec \endsec
@ -392,12 +466,12 @@ M-d&Down {\it arg} frames ({\tt down})\cr
\vfill \vfill
{\smrm\parskip=6pt {\smrm\parskip=6pt
\centerline{Copyright \copyright 1991 Free Software Foundation, Inc.} \centerline{Copyright \copyright 1991 Free Software Foundation, Inc.}
\centerline{Roland Pesch (pesch@cygnus.com), January 1991---\manvers} \centerline{Roland Pesch (pesch@cygnus.com), May 1991---\manvers}
\centerline{The author assumes no responsibility for any errors on this card.}
This card may be freely distributed under the terms of the GNU This card may be freely distributed under the terms of the GNU
General Public License. General Public License.
Please contribute to development of this card by annotating it. \centerline{Please contribute to development of this card by annotating it.}
}
No author assumes any responsibility for any errors on this card.}
\end \end