aarch64-none-linux-gnu-gdbserver.1 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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 "GDBSERVER 1"
  132. .TH GDBSERVER 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. gdbserver \- Remote Server for the GNU Debugger
  139. .SH "SYNOPSIS"
  140. .IX Header "SYNOPSIS"
  141. gdbserver \fIcomm\fR \fIprog\fR [\fIargs\fR...]
  142. .PP
  143. gdbserver \-\-attach \fIcomm\fR \fIpid\fR
  144. .PP
  145. gdbserver \-\-multi \fIcomm\fR
  146. .SH "DESCRIPTION"
  147. .IX Header "DESCRIPTION"
  148. \&\fBgdbserver\fR is a program that allows you to run \s-1GDB\s0 on a different machine
  149. than the one which is running the program being debugged.
  150. .PP
  151. Usage (server (target) side):
  152. .PP
  153. First, you need to have a copy of the program you want to debug put onto
  154. the target system. The program can be stripped to save space if needed, as
  155. \&\fBgdbserver\fR doesn't care about symbols. All symbol handling is taken care of by
  156. the \s-1GDB\s0 running on the host system.
  157. .PP
  158. To use the server, you log on to the target system, and run the \fBgdbserver\fR
  159. program. You must tell it (a) how to communicate with \s-1GDB,\s0 (b) the name of
  160. your program, and (c) its arguments. The general syntax is:
  161. .PP
  162. .Vb 1
  163. \& target> gdbserver <comm> <program> [<args> ...]
  164. .Ve
  165. .PP
  166. For example, using a serial port, you might say:
  167. .PP
  168. .Vb 1
  169. \& target> gdbserver /dev/com1 emacs foo.txt
  170. .Ve
  171. .PP
  172. This tells \fBgdbserver\fR to debug emacs with an argument of foo.txt, and
  173. to communicate with \s-1GDB\s0 via \fI/dev/com1\fR. \fBgdbserver\fR now
  174. waits patiently for the host \s-1GDB\s0 to communicate with it.
  175. .PP
  176. To use a \s-1TCP\s0 connection, you could say:
  177. .PP
  178. .Vb 1
  179. \& target> gdbserver host:2345 emacs foo.txt
  180. .Ve
  181. .PP
  182. This says pretty much the same thing as the last example, except that we are
  183. going to communicate with the \f(CW\*(C`host\*(C'\fR \s-1GDB\s0 via \s-1TCP.\s0 The \f(CW\*(C`host:2345\*(C'\fR argument means
  184. that we are expecting to see a \s-1TCP\s0 connection from \f(CW\*(C`host\*(C'\fR to local \s-1TCP\s0 port
  185. 2345. (Currently, the \f(CW\*(C`host\*(C'\fR part is ignored.) You can choose any number you
  186. want for the port number as long as it does not conflict with any existing \s-1TCP\s0
  187. ports on the target system. This same port number must be used in the host
  188. GDBs \f(CW\*(C`target remote\*(C'\fR command, which will be described shortly. Note that if
  189. you chose a port number that conflicts with another service, \fBgdbserver\fR will
  190. print an error message and exit.
  191. .PP
  192. \&\fBgdbserver\fR can also attach to running programs.
  193. This is accomplished via the \fB\-\-attach\fR argument. The syntax is:
  194. .PP
  195. .Vb 1
  196. \& target> gdbserver \-\-attach <comm> <pid>
  197. .Ve
  198. .PP
  199. \&\fIpid\fR is the process \s-1ID\s0 of a currently running process. It isn't
  200. necessary to point \fBgdbserver\fR at a binary for the running process.
  201. .PP
  202. To start \f(CW\*(C`gdbserver\*(C'\fR without supplying an initial command to run
  203. or process \s-1ID\s0 to attach, use the \fB\-\-multi\fR command line option.
  204. In such case you should connect using \f(CW\*(C`target extended\-remote\*(C'\fR to start
  205. the program you want to debug.
  206. .PP
  207. .Vb 1
  208. \& target> gdbserver \-\-multi <comm>
  209. .Ve
  210. .PP
  211. Usage (host side):
  212. .PP
  213. You need an unstripped copy of the target program on your host system, since
  214. \&\s-1GDB\s0 needs to examine its symbol tables and such. Start up \s-1GDB\s0 as you normally
  215. would, with the target program as the first argument. (You may need to use the
  216. \&\fB\-\-baud\fR option if the serial line is running at anything except 9600 baud.)
  217. That is \f(CW\*(C`gdb TARGET\-PROG\*(C'\fR, or \f(CW\*(C`gdb \-\-baud BAUD TARGET\-PROG\*(C'\fR. After that, the only
  218. new command you need to know about is \f(CW\*(C`target remote\*(C'\fR
  219. (or \f(CW\*(C`target extended\-remote\*(C'\fR). Its argument is either
  220. a device name (usually a serial device, like \fI/dev/ttyb\fR), or a \f(CW\*(C`HOST:PORT\*(C'\fR
  221. descriptor. For example:
  222. .PP
  223. .Vb 1
  224. \& (gdb) target remote /dev/ttyb
  225. .Ve
  226. .PP
  227. communicates with the server via serial line \fI/dev/ttyb\fR, and:
  228. .PP
  229. .Vb 1
  230. \& (gdb) target remote the\-target:2345
  231. .Ve
  232. .PP
  233. communicates via a \s-1TCP\s0 connection to port 2345 on host `the\-target', where
  234. you previously started up \fBgdbserver\fR with the same port number. Note that for
  235. \&\s-1TCP\s0 connections, you must start up \fBgdbserver\fR prior to using the `target remote'
  236. command, otherwise you may get an error that looks something like
  237. `Connection refused'.
  238. .PP
  239. \&\fBgdbserver\fR can also debug multiple inferiors at once,
  240. described in
  241. the \s-1GDB\s0 manual in node \f(CW\*(C`Inferiors Connections and Programs\*(C'\fR
  242. \&\*(-- shell command \f(CW\*(C`info \-f gdb \-n \*(AqInferiors Connections and Programs\*(Aq\*(C'\fR.
  243. In such case use the \f(CW\*(C`extended\-remote\*(C'\fR \s-1GDB\s0 command variant:
  244. .PP
  245. .Vb 1
  246. \& (gdb) target extended\-remote the\-target:2345
  247. .Ve
  248. .PP
  249. The \fBgdbserver\fR option \fB\-\-multi\fR may or may not be used in such
  250. case.
  251. .SH "OPTIONS"
  252. .IX Header "OPTIONS"
  253. There are three different modes for invoking \fBgdbserver\fR:
  254. .IP "\(bu" 4
  255. Debug a specific program specified by its program name:
  256. .Sp
  257. .Vb 1
  258. \& gdbserver <comm> <prog> [<args>...]
  259. .Ve
  260. .Sp
  261. The \fIcomm\fR parameter specifies how should the server communicate
  262. with \s-1GDB\s0; it is either a device name (to use a serial line),
  263. a \s-1TCP\s0 port number (\f(CW\*(C`:1234\*(C'\fR), or \f(CW\*(C`\-\*(C'\fR or \f(CW\*(C`stdio\*(C'\fR to use
  264. stdin/stdout of \f(CW\*(C`gdbserver\*(C'\fR. Specify the name of the program to
  265. debug in \fIprog\fR. Any remaining arguments will be passed to the
  266. program verbatim. When the program exits, \s-1GDB\s0 will close the
  267. connection, and \f(CW\*(C`gdbserver\*(C'\fR will exit.
  268. .IP "\(bu" 4
  269. Debug a specific program by specifying the process \s-1ID\s0 of a running
  270. program:
  271. .Sp
  272. .Vb 1
  273. \& gdbserver \-\-attach <comm> <pid>
  274. .Ve
  275. .Sp
  276. The \fIcomm\fR parameter is as described above. Supply the process \s-1ID\s0
  277. of a running program in \fIpid\fR; \s-1GDB\s0 will do everything
  278. else. Like with the previous mode, when the process \fIpid\fR exits,
  279. \&\s-1GDB\s0 will close the connection, and \f(CW\*(C`gdbserver\*(C'\fR will exit.
  280. .IP "\(bu" 4
  281. Multi-process mode \*(-- debug more than one program/process:
  282. .Sp
  283. .Vb 1
  284. \& gdbserver \-\-multi <comm>
  285. .Ve
  286. .Sp
  287. In this mode, \s-1GDB\s0 can instruct \fBgdbserver\fR which
  288. command(s) to run. Unlike the other 2 modes, \s-1GDB\s0 will not
  289. close the connection when a process being debugged exits, so you can
  290. debug several processes in the same session.
  291. .PP
  292. In each of the modes you may specify these options:
  293. .IP "\fB\-\-help\fR" 4
  294. .IX Item "--help"
  295. List all options, with brief explanations.
  296. .IP "\fB\-\-version\fR" 4
  297. .IX Item "--version"
  298. This option causes \fBgdbserver\fR to print its version number and exit.
  299. .IP "\fB\-\-attach\fR" 4
  300. .IX Item "--attach"
  301. \&\fBgdbserver\fR will attach to a running program. The syntax is:
  302. .Sp
  303. .Vb 1
  304. \& target> gdbserver \-\-attach <comm> <pid>
  305. .Ve
  306. .Sp
  307. \&\fIpid\fR is the process \s-1ID\s0 of a currently running process. It isn't
  308. necessary to point \fBgdbserver\fR at a binary for the running process.
  309. .IP "\fB\-\-multi\fR" 4
  310. .IX Item "--multi"
  311. To start \f(CW\*(C`gdbserver\*(C'\fR without supplying an initial command to run
  312. or process \s-1ID\s0 to attach, use this command line option.
  313. Then you can connect using \f(CW\*(C`target extended\-remote\*(C'\fR and start
  314. the program you want to debug. The syntax is:
  315. .Sp
  316. .Vb 1
  317. \& target> gdbserver \-\-multi <comm>
  318. .Ve
  319. .IP "\fB\-\-debug\fR" 4
  320. .IX Item "--debug"
  321. Instruct \f(CW\*(C`gdbserver\*(C'\fR to display extra status information about the debugging
  322. process.
  323. This option is intended for \f(CW\*(C`gdbserver\*(C'\fR development and for bug reports to
  324. the developers.
  325. .IP "\fB\-\-remote\-debug\fR" 4
  326. .IX Item "--remote-debug"
  327. Instruct \f(CW\*(C`gdbserver\*(C'\fR to display remote protocol debug output.
  328. This option is intended for \f(CW\*(C`gdbserver\*(C'\fR development and for bug reports to
  329. the developers.
  330. .IP "\fB\-\-debug\-file=\fR\fIfilename\fR" 4
  331. .IX Item "--debug-file=filename"
  332. Instruct \f(CW\*(C`gdbserver\*(C'\fR to send any debug output to the given \fIfilename\fR.
  333. This option is intended for \f(CW\*(C`gdbserver\*(C'\fR development and for bug reports to
  334. the developers.
  335. .IP "\fB\-\-debug\-format=option1\fR[\fB,option2,...\fR]" 4
  336. .IX Item "--debug-format=option1[,option2,...]"
  337. Instruct \f(CW\*(C`gdbserver\*(C'\fR to include extra information in each line
  338. of debugging output.
  339. .IP "\fB\-\-wrapper\fR" 4
  340. .IX Item "--wrapper"
  341. Specify a wrapper to launch programs
  342. for debugging. The option should be followed by the name of the
  343. wrapper, then any command-line arguments to pass to the wrapper, then
  344. \&\f(CW\*(C`\-\-\*(C'\fR indicating the end of the wrapper arguments.
  345. .IP "\fB\-\-once\fR" 4
  346. .IX Item "--once"
  347. By default, \fBgdbserver\fR keeps the listening \s-1TCP\s0 port open, so that
  348. additional connections are possible. However, if you start \f(CW\*(C`gdbserver\*(C'\fR
  349. with the \fB\-\-once\fR option, it will stop listening for any further
  350. connection attempts after connecting to the first \s-1GDB\s0 session.
  351. .SH "SEE ALSO"
  352. .IX Header "SEE ALSO"
  353. The full documentation for \s-1GDB\s0 is maintained as a Texinfo manual.
  354. If the \f(CW\*(C`info\*(C'\fR and \f(CW\*(C`gdb\*(C'\fR programs and \s-1GDB\s0's Texinfo
  355. documentation are properly installed at your site, the command
  356. .PP
  357. .Vb 1
  358. \& info gdb
  359. .Ve
  360. .PP
  361. should give you access to the complete manual.
  362. .PP
  363. \&\fIUsing \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
  364. Richard M. Stallman and Roland H. Pesch, July 1991.
  365. .SH "COPYRIGHT"
  366. .IX Header "COPYRIGHT"
  367. Copyright (c) 1988\-2021 Free Software Foundation, Inc.
  368. .PP
  369. Permission is granted to copy, distribute and/or modify this document
  370. under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
  371. any later version published by the Free Software Foundation; with the
  372. Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs
  373. Free Documentation\*(R", with the Front-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R"
  374. and with the Back-Cover Texts as in (a) below.
  375. .PP
  376. (a) The \s-1FSF\s0's Back-Cover Text is: \*(L"You are free to copy and modify
  377. this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in
  378. developing \s-1GNU\s0 and promoting software freedom.\*(R"