arm-linux-gnueabihf-gdb.1 13 KB

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