]>
Commit | Line | Data |
---|---|---|
228d9e54 RP |
1 | %%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%% |
2 | ||
bca43169 | 3 | %This file is TeX source for a reference card describing GDB, the GNU debugger. |
98088880 | 4 | %$Id$ |
bca43169 RP |
5 | %Copyright (C) 1991 Free Software Foundation, Inc. |
6 | %Permission is granted to make and distribute verbatim copies of | |
7 | %this reference provided the copyright notices and permission notices | |
8 | %are preserved on all copies. | |
9 | % | |
10 | %TeX markup is a programming language; accordingly this file is source | |
11 | %for a program to generate a reference. | |
12 | % | |
13 | %This program is free software; you can redistribute it and/or modify | |
14 | %it under the terms of the GNU General Public License as published by | |
15 | %the Free Software Foundation; either version 1, or (at your option) | |
16 | %any later version. | |
17 | % | |
18 | %This program is distributed in the hope that it will be useful, but | |
19 | %WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | %MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | %General Public License for more details. | |
22 | % | |
23 | %You can find a copy of the GNU General Public License in the GDB | |
24 | %manual; or write to the Free Software Foundation, Inc., | |
25 | %675 Mass Ave, Cambridge, MA 02139, USA. | |
26 | % | |
27 | %You can contact the author as: [email protected] | |
28 | % | |
29 | % Roland Pesch | |
30 | % Cygnus Support | |
31 | % 814 University Ave. | |
32 | % Palo Alto, CA 94301 USA | |
33 | % | |
34 | % +1 415 322 3811 | |
35 | % | |
228d9e54 RP |
36 | % Uncomment the following `magnification' command if you want to print |
37 | % out in a larger font. Caution! You may need larger paper. You had | |
38 | % best avoid using 3-column output if you try this. See the ``Three | |
39 | % column format'' section below if you want to print in three column | |
40 | % format. | |
41 | % | |
42 | %\magnification=\magstep 1 | |
43 | % | |
98088880 RP |
44 | % NOTE ON INTENTIONAL OMISSIONS: This reference card includes most GDB |
45 | % commands, but due to space constraints there are some things I chose | |
d54bd32d RP |
46 | % to omit. In general, not all synonyms for commands are covered, nor |
47 | % all variations of a command. | |
98088880 RP |
48 | % The GDB-under-Emacs section omits gdb-mode functions without default |
49 | % keybindings. GDB startup options are not described. | |
d9800dbb | 50 | % set print sevenbit-strings, set symbol-reloading omitted. |
d54bd32d RP |
51 | % printsyms, printpsyms, omitted since they're for GDB maintenance primarily |
52 | % share omitted due to obsolescence | |
d9800dbb | 53 | % set check range/type omitted at least til code is in GDB. |
98088880 | 54 | % |
bca43169 RP |
55 | {% |
56 | \def\$#1${{#1}}% Kluge: collect RCS revision info without $...$ | |
57 | \xdef\manvers{\$Revision$}% | |
d9800dbb | 58 | }% |
228d9e54 RP |
59 | %-------------------- Three column format ----------------------- |
60 | ||
61 | %%%% --- To disable three column format, comment out this entire section | |
62 | ||
63 | % Three-column format for landscape printing on 8.5x11 paper | |
64 | ||
65 | % We want output .25 inch *from paper edge*; i.e. -.75in from TeX default | |
66 | \hoffset=-0.8in \voffset=-0.75in | |
67 | \newdimen\fullhsize | |
68 | \fullhsize=10.5in \hsize=3.3in | |
69 | \def\fulline{\hbox to \fullhsize} | |
70 | \let\lcr=L \newbox\leftcolumn\newbox\centercolumn | |
71 | \output={\if L\lcr | |
72 | \global\setbox\leftcolumn=\columnbox \global\let\lcr=C | |
73 | \else | |
74 | \if C\lcr | |
75 | \global\setbox\centercolumn=\columnbox \global\let\lcr=R | |
76 | \else \tripleformat \global\let\lcr=L | |
77 | \fi | |
78 | \fi | |
79 | % \ifnum\outputpenalty>-20000 \else\dosupereject\fi | |
80 | } | |
81 | % | |
82 | %ALTERNATIVE FOLDING GUIDES: | |
83 | % | |
84 | %For NO printed folding guide, comment out other \def\vdecor's and uncomment: | |
85 | %\def\vdecor{\hskip .2in plus1fil} | |
86 | % | |
87 | %For SOLID LINE folding guide, comment out other \def\vdecor's and uncomment: | |
88 | %\def\vdecor{\hskip .1in plus1fil \vrule width .1pt \hskip .1in plus1fil} | |
89 | % | |
90 | %For SMALL MARKS NEAR TOP AND BOTTOM as folding guide, | |
91 | %comment out other \def\vdecor's and uncomment: | |
92 | \def\vdecor{\hskip .1in plus1fil | |
93 | \vbox to \vsize{\hbox to .1pt{\vrule height 2pt width .1pt}\vfill | |
94 | \hbox to .1pt{\vrule height 2pt width .1pt}} | |
95 | \hskip .1in plus1fil} | |
96 | % | |
97 | %END OF ALTERNATIVES FOR FOLDING GUIDES | |
98 | % | |
99 | \def\tripleformat{\shipout\vbox{\fulline{\box\leftcolumn\vdecor | |
100 | \box\centercolumn\vdecor | |
101 | \columnbox} | |
102 | } | |
103 | \advancepageno} | |
104 | \def\columnbox{\leftline{\pagebody}} | |
105 | \def\bye{\par\vfill | |
106 | \supereject | |
107 | \if R\lcr \null\vfill\eject\fi | |
108 | \end} | |
109 | ||
110 | %-------------------- end three column format ----------------------- | |
111 | ||
112 | %-------------------- Computer Modern font defs: -------------------- | |
113 | \font\bbf=cmbx10 | |
114 | \font\vbbf=cmbx12 | |
115 | \font\smrm=cmr6 | |
116 | \font\brm=cmr10 | |
117 | \font\rm=cmr7 | |
118 | \font\it=cmti7 | |
119 | \font\tt=cmtt8 | |
120 | %-------------------- end font defs --------------------------------- | |
121 | ||
d9800dbb | 122 | % |
bca43169 | 123 | \vsize=8in |
98088880 | 124 | \hyphenpenalty=5000\tolerance=2000\raggedright\raggedbottom |
bca43169 RP |
125 | \normalbaselineskip=9pt\baselineskip=9pt |
126 | % | |
127 | \parindent=0pt | |
128 | \parskip=0pt | |
129 | \footline={\vbox to0pt{\hss}} | |
130 | % | |
131 | \def\ctl#1{{\tt C-#1}} | |
132 | \def\opt#1{{\brm[{\rm #1}]}} | |
133 | \def\xtra#1{\noalign{\smallskip{\tt#1}}} | |
134 | % | |
135 | \long\def\sec#1;#2\endsec{\vskip 1pc | |
136 | \halign{% | |
137 | %COL 1 (of halign): | |
d9800dbb RP |
138 | \vtop{\hsize=1.1in\tt |
139 | ##\par\vskip 2pt }\hfil | |
bca43169 RP |
140 | %COL 2 (of halign): |
141 | &\vtop{\hsize=2.1in\hangafter=1\hangindent=0.5em | |
142 | \rm ##\par\vskip 2pt}\cr | |
143 | %Tail of \long\def fills in halign body with \sec args: | |
144 | \noalign{{\bbf #1}\vskip 2pt} | |
145 | #2 | |
146 | } | |
147 | } | |
148 | ||
d54bd32d | 149 | {\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 4}\qquad |
98088880 RP |
150 | |
151 | \sec Essential Commands; | |
152 | gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{using | |
153 | coredump {\it core}}\cr | |
98088880 RP |
154 | b \opt{\it file\tt:}{\it function}&set breakpoint at {\it function} \opt{in \it file}\cr |
155 | run \opt{{\it arglist}}&start your program \opt{with {\it arglist}}\cr | |
d9800dbb | 156 | bt& backtrace: display program stack\cr |
98088880 RP |
157 | p {\it expr}&display the value of an expression\cr |
158 | c &continue running your program\cr | |
d9800dbb RP |
159 | n &next line, stepping over function calls\cr |
160 | s &next line, stepping into function calls\cr | |
98088880 | 161 | \endsec |
bca43169 RP |
162 | |
163 | \sec Starting GDB; | |
d54bd32d | 164 | gdb&start GDB, with no debugging files\cr |
bca43169 | 165 | gdb {\it program}&begin debugging {\it program}\cr |
d54bd32d RP |
166 | gdb {\it program core}&debug coredump {\it core} produced by {\it |
167 | program}\cr | |
2b1378d8 | 168 | gdb --help&describe command line options\cr |
bca43169 RP |
169 | \endsec |
170 | ||
171 | \sec Stopping GDB; | |
98088880 RP |
172 | quit&exit GDB; also {\tt q} or {\tt EOF} (eg \ctl{d})\cr |
173 | INTERRUPT&(eg \ctl{c}) terminate current command, or send to running process\cr | |
bca43169 RP |
174 | \endsec |
175 | ||
176 | \sec Getting Help; | |
98088880 RP |
177 | help&list classes of commands\cr |
178 | help {\it class}&one-line descriptions for commands in {\it class}\cr | |
179 | help {\it command}&describe {\it command}\cr | |
bca43169 RP |
180 | \endsec |
181 | ||
182 | \sec Executing your Program; | |
183 | run {\it arglist}&start your program with {\it arglist}\cr | |
184 | run&start your program with current argument list\cr | |
d54bd32d | 185 | run $\ldots$ <{\it inf} >{\it outf}&start your program with input, output |
bca43169 RP |
186 | redirected\cr |
187 | \cr | |
98088880 | 188 | kill&kill running program\cr |
bca43169 | 189 | \cr |
98088880 | 190 | tty {\it dev}&use {\it dev} as stdin and stdout for next {\tt run}\cr |
bca43169 RP |
191 | set args {\it arglist}&specify {\it arglist} for next |
192 | {\tt run}\cr | |
193 | set args&specify empty argument list\cr | |
194 | show args&display argument list\cr | |
195 | \cr | |
196 | show environment&show all environment variables\cr | |
197 | show env {\it var}&show value of environment variable {\it var}\cr | |
98088880 RP |
198 | set env {\it var} {\it string}&set environment variable {\it var}\cr |
199 | unset env {\it var}&remove {\it var} from environment\cr | |
bca43169 RP |
200 | \endsec |
201 | ||
202 | \sec Shell Commands; | |
98088880 | 203 | cd {\it dir}&change working directory to {\it dir}\cr |
bca43169 | 204 | pwd&Print working directory\cr |
98088880 RP |
205 | make $\ldots$&call ``{\tt make}''\cr |
206 | shell {\it cmd}&execute arbitrary shell command string\cr | |
bca43169 RP |
207 | \endsec |
208 | ||
209 | \vfill | |
228d9e54 RP |
210 | \line{\smrm \opt{ } surround optional arguments \hfill $\ldots$ show |
211 | one or more arguments} | |
212 | \vskip\baselineskip | |
d54bd32d | 213 | \centerline{\smrm \copyright 1991, 1992 Free Software Foundation, Inc.\qquad Permissions on back} |
bca43169 RP |
214 | \eject |
215 | \sec Breakpoints and Watchpoints; | |
98088880 RP |
216 | break \opt{\it file\tt:}{\it line}\par |
217 | b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par | |
bca43169 | 218 | eg:\quad{\tt break main.c:37}\quad\cr |
98088880 RP |
219 | break \opt{\it file\tt:}{\it function}&set breakpoint at {\it |
220 | function} \opt{in \it file}\cr | |
bca43169 | 221 | break +{\it offset}\par |
98088880 RP |
222 | break -{\it offset}&set break at {\it offset} lines from current stop\cr |
223 | break *{\it addr}&set breakpoint at address {\it addr}\cr | |
224 | break&set breakpoint at next instruction\cr | |
225 | break $\ldots$ if {\it expr}&break conditionally on nonzero {\it expr}\cr | |
226 | cond {\it n} \opt{\it expr}&new conditional expression on breakpoint | |
227 | {\it n}; make unconditional if no {\it expr}\cr | |
228 | tbreak $\ldots$&temporary break; disable when reached\cr | |
229 | rbreak {\it regex}&break on all functions matching {\it regex}\cr | |
230 | watch {\it expr}&set a watchpoint for expression {\it expr}\cr | |
231 | catch {\it x}&break at C++ handler for exception {\it x}\cr | |
bca43169 | 232 | \cr |
98088880 RP |
233 | info break&show defined breakpoints\cr |
234 | info watch&show defined watchpoints\cr | |
bca43169 | 235 | \cr |
98088880 RP |
236 | clear&delete breakpoints at next instruction\cr |
237 | clear \opt{\it file\tt:}{\it fun}&delete breakpoints at entry to {\it fun}()\cr | |
238 | clear \opt{\it file\tt:}{\it line}&delete breakpoints on source line \cr | |
d54bd32d RP |
239 | delete \opt{{\it n}}&delete breakpoints |
240 | \opt{or breakpoint {\it n}}\cr | |
241 | \cr | |
242 | disable \opt{{\it n}}&disable breakpoints | |
243 | \opt{or breakpoint {\it n}} | |
244 | \cr | |
245 | enable \opt{{\it n}}&enable breakpoints | |
246 | \opt{or breakpoint {\it n}} | |
247 | \cr | |
248 | enable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; | |
249 | disable again when reached | |
250 | \cr | |
251 | enable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; | |
252 | delete when reached | |
bca43169 | 253 | \cr |
bca43169 | 254 | \cr |
98088880 | 255 | ignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count} |
bca43169 RP |
256 | times\cr |
257 | \cr | |
98088880 | 258 | commands {\it n}\par |
d54bd32d RP |
259 | \qquad \opt{\tt silent}\par |
260 | \qquad {\it command-list}&execute GDB {\it command-list} every time breakpoint {\it n} is reached. \opt{{\tt silent} suppresses default | |
261 | display}\cr | |
262 | end&end of {\it command-list}\cr | |
bca43169 RP |
263 | \endsec |
264 | ||
98088880 RP |
265 | \sec Program Stack; |
266 | backtrace \opt{\it n}\par | |
267 | bt \opt{\it n}&print trace of all frames in stack; or of {\it n} | |
268 | frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\cr | |
269 | frame \opt{\it n}&select frame number {\it n} or frame at address {\it | |
270 | n}; if no {\it n}, display current frame\cr | |
271 | up {\it n}&select frame {\it n} frames up\cr | |
272 | down {\it n}&select frame {\it n} frames down\cr | |
273 | info frame \opt{\it addr}&describe selected frame, or frame at | |
274 | {\it addr}\cr | |
275 | info args&arguments of selected frame\cr | |
276 | info locals&local variables of selected frame\cr | |
d54bd32d RP |
277 | info reg \opt{\it rn}\par |
278 | info all-reg \opt{\it rn}®ister values \opt{for reg {\it rn\/}} in | |
279 | selected frame; {\tt all-reg} includes floating point\cr | |
98088880 | 280 | info catch&exception handlers active in selected frame\cr |
bca43169 RP |
281 | \endsec |
282 | ||
283 | \vfill\eject | |
284 | \sec Execution Control; | |
285 | continue \opt{\it count}\par | |
98088880 | 286 | c \opt{\it count}&continue running; if {\it count} specified, ignore |
bca43169 RP |
287 | this breakpoint next {\it count} times\cr |
288 | \cr | |
289 | step \opt{\it count}\par | |
98088880 | 290 | s \opt{\it count}&execute until another line reached; repeat {\it count} times if |
bca43169 | 291 | specified\cr |
bca43169 | 292 | stepi \opt{\it count}\par |
98088880 | 293 | si \opt{\it count}&step by machine instructions rather than source |
bca43169 RP |
294 | lines\cr |
295 | \cr | |
296 | next \opt{\it count}\par | |
98088880 | 297 | n \opt{\it count}&execute next line, including any function calls\cr |
bca43169 | 298 | nexti \opt{\it count}\par |
98088880 | 299 | ni \opt{\it count}&next machine instruction rather than source |
bca43169 RP |
300 | line\cr |
301 | \cr | |
98088880 RP |
302 | until \opt{\it location}&run until next instruction (or {\it |
303 | location})\cr | |
304 | finish&run until selected stack frame returns\cr | |
305 | return \opt{\it expr}&pop selected stack frame without executing | |
306 | \opt{setting return value}\cr | |
307 | signal {\it num}&resume execution with signal {\it s} (none if {\tt 0})\cr | |
bca43169 | 308 | jump {\it line}\par |
98088880 | 309 | jump *{\it address}&resume execution at specified {\it line} number or |
bca43169 | 310 | {\it address}\cr |
98088880 | 311 | set var={\it expr}&evaluate {\it expr} without displaying it; use for |
bca43169 RP |
312 | altering program variables\cr |
313 | \endsec | |
314 | ||
98088880 | 315 | \sec Display; |
d54bd32d RP |
316 | print \opt{\tt/{\it f}\/} \opt{\it expr}\par |
317 | p \opt{\tt/{\it f}\/} \opt{\it expr}&show value of {\it expr} \opt{or | |
318 | last value \tt \$} according to format {\it f}:\cr | |
bca43169 RP |
319 | \qquad x&hexadecimal\cr |
320 | \qquad d&signed decimal\cr | |
321 | \qquad u&unsigned decimal\cr | |
322 | \qquad o&octal\cr | |
d54bd32d | 323 | \qquad t&binary\cr |
bca43169 | 324 | \qquad a&address, absolute and relative\cr |
98088880 | 325 | \qquad c&character\cr |
bca43169 | 326 | \qquad f&floating point\cr |
98088880 | 327 | call \opt{\tt /{\it f}\/} {\it expr}&like {\tt print} but does not display |
bca43169 | 328 | {\tt void}\cr |
98088880 RP |
329 | x \opt{\tt/{\it Nuf}\/} {\it expr}&examine memory at address {\it expr}; |
330 | optional format spec follows slash\cr | |
331 | \quad {\it N}&count of how many units to display\cr | |
332 | \quad {\it u}&unit size; one of\cr | |
bca43169 RP |
333 | &{\tt\qquad b}\ individual bytes\cr |
334 | &{\tt\qquad h}\ halfwords (two bytes)\cr | |
335 | &{\tt\qquad w}\ words (four bytes)\cr | |
336 | &{\tt\qquad g}\ giant words (eight bytes)\cr | |
98088880 RP |
337 | \quad {\it f}&printing format. Any {\tt print} format, or\cr |
338 | &{\tt\qquad s}\ null-terminated string\cr | |
339 | &{\tt\qquad i}\ machine instructions\cr | |
d9800dbb | 340 | disassem \opt{\it addr}&display memory as machine instructions\cr |
bca43169 RP |
341 | \endsec |
342 | ||
343 | \sec Automatic Display; | |
98088880 | 344 | display \opt{\tt/\it f\/} {\it expr}&show value of {\it expr} each time |
bca43169 | 345 | program stops \opt{according to format {\it f}\/}\cr |
98088880 RP |
346 | display&display all enabled expressions on list\cr |
347 | undisplay {\it n}&remove number(s) {\it n} from list of | |
bca43169 | 348 | automatically displayed expressions\cr |
d9800dbb | 349 | disable disp {\it n}&disable display for expression(s) number {\it |
98088880 | 350 | n}\cr |
d9800dbb | 351 | enable disp {\it n}&enable display for expression(s) number {\it |
98088880 RP |
352 | n}\cr |
353 | info display&numbered list of display expressions\cr | |
bca43169 RP |
354 | \endsec |
355 | ||
98088880 RP |
356 | \vfill\eject |
357 | ||
358 | \sec Expressions; | |
d9800dbb | 359 | {\it expr}&an expression in C, C++, or Modula-2 (including function calls), or:\cr |
98088880 RP |
360 | {\it addr\/}@{\it len}&an array of {\it len} elements beginning at {\it |
361 | addr}\cr | |
362 | {\it file}::{\it nm}&a variable or function {\it nm} defined in {\it | |
363 | file}\cr | |
364 | $\tt\{${\it type}$\tt\}${\it addr}&read memory at {\it addr} as specified | |
365 | {\it type}\cr | |
366 | \$&most recent displayed value\cr | |
367 | \${\it n}&{\it n}th displayed value\cr | |
368 | \$\$&displayed value previous to \$\cr | |
369 | \$\${\it n}&{\it n}th displayed value back from \$\cr | |
370 | \$\_&last address examined with {\tt x}\cr | |
371 | \$\_\_&value at address \$\_\cr | |
372 | \${\it var}&convenience variable; assign any value\cr | |
373 | \cr | |
374 | show values \opt{{\it n}}&show last 10 values \opt{or surrounding | |
375 | \${\it n}}\cr | |
376 | show convenience&display all convenience variables\cr | |
bca43169 RP |
377 | \endsec |
378 | ||
379 | \sec Symbol Table; | |
98088880 RP |
380 | info address {\it s}&show where symbol {\it s} is stored\cr |
381 | info func \opt{\it regex}&show names, types of defined functions | |
bca43169 | 382 | (all, or matching {\it regex})\cr |
98088880 | 383 | info var \opt{\it regex}&show names, types of global variables (all, |
bca43169 | 384 | or matching {\it regex})\cr |
d54bd32d RP |
385 | whatis \opt{\it expr}\par |
386 | ptype \opt{\it expr}&show data type of {\it expr} \opt{or \tt \$} | |
387 | without evaluating; {\tt ptype} gives more detail\cr | |
98088880 RP |
388 | ptype {\it type}&describe type, struct, union, or enum\cr |
389 | \endsec | |
390 | ||
391 | \sec GDB Scripts; | |
392 | source {\it script}&read, execute GDB commands from file {\it | |
393 | script}\cr | |
394 | \cr | |
395 | define {\it cmd}\par | |
d54bd32d RP |
396 | \qquad {\it command-list}&create new GDB command {\it cmd}; |
397 | execute script defined by {\it command-list}\cr | |
398 | end&end of {\it command-list}\cr | |
98088880 | 399 | document {\it cmd}\par |
d54bd32d RP |
400 | \qquad {\it help-text}&create online documentation |
401 | for new GDB command {\it cmd}\cr | |
402 | end&end of {\it help-text}\cr | |
98088880 RP |
403 | \endsec |
404 | ||
405 | \sec Signals; | |
d9800dbb RP |
406 | handle {\it signal} {\it act}&specify GDB actions for {\it signal}:\cr |
407 | \quad print&announce signal\cr | |
408 | \quad noprint&be silent for signal\cr | |
98088880 RP |
409 | \quad stop&halt execution on signal\cr |
410 | \quad nostop&do not halt execution\cr | |
411 | \quad pass&allow your program to handle signal\cr | |
412 | \quad nopass&do not allow your program to see signal\cr | |
413 | info signals&show table of signals, GDB action for each\cr | |
414 | \endsec | |
415 | ||
416 | \sec Debugging Targets; | |
417 | target {\it type} {\it param}&connect to target machine, process, or file\cr | |
418 | help target&display available targets\cr | |
419 | attach {\it param}&connect to another process\cr | |
420 | detach&release target from GDB control\cr | |
bca43169 RP |
421 | \endsec |
422 | ||
423 | \vfill\eject | |
424 | \sec Controlling GDB; | |
d9800dbb | 425 | set {\it param} {\it value}&set one of GDB's internal parameters\cr |
d54bd32d | 426 | show {\it param}&display current setting of parameter\cr |
bca43169 | 427 | \xtra{\rm Parameters understood by {\tt set} and {\tt show}:} |
98088880 RP |
428 | \quad complaints {\it limit}&number of messages on unusual symbols\cr |
429 | \quad confirm {\it on/off}&enable or disable cautionary queries\cr | |
430 | \quad editing {\it on/off}&control {\tt readline} command-line editing\cr | |
d9800dbb RP |
431 | \quad height {\it lpp}&number of lines before pause in display\cr |
432 | \quad language {\it lang}&Language for GDB expressions ({\tt auto}, {\tt c} or | |
433 | {\tt modula-2})\cr | |
434 | \quad listsize {\it n}&number of lines shown by {\tt list}\cr | |
98088880 RP |
435 | \quad prompt {\it str}&use {\it str} as GDB prompt\cr |
436 | \quad radix {\it base}&octal, decimal, or hex number representation\cr | |
437 | \quad verbose {\it on/off}&control messages when loading | |
d54bd32d | 438 | symbols\cr |
98088880 | 439 | \quad width {\it cpl}&number of characters before line folded\cr |
d9800dbb RP |
440 | \quad write {\it on/off}&Allow or forbid patching binary, core files |
441 | (when reopened with {\tt exec} or {\tt core}) | |
98088880 | 442 | \cr |
d54bd32d RP |
443 | \quad history $\ldots$\par |
444 | \quad h $\ldots$&groups with the following options:\cr | |
445 | \quad h exp {\it off/on}&disable/enable {\tt readline} history expansion\cr | |
98088880 RP |
446 | \quad h file {\it filename}&file for recording GDB command history\cr |
447 | \quad h size {\it size}&number of commands kept in history list\cr | |
448 | \quad h save {\it off/on}&control use of external file for | |
449 | command history\cr | |
450 | \cr | |
d54bd32d RP |
451 | \quad print $\ldots$\par |
452 | \quad p $\ldots$&groups with the following options:\cr | |
98088880 RP |
453 | \quad p address {\it on/off}&print memory addresses in stacks, |
454 | values\cr | |
455 | \quad p array {\it off/on}&compact or attractive format for | |
456 | arrays\cr | |
d9800dbb | 457 | \quad p demangl {\it on/off}&source (demangled) or internal form for C++ |
98088880 RP |
458 | symbols\cr |
459 | \quad p asm-dem {\it on/off}&demangle C++ symbols in | |
460 | machine-instruction output\cr | |
d54bd32d | 461 | \quad p elements {\it limit}&number of array elements to display\cr |
98088880 RP |
462 | \quad p object {\it on/off}&print C++ derived types for objects\cr |
463 | \quad p pretty {\it off/on}&struct display: compact or indented\cr | |
d54bd32d | 464 | \quad p union {\it on/off}&display of union members\cr |
98088880 RP |
465 | \quad p vtbl {\it off/on}&display of C++ virtual function |
466 | tables\cr | |
467 | \cr | |
468 | show commands&show last 10 commands\cr | |
469 | show commands {\it n}&show 10 commands around number {\it n}\cr | |
470 | show commands +&show next 10 commands\cr | |
bca43169 RP |
471 | \endsec |
472 | ||
473 | \sec Working Files; | |
d54bd32d RP |
474 | file \opt{\it file}&use {\it file} for both symbols and executable; |
475 | with no arg, discard both\cr | |
476 | core \opt{\it file}&read {\it file} as coredump; or discard\cr | |
477 | exec \opt{\it file}&use {\it file} as executable only; or discard\cr | |
478 | symbol \opt{\it file}&use symbol table from {\it file}; or discard\cr | |
98088880 RP |
479 | load {\it file}&dynamically link {\it file\/} and add its symbols\cr |
480 | add-sym {\it file} {\it addr}&read additional symbols from {\it file}, | |
bca43169 | 481 | dynamically loaded at {\it addr}\cr |
98088880 RP |
482 | info files&display working files and targets in use\cr |
483 | path {\it dirs}&add {\it dirs} to front of path searched for | |
484 | executable and symbol files\cr | |
d9800dbb | 485 | show path&display executable and symbol file path\cr |
98088880 | 486 | info share&list names of shared libraries currently loaded\cr |
bca43169 RP |
487 | \endsec |
488 | ||
489 | \vfill\eject | |
490 | \sec Source Files; | |
98088880 RP |
491 | dir {\it names}&add directory {\it names} to front of source path\cr |
492 | dir&clear source path\cr | |
493 | show dir&show current source path\cr | |
bca43169 | 494 | \cr |
98088880 RP |
495 | list&show next ten lines of source\cr |
496 | list -&show previous ten lines\cr | |
497 | list {\it lines}&display source centered around {\it lines}, | |
bca43169 | 498 | specified as one of:\cr |
98088880 RP |
499 | \quad{\opt{\it file\tt:}\it num}&line number \opt{in named file}\cr |
500 | \quad{\opt{\it file\tt:}\it function}&beginning of function \opt{in | |
bca43169 RP |
501 | named file}\cr |
502 | \quad{\tt +\it off}&{\it off} lines after last printed\cr | |
503 | \quad{\tt -\it off}&{\it off} lines previous to last printed\cr | |
98088880 | 504 | \quad{\tt*\it address}&line containing {\it address}\cr |
bca43169 | 505 | list {\it f},{\it l}&from line {\it f} to line {\it l}\cr |
98088880 | 506 | info line {\it num}&show starting, ending addresses of compiled code for |
bca43169 | 507 | source line {\it num}\cr |
98088880 RP |
508 | info source&show name of current source file\cr |
509 | info sources&list all source files in use\cr | |
510 | forw {\it regex}&search following source lines for {\it regex}\cr | |
511 | rev {\it regex}&search preceding source lines for {\it regex}\cr | |
bca43169 RP |
512 | \endsec |
513 | ||
514 | \sec GDB under GNU Emacs; | |
98088880 RP |
515 | M-x gdb&run GDB under Emacs\cr |
516 | \ctl{h} m&describe GDB mode\cr | |
517 | M-s&step one line ({\tt step})\cr | |
518 | M-n&next line ({\tt next})\cr | |
519 | M-i&step one instruction ({\tt stepi})\cr | |
520 | \ctl{c} \ctl{f}&finish current stack frame ({\tt finish})\cr | |
521 | M-c&continue ({\tt cont})\cr | |
522 | M-u&up {\it arg} frames ({\tt up})\cr | |
523 | M-d&down {\it arg} frames ({\tt down})\cr | |
524 | \ctl{x} \&© number from point, insert at end\cr | |
bca43169 RP |
525 | \ctl{x} SPC&(in source file) set break at point\cr |
526 | \endsec | |
527 | ||
d9800dbb | 528 | \sec GDB License; |
d54bd32d RP |
529 | show copying&Display GNU General Public License\cr |
530 | show warranty&There is NO WARRANTY for GDB. Display full no-warranty | |
d9800dbb RP |
531 | statement.\cr |
532 | \endsec | |
533 | ||
bca43169 RP |
534 | |
535 | \vfill | |
536 | {\smrm\parskip=6pt | |
d54bd32d RP |
537 | \centerline{Copyright \copyright 1991, 1992 Free Software Foundation, Inc.} |
538 | \centerline{Roland Pesch ([email protected]), January 1992---\manvers} | |
98088880 | 539 | \centerline{The author assumes no responsibility for any errors on this card.} |
bca43169 RP |
540 | |
541 | This card may be freely distributed under the terms of the GNU | |
542 | General Public License. | |
543 | ||
d9800dbb RP |
544 | \centerline{Please contribute to development of this card by |
545 | annotating it.} | |
546 | ||
547 | GDB itself is free software; you are welcome to distribute copies of | |
548 | it under the terms of the GNU General Public License. There is | |
549 | absolutely no warranty for GDB. | |
98088880 | 550 | } |
bca43169 | 551 | \end |