📄 refcard.tex
字号:
%%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%%%This file is TeX source for a reference card describing GDB, the GNU debugger.%Copyright 1991, 1992, 1993, 1996, 1998, 1999, 2000%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 2, 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 at the URL%http://www.gnu.org/copyleft/gpl.html; or write to the Free Software%Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.%%You can contact the maintainer at: doc@cygnus.com%% Documentation Department% Cygnus Solutions% 1325 Chesapeake Terrace% Sunnyvale, CA 94089 USA%% +1 800 CYGNUS-1%%%% 22-AUG-1993 Andreas Vogel%% Modifications made in order to handle different papersizes correctly.% You only have to set the total width and height of the paper, the% horizontal and vertical margin space measured from *paper edge*% and the interline and interspec spacing.% In order to support a new papersize, you have to fiddle with the% latter four dimensions. Just try out a few values.% All other values will be computed at process time so it should be% quite easy to support different paper sizes - only four values to% guess :-)%% To find the configuration places, just search for the string% "CONFIGURATION".%% Andreas Vogel (av@ssw.de)%%%% 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.%%-------------------- Three column format -----------------------%%%% --- To disable three column format, comment out this entire section% Three-column format for landscape printing%-------- Papersize defs:\newdimen\totalwidth \newdimen\totalheight\newdimen\hmargin \newdimen\vmargin\newdimen\secskip \newdimen\lskip\newdimen\barwidth \newdimen\barheight\newdimen\intersecwidth%%%% START CONFIGURATION - PAPERSIZE DEFINITIONS%------- Papersize params:%% US letter paper (8.5x11in)%%\totalwidth=11in % total width of paper\totalheight=8.5in % total height of paper\hmargin=.25in % horizontal margin width\vmargin=.25in % vertical margin width\secskip=1pc % space between refcard secs\lskip=2pt % extra skip between \sec entries%------- end papersize params%%%% change according to personal taste, not papersize dependent%%\barwidth=.1pt % width of the cropmark bar\barheight=2pt % height of the cropmark bar\intersecwidth=0.5em % width between \itmwid and \dfnwid%%%% END CONFIGURATION - PAPERSIZE DEFINITIONS%%%%%% values to be computed - nothing to configure%%\newdimen\fullhsize % width of area without margins\newdimen\itmwid % width of item column\newdimen\dfnwid % width of definition column\newdimen\temp % only for temporary use%%%% adjust the offsets so the margins are measured *from paper edge*%%\hoffset=-1in \advance \hoffset by \hmargin\voffset=-1in \advance \voffset by \vmargin%%%% fullhsize = totalwidth - (2 * hmargin)%%\fullhsize=\totalwidth\temp=\hmargin \multiply \temp by 2 \advance \fullhsize by -\temp%%%% hsize = (fullhsize - (4 * hmargin) - (2 * barwidth)) / 3%%\hsize=\fullhsize\temp=\hmargin \multiply \temp by 4 \advance \hsize by -\temp\temp=\barwidth \multiply \temp by 2 \advance \hsize by -\temp\divide \hsize by 3%%%% vsize = totalheight - (2 * vmargin)%%\vsize=\totalheight\temp=\vmargin \multiply \temp by 2 \advance \vsize by -\temp%%%% itmwid = (hsize - intersecwidth) * 1/3%% dfnwid = (hsize - intersecwidth) * 2/3%%\temp=\hsize \advance \temp by -\intersecwidth \divide \temp by 3\itmwid=\temp\dfnwid=\hsize \advance \dfnwid by -\itmwid%-------- end papersize defs\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 }%%%% START CONFIGURATION - ALTERNATIVE FOLDING GUIDES%%%% For NO printed folding guide,%% comment out other \def\vdecor's and uncomment:%\def\vdecor{\hskip\hmargin plus1fil\hskip\barwidth plus1fil\hskip\hmargin plus1fil}%% For SOLID LINE folding guide,%% comment out other \def\vdecor's and uncomment:%\def\vdecor{\hskip\hmargin plus1fil \vrule width \barwidth \hskip\hmargin plus1fil}%% For SMALL MARKS NEAR TOP AND BOTTOM as folding guide,%% comment out other \def\vdecor's and uncomment:\def\vdecor{\hskip\hmargin plus1fil\vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}\vfill\hbox to \barwidth{\vrule height\barheight width\barwidth}}%THIS PERCENT SIGN IS ESSENTIAL\hskip\hmargin plus1fil}%%%% END CONFIGURATION - 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 ---------------------------------%\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 \secskip\halign{%%COL 1 (of halign):\vtop{\hsize=\itmwid\tt##\par\vskip \lskip }\hfil%COL 2 (of halign):&\vtop{\hsize=\dfnwid\hangafter=1\hangindent=\intersecwidth\rm ##\par\vskip \lskip}\cr%Tail of \long\def fills in halign body with \sec args:\noalign{{\bbf #1}\vskip \lskip}#2}}{\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 5}\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 env&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 1998,2000 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 func}&set breakpoint at {\itfunc} \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}\cr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -