8e890f1368c81087897683b1e0d9320728bc4607
[deliverable/binutils-gdb.git] / gdb / doc / refcard.tex
1 %%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%%
2
3 %This file is TeX source for a reference card describing GDB, the GNU debugger.
4 %Copyright (C) 1991-1993, 1996, 1998-2000, 2007-2012 Free Software
5 %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 3, 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 should have received a copy of the GNU General Public License
24 %along with this program. If not, see <http://www.gnu.org/licenses/>.
25 %
26 %You can contact the maintainer at: doc@cygnus.com
27 %
28 % Documentation Department
29 % Cygnus Solutions
30 % 1325 Chesapeake Terrace
31 % Sunnyvale, CA 94089 USA
32 %
33 % +1 800 CYGNUS-1
34 %
35 %
36 %
37 % 22-AUG-1993 Andreas Vogel
38 %
39 % Modifications made in order to handle different papersizes correctly.
40 % You only have to set the total width and height of the paper, the
41 % horizontal and vertical margin space measured from *paper edge*
42 % and the interline and interspec spacing.
43 % In order to support a new papersize, you have to fiddle with the
44 % latter four dimensions. Just try out a few values.
45 % All other values will be computed at process time so it should be
46 % quite easy to support different paper sizes - only four values to
47 % guess :-)
48 %
49 % To find the configuration places, just search for the string
50 % "CONFIGURATION".
51 %
52 % Andreas Vogel (av@ssw.de)
53 %
54 %
55 %
56 % Uncomment the following `magnification' command if you want to print
57 % out in a larger font. Caution! You may need larger paper. You had
58 % best avoid using 3-column output if you try this. See the ``Three
59 % column format'' section below if you want to print in three column
60 % format.
61 %
62 %\magnification=\magstep 1
63 %
64 % NOTE ON INTENTIONAL OMISSIONS: This reference card includes most GDB
65 % commands, but due to space constraints there are some things I chose
66 % to omit. In general, not all synonyms for commands are covered, nor
67 % all variations of a command.
68 % The GDB-under-Emacs section omits gdb-mode functions without default
69 % keybindings. GDB startup options are not described.
70 % set print sevenbit-strings omitted.
71 % printsyms, printpsyms, omitted since they're for GDB maintenance primarily
72 % share omitted due to obsolescence
73 % set check range/type omitted at least til code is in GDB.
74 %
75 %-------------------- Three column format -----------------------
76
77 %%%% --- To disable three column format, comment out this entire section
78
79 % Three-column format for landscape printing
80
81 %-------- Papersize defs:
82
83 \newdimen\totalwidth \newdimen\totalheight
84 \newdimen\hmargin \newdimen\vmargin
85 \newdimen\secskip \newdimen\lskip
86 \newdimen\barwidth \newdimen\barheight
87 \newdimen\intersecwidth
88
89 %%
90 %% START CONFIGURATION - PAPERSIZE DEFINITIONS
91 %------- Papersize params:
92 %% US letter paper (8.5x11in)
93 %%
94 \totalwidth=11in % total width of paper
95 \totalheight=8.5in % total height of paper
96 \hmargin=.25in % horizontal margin width
97 \vmargin=.25in % vertical margin width
98 \secskip=1pc % space between refcard secs
99 \lskip=2pt % extra skip between \sec entries
100 \ifx\pdfoutput\undefined\else % check if we are using pdfTeX
101 \pdfpagewidth=\totalwidth % width of paper in pdf output
102 \pdfpageheight=\totalheight % height of paper in pdf output
103 \fi
104 %------- end papersize params
105 %%
106 %% change according to personal taste, not papersize dependent
107 %%
108 \barwidth=.1pt % width of the cropmark bar
109 \barheight=2pt % height of the cropmark bar
110 \intersecwidth=0.5em % width between \itmwid and \dfnwid
111 %%
112 %% END CONFIGURATION - PAPERSIZE DEFINITIONS
113 %%
114
115 %%
116 %% values to be computed - nothing to configure
117 %%
118 \newdimen\fullhsize % width of area without margins
119 \newdimen\itmwid % width of item column
120 \newdimen\dfnwid % width of definition column
121 \newdimen\temp % only for temporary use
122
123 %%
124 %% adjust the offsets so the margins are measured *from paper edge*
125 %%
126 \hoffset=-1in \advance \hoffset by \hmargin
127 \voffset=-1in \advance \voffset by \vmargin
128
129 %%
130 %% fullhsize = totalwidth - (2 * hmargin)
131 %%
132 \fullhsize=\totalwidth
133 \temp=\hmargin \multiply \temp by 2 \advance \fullhsize by -\temp
134
135 %%
136 %% hsize = (fullhsize - (4 * hmargin) - (2 * barwidth)) / 3
137 %%
138 \hsize=\fullhsize
139 \temp=\hmargin \multiply \temp by 4 \advance \hsize by -\temp
140 \temp=\barwidth \multiply \temp by 2 \advance \hsize by -\temp
141 \divide \hsize by 3
142
143 %%
144 %% vsize = totalheight - (2 * vmargin)
145 %%
146 \vsize=\totalheight
147 \temp=\vmargin \multiply \temp by 2 \advance \vsize by -\temp
148
149 %%
150 %% itmwid = (hsize - intersecwidth) * 1/3
151 %% dfnwid = (hsize - intersecwidth) * 2/3
152 %%
153 \temp=\hsize \advance \temp by -\intersecwidth \divide \temp by 3
154 \itmwid=\temp
155 \dfnwid=\hsize \advance \dfnwid by -\itmwid
156
157 %-------- end papersize defs
158
159
160 \def\fulline{\hbox to \fullhsize}
161 \let\lcr=L \newbox\leftcolumn\newbox\centercolumn
162 \output={\if L\lcr
163 \global\setbox\leftcolumn=\columnbox \global\let\lcr=C
164 \else
165 \if C\lcr
166 \global\setbox\centercolumn=\columnbox \global\let\lcr=R
167 \else \tripleformat \global\let\lcr=L
168 \fi
169 \fi
170 % \ifnum\outputpenalty>-20000 \else\dosupereject\fi
171 }
172
173 %%
174 %% START CONFIGURATION - ALTERNATIVE FOLDING GUIDES
175 %%
176 %% For NO printed folding guide,
177 %% comment out other \def\vdecor's and uncomment:
178
179 %\def\vdecor{\hskip\hmargin plus1fil\hskip\barwidth plus1fil\hskip\hmargin plus1fil}
180
181 %% For SOLID LINE folding guide,
182 %% comment out other \def\vdecor's and uncomment:
183
184 %\def\vdecor{\hskip\hmargin plus1fil \vrule width \barwidth \hskip\hmargin plus1fil}
185
186 %% For SMALL MARKS NEAR TOP AND BOTTOM as folding guide,
187 %% comment out other \def\vdecor's and uncomment:
188
189 \def\vdecor{\hskip\hmargin plus1fil
190 \vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}\vfill
191 \hbox to \barwidth{\vrule height\barheight width\barwidth}}%THIS PERCENT SIGN IS ESSENTIAL
192 \hskip\hmargin plus1fil}
193
194 %%
195 %% END CONFIGURATION - ALTERNATIVES FOR FOLDING GUIDES
196 %%
197
198 \def\tripleformat{\shipout\vbox{\fulline{\box\leftcolumn\vdecor
199 \box\centercolumn\vdecor
200 \columnbox}
201 }
202 \advancepageno}
203 \def\columnbox{\leftline{\pagebody}}
204 \def\bye{\par\vfill
205 \supereject
206 \if R\lcr \null\vfill\eject\fi
207 \end}
208
209 %-------------------- end three column format -----------------------
210
211 %-------------------- Computer Modern font defs: --------------------
212 \font\bbf=cmbx10
213 \font\vbbf=cmbx12
214 \font\smrm=cmr6
215 \font\brm=cmr10
216 \font\rm=cmr7
217 \font\it=cmti7
218 \font\tt=cmtt8
219 %-------------------- end font defs ---------------------------------
220
221 %
222 \hyphenpenalty=5000\tolerance=2000\raggedright\raggedbottom
223 \normalbaselineskip=9pt\baselineskip=9pt
224 %
225 \parindent=0pt
226 \parskip=0pt
227 \footline={\vbox to0pt{\hss}}
228 %
229 \def\ctl#1{{\tt C-#1}}
230 \def\opt#1{{\brm[{\rm #1}]}}
231 \def\xtra#1{\noalign{\smallskip{\tt#1}}}
232 %
233 \long\def\sec#1;#2\endsec{\vskip \secskip
234 \halign{%
235 %COL 1 (of halign):
236 \vtop{\hsize=\itmwid\tt
237 ##\par\vskip \lskip }\hfil
238 %COL 2 (of halign):
239 &\vtop{\hsize=\dfnwid\hangafter=1\hangindent=\intersecwidth
240 \rm ##\par\vskip \lskip}\cr
241 %Tail of \long\def fills in halign body with \sec args:
242 \noalign{{\bbf #1}\vskip \lskip}
243 #2
244 }
245 }
246
247 {\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 5}\qquad
248
249 \sec Essential Commands;
250 gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{using
251 coredump {\it core}}\cr
252 b \opt{\it file\tt:}{\it function}&set breakpoint at {\it function} \opt{in \it file}\cr
253 run \opt{{\it arglist}}&start your program \opt{with {\it arglist}}\cr
254 bt& backtrace: display program stack\cr
255 p {\it expr}&display the value of an expression\cr
256 c &continue running your program\cr
257 n &next line, stepping over function calls\cr
258 s &next line, stepping into function calls\cr
259 \endsec
260
261 \sec Starting GDB;
262 gdb&start GDB, with no debugging files\cr
263 gdb {\it program}&begin debugging {\it program}\cr
264 gdb {\it program core}&debug coredump {\it core} produced by {\it
265 program}\cr
266 gdb --help&describe command line options\cr
267 \endsec
268
269 \sec Stopping GDB;
270 quit&exit GDB; also {\tt q} or {\tt EOF} (eg \ctl{d})\cr
271 INTERRUPT&(eg \ctl{c}) terminate current command, or send to running process\cr
272 \endsec
273
274 \sec Getting Help;
275 help&list classes of commands\cr
276 help {\it class}&one-line descriptions for commands in {\it class}\cr
277 help {\it command}&describe {\it command}\cr
278 \endsec
279
280 \sec Executing your Program;
281 run {\it arglist}&start your program with {\it arglist}\cr
282 run&start your program with current argument list\cr
283 run $\ldots$ <{\it inf} >{\it outf}&start your program with input, output
284 redirected\cr
285 \cr
286 kill&kill running program\cr
287 \cr
288 tty {\it dev}&use {\it dev} as stdin and stdout for next {\tt run}\cr
289 set args {\it arglist}&specify {\it arglist} for next
290 {\tt run}\cr
291 set args&specify empty argument list\cr
292 show args&display argument list\cr
293 \cr
294 show env&show all environment variables\cr
295 show env {\it var}&show value of environment variable {\it var}\cr
296 set env {\it var} {\it string}&set environment variable {\it var}\cr
297 unset env {\it var}&remove {\it var} from environment\cr
298 \endsec
299
300 \sec Shell Commands;
301 cd {\it dir}&change working directory to {\it dir}\cr
302 pwd&Print working directory\cr
303 make $\ldots$&call ``{\tt make}''\cr
304 shell {\it cmd}&execute arbitrary shell command string\cr
305 \endsec
306
307 \vfill
308 \line{\smrm \opt{ } surround optional arguments \hfill $\ldots$ show
309 one or more arguments}
310 \vskip\baselineskip
311 \centerline{\smrm \copyright 1998, 2000, 2010 Free Software Foundation, Inc.\qquad Permissions on back}
312 \eject
313 \sec Breakpoints and Watchpoints;
314 break \opt{\it file\tt:}{\it line}\par
315 b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par
316 eg:\quad{\tt break main.c:37}\quad\cr
317 break \opt{\it file\tt:}{\it func}&set breakpoint at {\it
318 func} \opt{in \it file}\cr
319 break +{\it offset}\par
320 break -{\it offset}&set break at {\it offset} lines from current stop\cr
321 break *{\it addr}&set breakpoint at address {\it addr}\cr
322 break&set breakpoint at next instruction\cr
323 break $\ldots$ if {\it expr}&break conditionally on nonzero {\it expr}\cr
324 cond {\it n} \opt{\it expr}&new conditional expression on breakpoint
325 {\it n}; make unconditional if no {\it expr}\cr
326 tbreak $\ldots$&temporary break; disable when reached\cr
327 rbreak \opt{\it file\tt:}{\it regex}&break on all functions matching {\it
328 regex} \opt{in \it file}\cr
329 watch {\it expr}&set a watchpoint for expression {\it expr}\cr
330 catch {\it event}&break at {\it event}, which may be {\tt catch}, {\tt throw},
331 {\tt exec}, {\tt fork}, {\tt vfork}, {\tt load}, or {\tt unload}.\cr
332 \cr
333 info break&show defined breakpoints\cr
334 info watch&show defined watchpoints\cr
335 \cr
336 clear&delete breakpoints at next instruction\cr
337 clear \opt{\it file\tt:}{\it fun}&delete breakpoints at entry to {\it fun}()\cr
338 clear \opt{\it file\tt:}{\it line}&delete breakpoints on source line \cr
339 delete \opt{{\it n}}&delete breakpoints
340 \opt{or breakpoint {\it n}}\cr
341 \cr
342 disable \opt{{\it n}}&disable breakpoints
343 \opt{or breakpoint {\it n}}
344 \cr
345 enable \opt{{\it n}}&enable breakpoints
346 \opt{or breakpoint {\it n}}
347 \cr
348 enable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}};
349 disable again when reached
350 \cr
351 enable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}};
352 delete when reached
353 \cr
354 \cr
355 ignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count}
356 times\cr
357 \cr
358 commands {\it n}\par
359 \qquad \opt{\tt silent}\par
360 \qquad {\it command-list}&execute GDB {\it command-list} every time breakpoint {\it n} is reached. \opt{{\tt silent} suppresses default
361 display}\cr
362 end&end of {\it command-list}\cr
363 \endsec
364
365 \sec Program Stack;
366 backtrace \opt{\it n}\par
367 bt \opt{\it n}&print trace of all frames in stack; or of {\it n}
368 frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\cr
369 frame \opt{\it n}&select frame number {\it n} or frame at address {\it
370 n}; if no {\it n}, display current frame\cr
371 up {\it n}&select frame {\it n} frames up\cr
372 down {\it n}&select frame {\it n} frames down\cr
373 info frame \opt{\it addr}&describe selected frame, or frame at
374 {\it addr}\cr
375 info args&arguments of selected frame\cr
376 info locals&local variables of selected frame\cr
377 info reg \opt{\it rn}$\ldots$\par
378 info all-reg \opt{\it rn}&register values \opt{for regs {\it rn\/}} in
379 selected frame; {\tt all-reg} includes floating point\cr
380 \endsec
381
382 \vfill\eject
383 \sec Execution Control;
384 continue \opt{\it count}\par
385 c \opt{\it count}&continue running; if {\it count} specified, ignore
386 this breakpoint next {\it count} times\cr
387 \cr
388 step \opt{\it count}\par
389 s \opt{\it count}&execute until another line reached; repeat {\it count} times if
390 specified\cr
391 stepi \opt{\it count}\par
392 si \opt{\it count}&step by machine instructions rather than source
393 lines\cr
394 \cr
395 next \opt{\it count}\par
396 n \opt{\it count}&execute next line, including any function calls\cr
397 nexti \opt{\it count}\par
398 ni \opt{\it count}&next machine instruction rather than source
399 line\cr
400 \cr
401 until \opt{\it location}&run until next instruction (or {\it
402 location})\cr
403 finish&run until selected stack frame returns\cr
404 return \opt{\it expr}&pop selected stack frame without executing
405 \opt{setting return value}\cr
406 signal {\it num}&resume execution with signal {\it s} (none if {\tt 0})\cr
407 jump {\it line}\par
408 jump *{\it address}&resume execution at specified {\it line} number or
409 {\it address}\cr
410 set var={\it expr}&evaluate {\it expr} without displaying it; use for
411 altering program variables\cr
412 \endsec
413
414 \sec Display;
415 print \opt{\tt/{\it f}\/} \opt{\it expr}\par
416 p \opt{\tt/{\it f}\/} \opt{\it expr}&show value of {\it expr} \opt{or
417 last value \tt \$} according to format {\it f}:\cr
418 \qquad x&hexadecimal\cr
419 \qquad d&signed decimal\cr
420 \qquad u&unsigned decimal\cr
421 \qquad o&octal\cr
422 \qquad t&binary\cr
423 \qquad a&address, absolute and relative\cr
424 \qquad c&character\cr
425 \qquad f&floating point\cr
426 call \opt{\tt /{\it f}\/} {\it expr}&like {\tt print} but does not display
427 {\tt void}\cr
428 x \opt{\tt/{\it Nuf}\/} {\it expr}&examine memory at address {\it expr};
429 optional format spec follows slash\cr
430 \quad {\it N}&count of how many units to display\cr
431 \quad {\it u}&unit size; one of\cr
432 &{\tt\qquad b}\ individual bytes\cr
433 &{\tt\qquad h}\ halfwords (two bytes)\cr
434 &{\tt\qquad w}\ words (four bytes)\cr
435 &{\tt\qquad g}\ giant words (eight bytes)\cr
436 \quad {\it f}&printing format. Any {\tt print} format, or\cr
437 &{\tt\qquad s}\ null-terminated string\cr
438 &{\tt\qquad i}\ machine instructions\cr
439 disassem \opt{\it addr}&display memory as machine instructions\cr
440 \endsec
441
442 \sec Automatic Display;
443 display \opt{\tt/\it f\/} {\it expr}&show value of {\it expr} each time
444 program stops \opt{according to format {\it f}\/}\cr
445 display&display all enabled expressions on list\cr
446 undisplay {\it n}&remove number(s) {\it n} from list of
447 automatically displayed expressions\cr
448 disable disp {\it n}&disable display for expression(s) number {\it
449 n}\cr
450 enable disp {\it n}&enable display for expression(s) number {\it
451 n}\cr
452 info display&numbered list of display expressions\cr
453 \endsec
454
455 \vfill\eject
456
457 \sec Expressions;
458 {\it expr}&an expression in C, C++, or Modula-2 (including function calls), or:\cr
459 {\it addr\/}@{\it len}&an array of {\it len} elements beginning at {\it
460 addr}\cr
461 {\it file}::{\it nm}&a variable or function {\it nm} defined in {\it
462 file}\cr
463 $\tt\{${\it type}$\tt\}${\it addr}&read memory at {\it addr} as specified
464 {\it type}\cr
465 \$&most recent displayed value\cr
466 \${\it n}&{\it n}th displayed value\cr
467 \$\$&displayed value previous to \$\cr
468 \$\${\it n}&{\it n}th displayed value back from \$\cr
469 \$\_&last address examined with {\tt x}\cr
470 \$\_\_&value at address \$\_\cr
471 \${\it var}&convenience variable; assign any value\cr
472 \cr
473 show values \opt{{\it n}}&show last 10 values \opt{or surrounding
474 \${\it n}}\cr
475 show conv&display all convenience variables\cr
476 \endsec
477
478 \sec Symbol Table;
479 info address {\it s}&show where symbol {\it s} is stored\cr
480 info func \opt{\it regex}&show names, types of defined functions
481 (all, or matching {\it regex})\cr
482 info var \opt{\it regex}&show names, types of global variables (all,
483 or matching {\it regex})\cr
484 whatis \opt{\it expr}\par
485 ptype \opt{\it expr}&show data type of {\it expr} \opt{or \tt \$}
486 without evaluating; {\tt ptype} gives more detail\cr
487 ptype {\it type}&describe type, struct, union, or enum\cr
488 \endsec
489
490 \sec GDB Scripts;
491 source {\it script}&read, execute GDB commands from file {\it
492 script}\cr
493 \cr
494 define {\it cmd}\par
495 \qquad {\it command-list}&create new GDB command {\it cmd};
496 execute script defined by {\it command-list}\cr
497 end&end of {\it command-list}\cr
498 document {\it cmd}\par
499 \qquad {\it help-text}&create online documentation
500 for new GDB command {\it cmd}\cr
501 end&end of {\it help-text}\cr
502 \endsec
503
504 \sec Signals;
505 handle {\it signal} {\it act}&specify GDB actions for {\it signal}:\cr
506 \quad print&announce signal\cr
507 \quad noprint&be silent for signal\cr
508 \quad stop&halt execution on signal\cr
509 \quad nostop&do not halt execution\cr
510 \quad pass&allow your program to handle signal\cr
511 \quad nopass&do not allow your program to see signal\cr
512 info signals&show table of signals, GDB action for each\cr
513 \endsec
514
515 \sec Debugging Targets;
516 target {\it type} {\it param}&connect to target machine, process, or file\cr
517 help target&display available targets\cr
518 attach {\it param}&connect to another process\cr
519 detach&release target from GDB control\cr
520 \endsec
521
522 \vfill\eject
523 \sec Controlling GDB;
524 set {\it param} {\it value}&set one of GDB's internal parameters\cr
525 show {\it param}&display current setting of parameter\cr
526 \xtra{\rm Parameters understood by {\tt set} and {\tt show}:}
527 \quad complaint {\it limit}&number of messages on unusual symbols\cr
528 \quad confirm {\it on/off}&enable or disable cautionary queries\cr
529 \quad editing {\it on/off}&control {\tt readline} command-line editing\cr
530 \quad height {\it lpp}&number of lines before pause in display\cr
531 \quad language {\it lang}&Language for GDB expressions ({\tt auto}, {\tt c} or
532 {\tt modula-2})\cr
533 \quad listsize {\it n}&number of lines shown by {\tt list}\cr
534 \quad prompt {\it str}&use {\it str} as GDB prompt\cr
535 \quad radix {\it base}&octal, decimal, or hex number representation\cr
536 \quad verbose {\it on/off}&control messages when loading
537 symbols\cr
538 \quad width {\it cpl}&number of characters before line folded\cr
539 \quad write {\it on/off}&Allow or forbid patching binary, core files
540 (when reopened with {\tt exec} or {\tt core})
541 \cr
542 \quad history $\ldots$\par
543 \quad h $\ldots$&groups with the following options:\cr
544 \quad h exp {\it off/on}&disable/enable {\tt readline} history expansion\cr
545 \quad h file {\it filename}&file for recording GDB command history\cr
546 \quad h size {\it size}&number of commands kept in history list\cr
547 \quad h save {\it off/on}&control use of external file for
548 command history\cr
549 \cr
550 \quad print $\ldots$\par
551 \quad p $\ldots$&groups with the following options:\cr
552 \quad p address {\it on/off}&print memory addresses in stacks,
553 values\cr
554 \quad p array {\it off/on}&compact or attractive format for
555 arrays\cr
556 \quad p demangl {\it on/off}&source (demangled) or internal form for C++
557 symbols\cr
558 \quad p asm-dem {\it on/off}&demangle C++ symbols in
559 machine-instruction output\cr
560 \quad p elements {\it limit}&number of array elements to display\cr
561 \quad p object {\it on/off}&print C++ derived types for objects\cr
562 \quad p pretty {\it off/on}&struct display: compact or indented\cr
563 \quad p union {\it on/off}&display of union members\cr
564 \quad p vtbl {\it off/on}&display of C++ virtual function
565 tables\cr
566 \cr
567 show commands&show last 10 commands\cr
568 show commands {\it n}&show 10 commands around number {\it n}\cr
569 show commands +&show next 10 commands\cr
570 \endsec
571
572 \sec Working Files;
573 file \opt{\it file}&use {\it file} for both symbols and executable;
574 with no arg, discard both\cr
575 core \opt{\it file}&read {\it file} as coredump; or discard\cr
576 exec \opt{\it file}&use {\it file} as executable only; or discard\cr
577 symbol \opt{\it file}&use symbol table from {\it file}; or discard\cr
578 load {\it file}&dynamically link {\it file\/} and add its symbols\cr
579 add-sym {\it file} {\it addr}&read additional symbols from {\it file},
580 dynamically loaded at {\it addr}\cr
581 info files&display working files and targets in use\cr
582 path {\it dirs}&add {\it dirs} to front of path searched for
583 executable and symbol files\cr
584 show path&display executable and symbol file path\cr
585 info share&list names of shared libraries currently loaded\cr
586 \endsec
587
588 \vfill\eject
589 \sec Source Files;
590 dir {\it names}&add directory {\it names} to front of source path\cr
591 dir&clear source path\cr
592 show dir&show current source path\cr
593 \cr
594 list&show next ten lines of source\cr
595 list -&show previous ten lines\cr
596 list {\it lines}&display source surrounding {\it lines},
597 specified as:\cr
598 \quad{\opt{\it file\tt:}\it num}&line number \opt{in named file}\cr
599 \quad{\opt{\it file\tt:}\it function}&beginning of function \opt{in
600 named file}\cr
601 \quad{\tt +\it off}&{\it off} lines after last printed\cr
602 \quad{\tt -\it off}&{\it off} lines previous to last printed\cr
603 \quad{\tt*\it address}&line containing {\it address}\cr
604 list {\it f},{\it l}&from line {\it f} to line {\it l}\cr
605 info line {\it num}&show starting, ending addresses of compiled code for
606 source line {\it num}\cr
607 info source&show name of current source file\cr
608 info sources&list all source files in use\cr
609 forw {\it regex}&search following source lines for {\it regex}\cr
610 rev {\it regex}&search preceding source lines for {\it regex}\cr
611 \endsec
612
613 \sec GDB under GNU Emacs;
614 M-x gdb&run GDB under Emacs\cr
615 \ctl{h} m&describe GDB mode\cr
616 M-s&step one line ({\tt step})\cr
617 M-n&next line ({\tt next})\cr
618 M-i&step one instruction ({\tt stepi})\cr
619 \ctl{c} \ctl{f}&finish current stack frame ({\tt finish})\cr
620 M-c&continue ({\tt cont})\cr
621 M-u&up {\it arg} frames ({\tt up})\cr
622 M-d&down {\it arg} frames ({\tt down})\cr
623 \ctl{x} \&&copy number from point, insert at end\cr
624 \ctl{x} SPC&(in source file) set break at point\cr
625 \endsec
626
627 \sec GDB License;
628 show copying&Display GNU General Public License\cr
629 show warranty&There is NO WARRANTY for GDB. Display full no-warranty
630 statement.\cr
631 \endsec
632
633
634 \vfill
635 {\smrm\parskip=6pt
636 Copyright \copyright 1991, 1992, 1993, 1998, 2000, 2010 Free Software Foundation, Inc.
637 Author: Roland H. Pesch
638
639 The author assumes no responsibility for any errors on this card.
640
641 This card may be freely distributed under the terms of the GNU
642 General Public License.
643
644 Please contribute to development of this card by
645 annotating it. Improvements can be sent to bug-gdb@gnu.org.
646
647 GDB itself is free software; you are welcome to distribute copies of
648 it under the terms of the GNU General Public License. There is
649 absolutely no warranty for GDB.
650 }
651 \end
This page took 0.04305 seconds and 4 git commands to generate.