refcard.tex 23 KB

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