📄 refcard.tex
字号:
info reg \opt{\it rn}$\ldots$\parinfo all-reg \opt{\it rn}®ister values \opt{for regs {\it rn\/}} inselected frame; {\tt all-reg} includes floating point\crinfo catch&exception handlers active in selected frame\cr\endsec\vfill\eject\sec Execution Control;continue \opt{\it count}\parc \opt{\it count}&continue running; if {\it count} specified, ignorethis breakpoint next {\it count} times\cr\crstep \opt{\it count}\pars \opt{\it count}&execute until another line reached; repeat {\it count} times ifspecified\crstepi \opt{\it count}\parsi \opt{\it count}&step by machine instructions rather than sourcelines\cr\crnext \opt{\it count}\parn \opt{\it count}&execute next line, including any function calls\crnexti \opt{\it count}\parni \opt{\it count}&next machine instruction rather than sourceline\cr\cruntil \opt{\it location}&run until next instruction (or {\itlocation})\crfinish&run until selected stack frame returns\crreturn \opt{\it expr}&pop selected stack frame without executing\opt{setting return value}\crsignal {\it num}&resume execution with signal {\it s} (none if {\tt 0})\crjump {\it line}\parjump *{\it address}&resume execution at specified {\it line} number or{\it address}\crset var={\it expr}&evaluate {\it expr} without displaying it; use foraltering program variables\cr\endsec\sec Display;print \opt{\tt/{\it f}\/} \opt{\it expr}\parp \opt{\tt/{\it f}\/} \opt{\it expr}&show value of {\it expr} \opt{orlast value \tt \$} according to format {\it f}:\cr\qquad x&hexadecimal\cr\qquad d&signed decimal\cr\qquad u&unsigned decimal\cr\qquad o&octal\cr\qquad t&binary\cr\qquad a&address, absolute and relative\cr\qquad c&character\cr\qquad f&floating point\crcall \opt{\tt /{\it f}\/} {\it expr}&like {\tt print} but does not display{\tt void}\crx \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 h}\ halfwords (two bytes)\cr&{\tt\qquad w}\ words (four bytes)\cr&{\tt\qquad g}\ giant words (eight bytes)\cr\quad {\it f}&printing format. Any {\tt print} format, or\cr&{\tt\qquad s}\ null-terminated string\cr&{\tt\qquad i}\ machine instructions\crdisassem \opt{\it addr}&display memory as machine instructions\cr\endsec\sec Automatic Display;display \opt{\tt/\it f\/} {\it expr}&show value of {\it expr} each timeprogram stops \opt{according to format {\it f}\/}\crdisplay&display all enabled expressions on list\crundisplay {\it n}&remove number(s) {\it n} from list ofautomatically displayed expressions\crdisable disp {\it n}&disable display for expression(s) number {\itn}\crenable disp {\it n}&enable display for expression(s) number {\itn}\crinfo display&numbered list of display expressions\cr\endsec\vfill\eject\sec Expressions;{\it expr}&an expression in C, C++, or Modula-2 (including function calls), or:\cr{\it addr\/}@{\it len}&an array of {\it len} elements beginning at {\itaddr}\cr{\it file}::{\it nm}&a variable or function {\it nm} defined in {\itfile}\cr$\tt\{${\it type}$\tt\}${\it addr}&read memory at {\it addr} as specified{\it type}\cr\$&most recent displayed value\cr\${\it n}&{\it n}th displayed value\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\crshow values \opt{{\it n}}&show last 10 values \opt{or surrounding\${\it n}}\crshow convenience&display all convenience variables\cr\endsec\sec Symbol Table;info address {\it s}&show where symbol {\it s} is stored\crinfo func \opt{\it regex}&show names, types of defined functions(all, or matching {\it regex})\crinfo var \opt{\it regex}&show names, types of global variables (all,or matching {\it regex})\crwhatis \opt{\it expr}\parptype \opt{\it expr}&show data type of {\it expr} \opt{or \tt \$}without evaluating; {\tt ptype} gives more detail\crptype {\it type}&describe type, struct, union, or enum\cr\endsec\sec GDB Scripts;source {\it script}&read, execute GDB commands from file {\itscript}\cr\crdefine {\it cmd}\par\qquad {\it command-list}&create new GDB command {\it cmd}; execute script defined by {\it command-list}\crend&end of {\it command-list}\crdocument {\it cmd}\par\qquad {\it help-text}&create online documentation for new GDB command {\it cmd}\crend&end of {\it help-text}\cr\endsec\sec Signals;handle {\it signal} {\it act}&specify GDB actions for {\it signal}:\cr\quad print&announce signal\cr\quad noprint&be silent for signal\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\crinfo 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\crhelp target&display available targets\crattach {\it param}&connect to another process\crdetach&release target from GDB control\cr\endsec\vfill\eject\sec Controlling GDB;set {\it param} {\it value}&set one of GDB's internal parameters\crshow {\it param}&display current setting of parameter\cr\xtra{\rm Parameters understood by {\tt set} and {\tt show}:}\quad complaints {\it limit}&number of messages on unusual symbols\cr\quad confirm {\it on/off}&enable or disable cautionary queries\cr\quad editing {\it on/off}&control {\tt readline} command-line editing\cr\quad height {\it lpp}&number of lines before pause in display\cr\quad language {\it lang}&Language for GDB expressions ({\tt auto}, {\tt c} or{\tt modula-2})\cr\quad listsize {\it n}&number of lines shown by {\tt list}\cr\quad prompt {\it str}&use {\it str} as GDB prompt\cr\quad radix {\it base}&octal, decimal, or hex number representation\cr\quad verbose {\it on/off}&control messages when loadingsymbols\cr\quad width {\it cpl}&number of characters before line folded\cr\quad write {\it on/off}&Allow or forbid patching binary, core files(when reopened with {\tt exec} or {\tt core})\cr\quad history $\ldots$\par\quad h $\ldots$&groups with the following options:\cr\quad h exp {\it off/on}&disable/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 forcommand history\cr\cr\quad print $\ldots$\par\quad p $\ldots$&groups with the following options:\cr\quad p address {\it on/off}&print memory addresses in stacks,values\cr\quad p array {\it off/on}&compact or attractive format forarrays\cr\quad p demangl {\it on/off}&source (demangled) or internal form for C++symbols\cr\quad p asm-dem {\it on/off}&demangle C++ symbols inmachine-instruction output\cr\quad p elements {\it limit}&number of array elements to display\cr\quad p object {\it on/off}&print C++ derived types for objects\cr\quad p pretty {\it off/on}&struct display: compact or indented\cr\quad p union {\it on/off}&display of union members\cr\quad p vtbl {\it off/on}&display of C++ virtual functiontables\cr\crshow commands&show last 10 commands\crshow commands {\it n}&show 10 commands around number {\it n}\crshow commands +&show next 10 commands\cr\endsec\sec Working Files;file \opt{\it file}&use {\it file} for both symbols and executable;with no arg, discard both\crcore \opt{\it file}&read {\it file} as coredump; or discard\crexec \opt{\it file}&use {\it file} as executable only; or discard\crsymbol \opt{\it file}&use symbol table from {\it file}; or discard\crload {\it file}&dynamically link {\it file\/} and add its symbols\cradd-sym {\it file} {\it addr}&read additional symbols from {\it file},dynamically loaded at {\it addr}\crinfo files&display working files and targets in use\crpath {\it dirs}&add {\it dirs} to front of path searched forexecutable and symbol files\crshow path&display executable and symbol file path\crinfo share&list names of shared libraries currently loaded\cr\endsec\vfill\eject\sec Source Files;dir {\it names}&add directory {\it names} to front of source path\crdir&clear source path\crshow dir&show current source path\cr\crlist&show next ten lines of source\crlist -&show previous ten lines\crlist {\it lines}&display source centered around {\it lines}, 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 function}&beginning of function \opt{innamed file}\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 address}&line containing {\it address}\crlist {\it f},{\it l}&from line {\it f} to line {\it l}\crinfo line {\it num}&show starting, ending addresses of compiled code forsource line {\it num}\crinfo source&show name of current source file\crinfo sources&list all source files in use\crforw {\it regex}&search following source lines for {\it regex}\crrev {\it regex}&search preceding source lines for {\it regex}\cr\endsec\sec GDB under GNU Emacs;M-x gdb&run GDB under Emacs\cr\ctl{h} m&describe GDB mode\crM-s&step one line ({\tt step})\crM-n&next line ({\tt next})\crM-i&step one instruction ({\tt stepi})\cr\ctl{c} \ctl{f}&finish current stack frame ({\tt finish})\crM-c&continue ({\tt cont})\crM-u&up {\it arg} frames ({\tt up})\crM-d&down {\it arg} frames ({\tt down})\cr\ctl{x} \&© number from point, insert at end\cr\ctl{x} SPC&(in source file) set break at point\cr\endsec\sec GDB License;show copying&Display GNU General Public License\crshow warranty&There is NO WARRANTY for GDB. Display full no-warrantystatement.\cr \endsec\vfill{\smrm\parskip=6pt\centerline{Copyright \copyright 1991, 1992 Free Software Foundation, Inc.}\centerline{Roland Pesch (pesch@cygnus.com), January 1992---\manvers}\centerline{The author assumes no responsibility for any errors on this card.}This card may be freely distributed under the terms of the GNUGeneral Public License.\centerline{Please contribute to development of this card byannotating it.}GDB itself is free software; you are welcome to distribute copies ofit under the terms of the GNU General Public License. There isabsolutely no warranty for GDB.}\end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -