📄 refcard.tex
字号:
%%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%%%This file is TeX source for a reference card describing GDB, the GNU debugger.%$Id: refcard.tex,v 1.96 1992/08/15 11:05:57 gnu Exp $%Copyright (C) 1991, 1992 Free Software Foundation, Inc.%Permission is granted to make and distribute verbatim copies of%this reference provided the copyright notices and permission notices%are preserved on all copies.%%TeX markup is a programming language; accordingly this file is source%for a program to generate a reference.%%This program is free software; you can redistribute it and/or modify%it under the terms of the GNU General Public License as published by%the Free Software Foundation; either version 1, or (at your option)%any later version.%%This program is distributed in the hope that it will be useful, but%WITHOUT ANY WARRANTY; without even the implied warranty of%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU%General Public License for more details.%%You can find a copy of the GNU General Public License in the GDB%manual; or write to the Free Software Foundation, Inc.,%675 Mass Ave, Cambridge, MA 02139, USA.%%You can contact the author as: pesch@cygnus.com%% Roland Pesch% Cygnus Support% 814 University Ave.% Palo Alto, CA 94301 USA%% +1 415 322 3811%% Uncomment the following `magnification' command if you want to print% out in a larger font. Caution! You may need larger paper. You had% best avoid using 3-column output if you try this. See the ``Three% column format'' section below if you want to print in three column% format.%%\magnification=\magstep 1%% 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, nor% all variations of a command.% The GDB-under-Emacs section omits gdb-mode functions without default% keybindings. GDB startup options are not described.% set print sevenbit-strings, set symbol-reloading omitted.% printsyms, printpsyms, omitted since they're for GDB maintenance primarily% share omitted due to obsolescence% set check range/type omitted at least til code is in GDB.%{%\def\$#1${{#1}}% Kluge: collect RCS revision info without $...$\xdef\manvers{\$Revision: 1.96 $}%}%%-------------------- Three column format -----------------------%%%% --- To disable three column format, comment out this entire section% Three-column format for landscape printing on 8.5x11 paper% We want output .25 inch *from paper edge*; i.e. -.75in from TeX default\hoffset=-0.8in \voffset=-0.75in\newdimen\fullhsize\fullhsize=10.5in \hsize=3.3in\def\fulline{\hbox to \fullhsize}\let\lcr=L \newbox\leftcolumn\newbox\centercolumn\output={\if L\lcr \global\setbox\leftcolumn=\columnbox \global\let\lcr=C \else \if C\lcr \global\setbox\centercolumn=\columnbox \global\let\lcr=R \else \tripleformat \global\let\lcr=L \fi \fi% \ifnum\outputpenalty>-20000 \else\dosupereject\fi }%%ALTERNATIVE FOLDING GUIDES:%%For NO printed folding guide, comment out other \def\vdecor's and uncomment:%\def\vdecor{\hskip .2in plus1fil}%%For SOLID LINE folding guide, comment out other \def\vdecor's and uncomment:%\def\vdecor{\hskip .1in plus1fil \vrule width .1pt \hskip .1in plus1fil}%%For SMALL MARKS NEAR TOP AND BOTTOM as folding guide,%comment out other \def\vdecor's and uncomment:\def\vdecor{\hskip .1in plus1fil \vbox to \vsize{\hbox to .1pt{\vrule height 2pt width .1pt}\vfill\hbox to .1pt{\vrule height 2pt width .1pt}}\hskip .1in plus1fil}%%END OF ALTERNATIVES FOR FOLDING GUIDES%\def\tripleformat{\shipout\vbox{\fulline{\box\leftcolumn\vdecor \box\centercolumn\vdecor \columnbox} } \advancepageno}\def\columnbox{\leftline{\pagebody}}\def\bye{\par\vfill \supereject \if R\lcr \null\vfill\eject\fi \end}%-------------------- end three column format -----------------------%-------------------- Computer Modern font defs: --------------------\font\bbf=cmbx10\font\vbbf=cmbx12\font\smrm=cmr6\font\brm=cmr10\font\rm=cmr7\font\it=cmti7\font\tt=cmtt8%-------------------- end font defs ---------------------------------%\vsize=8in\hyphenpenalty=5000\tolerance=2000\raggedright\raggedbottom\normalbaselineskip=9pt\baselineskip=9pt%\parindent=0pt\parskip=0pt\footline={\vbox to0pt{\hss}}%\def\ctl#1{{\tt C-#1}}\def\opt#1{{\brm[{\rm #1}]}}\def\xtra#1{\noalign{\smallskip{\tt#1}}}%\long\def\sec#1;#2\endsec{\vskip 1pc\halign{%%COL 1 (of halign):\vtop{\hsize=1.1in\tt##\par\vskip 2pt }\hfil%COL 2 (of halign):&\vtop{\hsize=2.1in\hangafter=1\hangindent=0.5em\rm ##\par\vskip 2pt}\cr%Tail of \long\def fills in halign body with \sec args:\noalign{{\bbf #1}\vskip 2pt}#2}}{\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 4}\qquad\sec Essential Commands;gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{usingcoredump {\it core}}\crb \opt{\it file\tt:}{\it function}&set breakpoint at {\it function} \opt{in \it file}\crrun \opt{{\it arglist}}&start your program \opt{with {\it arglist}}\crbt& backtrace: display program stack\crp {\it expr}&display the value of an expression\crc &continue running your program\crn &next line, stepping over function calls\crs &next line, stepping into function calls\cr\endsec\sec Starting GDB;gdb&start GDB, with no debugging files\crgdb {\it program}&begin debugging {\it program}\crgdb {\it program core}&debug coredump {\it core} produced by {\itprogram}\crgdb --help&describe command line options\cr\endsec\sec Stopping GDB;quit&exit GDB; also {\tt q} or {\tt EOF} (eg \ctl{d})\crINTERRUPT&(eg \ctl{c}) terminate current command, or send to running process\cr\endsec\sec Getting Help;help&list classes of commands\crhelp {\it class}&one-line descriptions for commands in {\it class}\crhelp {\it command}&describe {\it command}\cr\endsec\sec Executing your Program;run {\it arglist}&start your program with {\it arglist}\crrun&start your program with current argument list\crrun $\ldots$ <{\it inf} >{\it outf}&start your program with input, outputredirected\cr\crkill&kill running program\cr\crtty {\it dev}&use {\it dev} as stdin and stdout for next {\tt run}\crset args {\it arglist}&specify {\it arglist} for next{\tt run}\crset args&specify empty argument list\crshow args&display argument list\cr\crshow environment&show all environment variables\crshow env {\it var}&show value of environment variable {\it var}\crset env {\it var} {\it string}&set environment variable {\it var}\crunset env {\it var}&remove {\it var} from environment\cr\endsec\sec Shell Commands;cd {\it dir}&change working directory to {\it dir}\crpwd&Print working directory\crmake $\ldots$&call ``{\tt make}''\crshell {\it cmd}&execute arbitrary shell command string\cr\endsec\vfill\line{\smrm \opt{ } surround optional arguments \hfill $\ldots$ showone or more arguments}\vskip\baselineskip\centerline{\smrm \copyright 1991, 1992 Free Software Foundation, Inc.\qquad Permissions on back}\eject\sec Breakpoints and Watchpoints;break \opt{\it file\tt:}{\it line}\parb \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\crbreak \opt{\it file\tt:}{\it function}&set breakpoint at {\itfunction} \opt{in \it file}\crbreak +{\it offset}\parbreak -{\it offset}&set break at {\it offset} lines from current stop\crbreak *{\it addr}&set breakpoint at address {\it addr}\crbreak&set breakpoint at next instruction\crbreak $\ldots$ if {\it expr}&break conditionally on nonzero {\it expr}\crcond {\it n} \opt{\it expr}&new conditional expression on breakpoint{\it n}; make unconditional if no {\it expr}\crtbreak $\ldots$&temporary break; disable when reached\crrbreak {\it regex}&break on all functions matching {\it regex}\crwatch {\it expr}&set a watchpoint for expression {\it expr}\crcatch {\it x}&break at C++ handler for exception {\it x}\cr\crinfo break&show defined breakpoints\crinfo watch&show defined watchpoints\cr\crclear&delete breakpoints at next instruction\crclear \opt{\it file\tt:}{\it fun}&delete breakpoints at entry to {\it fun}()\crclear \opt{\it file\tt:}{\it line}&delete breakpoints on source line \crdelete \opt{{\it n}}&delete breakpoints\opt{or breakpoint {\it n}}\cr\crdisable \opt{{\it n}}&disable breakpoints\opt{or breakpoint {\it n}}\crenable \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}\crenable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; disable again when reached\crenable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; delete when reached\cr\crignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count}times\cr\crcommands {\it n}\par\qquad \opt{\tt silent}\par\qquad {\it command-list}&execute GDB {\it command-list} every time breakpoint {\it n} is reached. \opt{{\tt silent} suppresses defaultdisplay}\crend&end of {\it command-list}\cr\endsec\sec Program Stack;backtrace \opt{\it n}\parbt \opt{\it n}&print trace of all frames in stack; or of {\it n}frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\crframe \opt{\it n}&select frame number {\it n} or frame at address {\itn}; if no {\it n}, display current frame\crup {\it n}&select frame {\it n} frames up\crdown {\it n}&select frame {\it n} frames down\crinfo frame \opt{\it addr}&describe selected frame, or frame at{\it addr}\crinfo args&arguments of selected frame\crinfo locals&local variables of selected frame\cr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -