aarch64-none-linux-gnu-gdb.1 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .if !\nF .nr F 0
  58. .if \nF>0 \{\
  59. . de IX
  60. . tm Index:\\$1\t\\n%\t"\\$2"
  61. ..
  62. . if !\nF==2 \{\
  63. . nr % 0
  64. . nr F 2
  65. . \}
  66. .\}
  67. .\"
  68. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  69. .\" Fear. Run. Save yourself. No user-serviceable parts.
  70. . \" fudge factors for nroff and troff
  71. .if n \{\
  72. . ds #H 0
  73. . ds #V .8m
  74. . ds #F .3m
  75. . ds #[ \f1
  76. . ds #] \fP
  77. .\}
  78. .if t \{\
  79. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  80. . ds #V .6m
  81. . ds #F 0
  82. . ds #[ \&
  83. . ds #] \&
  84. .\}
  85. . \" simple accents for nroff and troff
  86. .if n \{\
  87. . ds ' \&
  88. . ds ` \&
  89. . ds ^ \&
  90. . ds , \&
  91. . ds ~ ~
  92. . ds /
  93. .\}
  94. .if t \{\
  95. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  96. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  97. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  98. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  99. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  100. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  101. .\}
  102. . \" troff and (daisy-wheel) nroff accents
  103. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  104. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  105. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  106. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  107. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  108. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  109. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  110. .ds ae a\h'-(\w'a'u*4/10)'e
  111. .ds Ae A\h'-(\w'A'u*4/10)'E
  112. . \" corrections for vroff
  113. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  114. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  115. . \" for low resolution devices (crt and lpr)
  116. .if \n(.H>23 .if \n(.V>19 \
  117. \{\
  118. . ds : e
  119. . ds 8 ss
  120. . ds o a
  121. . ds d- d\h'-1'\(ga
  122. . ds D- D\h'-1'\(hy
  123. . ds th \o'bp'
  124. . ds Th \o'LP'
  125. . ds ae ae
  126. . ds Ae AE
  127. .\}
  128. .rm #[ #] #H #V #F C
  129. .\" ========================================================================
  130. .\"
  131. .IX Title "GDB 1"
  132. .TH GDB 1 "2021-07-02" "gdb-10.2.90.20210621-git" "GNU Development Tools"
  133. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  134. .\" way too many mistakes in technical documents.
  135. .if n .ad l
  136. .nh
  137. .SH "NAME"
  138. gdb \- The GNU Debugger
  139. .SH "SYNOPSIS"
  140. .IX Header "SYNOPSIS"
  141. gdb [\fB\-help\fR] [\fB\-nh\fR] [\fB\-nx\fR] [\fB\-q\fR]
  142. [\fB\-batch\fR] [\fB\-cd=\fR\fIdir\fR] [\fB\-f\fR]
  143. [\fB\-b\fR\ \fIbps\fR]
  144. [\fB\-tty=\fR\fIdev\fR] [\fB\-s\fR \fIsymfile\fR]
  145. [\fB\-e\fR\ \fIprog\fR] [\fB\-se\fR\ \fIprog\fR]
  146. [\fB\-c\fR\ \fIcore\fR] [\fB\-p\fR\ \fIprocID\fR]
  147. [\fB\-x\fR\ \fIcmds\fR] [\fB\-d\fR\ \fIdir\fR]
  148. [\fIprog\fR|\fIprog\fR \fIprocID\fR|\fIprog\fR \fIcore\fR]
  149. .SH "DESCRIPTION"
  150. .IX Header "DESCRIPTION"
  151. The purpose of a debugger such as \s-1GDB\s0 is to allow you to see what is
  152. going on \*(L"inside\*(R" another program while it executes \*(-- or what another
  153. program was doing at the moment it crashed.
  154. .PP
  155. \&\s-1GDB\s0 can do four main kinds of things (plus other things in support of
  156. these) to help you catch bugs in the act:
  157. .IP "\(bu" 4
  158. Start your program, specifying anything that might affect its behavior.
  159. .IP "\(bu" 4
  160. Make your program stop on specified conditions.
  161. .IP "\(bu" 4
  162. Examine what has happened, when your program has stopped.
  163. .IP "\(bu" 4
  164. Change things in your program, so you can experiment with correcting the
  165. effects of one bug and go on to learn about another.
  166. .PP
  167. You can use \s-1GDB\s0 to debug programs written in C, \*(C+, Fortran and
  168. Modula\-2.
  169. .PP
  170. \&\s-1GDB\s0 is invoked with the shell command \f(CW\*(C`gdb\*(C'\fR. Once started, it reads
  171. commands from the terminal until you tell it to exit with the \s-1GDB\s0
  172. command \f(CW\*(C`quit\*(C'\fR. You can get online help from \s-1GDB\s0 itself
  173. by using the command \f(CW\*(C`help\*(C'\fR.
  174. .PP
  175. You can run \f(CW\*(C`gdb\*(C'\fR with no arguments or options; but the most
  176. usual way to start \s-1GDB\s0 is with one argument or two, specifying an
  177. executable program as the argument:
  178. .PP
  179. .Vb 1
  180. \& gdb program
  181. .Ve
  182. .PP
  183. You can also start with both an executable program and a core file specified:
  184. .PP
  185. .Vb 1
  186. \& gdb program core
  187. .Ve
  188. .PP
  189. You can, instead, specify a process \s-1ID\s0 as a second argument or use option
  190. \&\f(CW\*(C`\-p\*(C'\fR, if you want to debug a running process:
  191. .PP
  192. .Vb 2
  193. \& gdb program 1234
  194. \& gdb \-p 1234
  195. .Ve
  196. .PP
  197. would attach \s-1GDB\s0 to process \f(CW1234\fR. With option \fB\-p\fR you
  198. can omit the \fIprogram\fR filename.
  199. .PP
  200. Here are some of the most frequently needed \s-1GDB\s0 commands:
  201. .IP "\fBbreak [\fR\fIfile\fR\fB:]\fR\fIfunction\fR" 4
  202. .IX Item "break [file:]function"
  203. Set a breakpoint at \fIfunction\fR (in \fIfile\fR).
  204. .IP "\fBrun [\fR\fIarglist\fR\fB]\fR" 4
  205. .IX Item "run [arglist]"
  206. Start your program (with \fIarglist\fR, if specified).
  207. .IP "\fBbt\fR" 4
  208. .IX Item "bt"
  209. Backtrace: display the program stack.
  210. .IP "\fBprint\fR \fIexpr\fR" 4
  211. .IX Item "print expr"
  212. Display the value of an expression.
  213. .IP "\fBc\fR" 4
  214. .IX Item "c"
  215. Continue running your program (after stopping, e.g. at a breakpoint).
  216. .IP "\fBnext\fR" 4
  217. .IX Item "next"
  218. Execute next program line (after stopping); step \fIover\fR any
  219. function calls in the line.
  220. .IP "\fBedit [\fR\fIfile\fR\fB:]\fR\fIfunction\fR" 4
  221. .IX Item "edit [file:]function"
  222. look at the program line where it is presently stopped.
  223. .IP "\fBlist [\fR\fIfile\fR\fB:]\fR\fIfunction\fR" 4
  224. .IX Item "list [file:]function"
  225. type the text of the program in the vicinity of where it is presently stopped.
  226. .IP "\fBstep\fR" 4
  227. .IX Item "step"
  228. Execute next program line (after stopping); step \fIinto\fR any
  229. function calls in the line.
  230. .IP "\fBhelp [\fR\fIname\fR\fB]\fR" 4
  231. .IX Item "help [name]"
  232. Show information about \s-1GDB\s0 command \fIname\fR, or general information
  233. about using \s-1GDB.\s0
  234. .IP "\fBquit\fR" 4
  235. .IX Item "quit"
  236. Exit from \s-1GDB.\s0
  237. .PP
  238. For full details on \s-1GDB,\s0
  239. see \fIUsing \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
  240. by Richard M. Stallman and Roland H. Pesch. The same text is available online
  241. as the \f(CW\*(C`gdb\*(C'\fR entry in the \f(CW\*(C`info\*(C'\fR program.
  242. .SH "OPTIONS"
  243. .IX Header "OPTIONS"
  244. Any arguments other than options specify an executable
  245. file and core file (or process \s-1ID\s0); that is, the first argument
  246. encountered with no
  247. associated option flag is equivalent to a \fB\-se\fR option, and the second,
  248. if any, is equivalent to a \fB\-c\fR option if it's the name of a file.
  249. Many options have
  250. both long and short forms; both are shown here. The long forms are also
  251. recognized if you truncate them, so long as enough of the option is
  252. present to be unambiguous. (If you prefer, you can flag option
  253. arguments with \fB+\fR rather than \fB\-\fR, though we illustrate the
  254. more usual convention.)
  255. .PP
  256. All the options and command line arguments you give are processed
  257. in sequential order. The order makes a difference when the \fB\-x\fR
  258. option is used.
  259. .IP "\fB\-help\fR" 4
  260. .IX Item "-help"
  261. .PD 0
  262. .IP "\fB\-h\fR" 4
  263. .IX Item "-h"
  264. .PD
  265. List all options, with brief explanations.
  266. .IP "\fB\-symbols=\fR\fIfile\fR" 4
  267. .IX Item "-symbols=file"
  268. .PD 0
  269. .IP "\fB\-s\fR \fIfile\fR" 4
  270. .IX Item "-s file"
  271. .PD
  272. Read symbol table from file \fIfile\fR.
  273. .IP "\fB\-write\fR" 4
  274. .IX Item "-write"
  275. Enable writing into executable and core files.
  276. .IP "\fB\-exec=\fR\fIfile\fR" 4
  277. .IX Item "-exec=file"
  278. .PD 0
  279. .IP "\fB\-e\fR \fIfile\fR" 4
  280. .IX Item "-e file"
  281. .PD
  282. Use file \fIfile\fR as the executable file to execute when
  283. appropriate, and for examining pure data in conjunction with a core
  284. dump.
  285. .IP "\fB\-se=\fR\fIfile\fR" 4
  286. .IX Item "-se=file"
  287. Read symbol table from file \fIfile\fR and use it as the executable
  288. file.
  289. .IP "\fB\-core=\fR\fIfile\fR" 4
  290. .IX Item "-core=file"
  291. .PD 0
  292. .IP "\fB\-c\fR \fIfile\fR" 4
  293. .IX Item "-c file"
  294. .PD
  295. Use file \fIfile\fR as a core dump to examine.
  296. .IP "\fB\-command=\fR\fIfile\fR" 4
  297. .IX Item "-command=file"
  298. .PD 0
  299. .IP "\fB\-x\fR \fIfile\fR" 4
  300. .IX Item "-x file"
  301. .PD
  302. Execute \s-1GDB\s0 commands from file \fIfile\fR.
  303. .IP "\fB\-ex\fR \fIcommand\fR" 4
  304. .IX Item "-ex command"
  305. Execute given \s-1GDB\s0 \fIcommand\fR.
  306. .IP "\fB\-directory=\fR\fIdirectory\fR" 4
  307. .IX Item "-directory=directory"
  308. .PD 0
  309. .IP "\fB\-d\fR \fIdirectory\fR" 4
  310. .IX Item "-d directory"
  311. .PD
  312. Add \fIdirectory\fR to the path to search for source files.
  313. .IP "\fB\-nh\fR" 4
  314. .IX Item "-nh"
  315. Do not execute commands from \fI~/.gdbinit\fR.
  316. .IP "\fB\-nx\fR" 4
  317. .IX Item "-nx"
  318. .PD 0
  319. .IP "\fB\-n\fR" 4
  320. .IX Item "-n"
  321. .PD
  322. Do not execute commands from any \fI.gdbinit\fR initialization files.
  323. .IP "\fB\-quiet\fR" 4
  324. .IX Item "-quiet"
  325. .PD 0
  326. .IP "\fB\-q\fR" 4
  327. .IX Item "-q"
  328. .PD
  329. \&\*(L"Quiet\*(R". Do not print the introductory and copyright messages. These
  330. messages are also suppressed in batch mode.
  331. .IP "\fB\-batch\fR" 4
  332. .IX Item "-batch"
  333. Run in batch mode. Exit with status \f(CW0\fR after processing all the command
  334. files specified with \fB\-x\fR (and \fI.gdbinit\fR, if not inhibited).
  335. Exit with nonzero status if an error occurs in executing the \s-1GDB\s0
  336. commands in the command files.
  337. .Sp
  338. Batch mode may be useful for running \s-1GDB\s0 as a filter, for example to
  339. download and run a program on another computer; in order to make this
  340. more useful, the message
  341. .Sp
  342. .Vb 1
  343. \& Program exited normally.
  344. .Ve
  345. .Sp
  346. (which is ordinarily issued whenever a program running under \s-1GDB\s0 control
  347. terminates) is not issued when running in batch mode.
  348. .IP "\fB\-cd=\fR\fIdirectory\fR" 4
  349. .IX Item "-cd=directory"
  350. Run \s-1GDB\s0 using \fIdirectory\fR as its working directory,
  351. instead of the current directory.
  352. .IP "\fB\-fullname\fR" 4
  353. .IX Item "-fullname"
  354. .PD 0
  355. .IP "\fB\-f\fR" 4
  356. .IX Item "-f"
  357. .PD
  358. Emacs sets this option when it runs \s-1GDB\s0 as a subprocess. It tells
  359. \&\s-1GDB\s0 to output the full file name and line number in a standard,
  360. recognizable fashion each time a stack frame is displayed (which
  361. includes each time the program stops). This recognizable format looks
  362. like two \fB\e032\fR characters, followed by the file name, line number
  363. and character position separated by colons, and a newline. The
  364. Emacs-to-GDB interface program uses the two \fB\e032\fR
  365. characters as a signal to display the source code for the frame.
  366. .IP "\fB\-b\fR \fIbps\fR" 4
  367. .IX Item "-b bps"
  368. Set the line speed (baud rate or bits per second) of any serial
  369. interface used by \s-1GDB\s0 for remote debugging.
  370. .IP "\fB\-tty=\fR\fIdevice\fR" 4
  371. .IX Item "-tty=device"
  372. Run using \fIdevice\fR for your program's standard input and output.
  373. .SH "SEE ALSO"
  374. .IX Header "SEE ALSO"
  375. The full documentation for \s-1GDB\s0 is maintained as a Texinfo manual.
  376. If the \f(CW\*(C`info\*(C'\fR and \f(CW\*(C`gdb\*(C'\fR programs and \s-1GDB\s0's Texinfo
  377. documentation are properly installed at your site, the command
  378. .PP
  379. .Vb 1
  380. \& info gdb
  381. .Ve
  382. .PP
  383. should give you access to the complete manual.
  384. .PP
  385. \&\fIUsing \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
  386. Richard M. Stallman and Roland H. Pesch, July 1991.
  387. .SH "COPYRIGHT"
  388. .IX Header "COPYRIGHT"
  389. Copyright (c) 1988\-2021 Free Software Foundation, Inc.
  390. .PP
  391. Permission is granted to copy, distribute and/or modify this document
  392. under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
  393. any later version published by the Free Software Foundation; with the
  394. Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs
  395. Free Documentation\*(R", with the Front-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R"
  396. and with the Back-Cover Texts as in (a) below.
  397. .PP
  398. (a) The \s-1FSF\s0's Back-Cover Text is: \*(L"You are free to copy and modify
  399. this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in
  400. developing \s-1GNU\s0 and promoting software freedom.\*(R"