Connecting.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: Connecting</title>
  16. <meta name="description" content="Debugging with GDB: Connecting">
  17. <meta name="keywords" content="Debugging with GDB: Connecting">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Remote-Debugging.html#Remote-Debugging" rel="up" title="Remote Debugging">
  26. <link href="File-Transfer.html#File-Transfer" rel="next" title="File Transfer">
  27. <link href="Remote-Debugging.html#Remote-Debugging" rel="previous" title="Remote Debugging">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Connecting"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="File-Transfer.html#File-Transfer" accesskey="n" rel="next">File Transfer</a>, Up: <a href="Remote-Debugging.html#Remote-Debugging" accesskey="u" rel="up">Remote Debugging</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="Connecting-to-a-Remote-Target"></a>
  65. <h3 class="section">20.1 Connecting to a Remote Target</h3>
  66. <a name="index-remote-debugging_002c-connecting"></a>
  67. <a name="index-gdbserver_002c-connecting"></a>
  68. <a name="index-remote-debugging_002c-types-of-connections"></a>
  69. <a name="index-gdbserver_002c-types-of-connections"></a>
  70. <a name="index-gdbserver_002c-target-remote-mode"></a>
  71. <a name="index-gdbserver_002c-target-extended_002dremote-mode"></a>
  72. <p>This section describes how to connect to a remote target, including the
  73. types of connections and their differences, how to set up executable and
  74. symbol files on the host and target, and the commands used for
  75. connecting to and disconnecting from the remote target.
  76. </p>
  77. <a name="Types-of-Remote-Connections"></a>
  78. <h4 class="subsection">20.1.1 Types of Remote Connections</h4>
  79. <p><small>GDB</small> supports two types of remote connections, <code>target remote</code>
  80. mode and <code>target extended-remote</code> mode. Note that many remote targets
  81. support only <code>target remote</code> mode. There are several major
  82. differences between the two types of connections, enumerated here:
  83. </p>
  84. <dl compact="compact">
  85. <dd>
  86. <a name="index-remote-debugging_002c-detach-and-program-exit"></a>
  87. </dd>
  88. <dt>Result of detach or program exit</dt>
  89. <dd><p><strong>With target remote mode:</strong> When the debugged program exits or you
  90. detach from it, <small>GDB</small> disconnects from the target. When using
  91. <code>gdbserver</code>, <code>gdbserver</code> will exit.
  92. </p>
  93. <p><strong>With target extended-remote mode:</strong> When the debugged program exits or
  94. you detach from it, <small>GDB</small> remains connected to the target, even
  95. though no program is running. You can rerun the program, attach to a
  96. running program, or use <code>monitor</code> commands specific to the target.
  97. </p>
  98. <p>When using <code>gdbserver</code> in this case, it does not exit unless it was
  99. invoked using the <samp>--once</samp> option. If the <samp>--once</samp> option
  100. was not used, you can ask <code>gdbserver</code> to exit using the
  101. <code>monitor exit</code> command (see <a href="Server.html#Monitor-Commands-for-gdbserver">Monitor Commands for gdbserver</a>).
  102. </p>
  103. </dd>
  104. <dt>Specifying the program to debug</dt>
  105. <dd><p>For both connection types you use the <code>file</code> command to specify the
  106. program on the host system. If you are using <code>gdbserver</code> there are
  107. some differences in how to specify the location of the program on the
  108. target.
  109. </p>
  110. <p><strong>With target remote mode:</strong> You must either specify the program to debug
  111. on the <code>gdbserver</code> command line or use the <samp>--attach</samp> option
  112. (see <a href="Server.html#Attaching-to-a-program">Attaching to a Running Program</a>).
  113. </p>
  114. <a name="index-_002d_002dmulti_002c-gdbserver-option"></a>
  115. <p><strong>With target extended-remote mode:</strong> You may specify the program to debug
  116. on the <code>gdbserver</code> command line, or you can load the program or attach
  117. to it using <small>GDB</small> commands after connecting to <code>gdbserver</code>.
  118. </p>
  119. <a name="g_t_002d_002dmulti-Option-in-Types-of-Remote-Connnections"></a><p>You can start <code>gdbserver</code> without supplying an initial command to run
  120. or process ID to attach. To do this, use the <samp>--multi</samp> command line
  121. option. Then you can connect using <code>target extended-remote</code> and start
  122. the program you want to debug (see below for details on using the
  123. <code>run</code> command in this scenario). Note that the conditions under which
  124. <code>gdbserver</code> terminates depend on how <small>GDB</small> connects to it
  125. (<code>target remote</code> or <code>target extended-remote</code>). The
  126. <samp>--multi</samp> option to <code>gdbserver</code> has no influence on that.
  127. </p>
  128. </dd>
  129. <dt>The <code>run</code> command</dt>
  130. <dd><p><strong>With target remote mode:</strong> The <code>run</code> command is not
  131. supported. Once a connection has been established, you can use all
  132. the usual <small>GDB</small> commands to examine and change data. The
  133. remote program is already running, so you can use commands like
  134. <kbd>step</kbd> and <kbd>continue</kbd>.
  135. </p>
  136. <p><strong>With target extended-remote mode:</strong> The <code>run</code> command is
  137. supported. The <code>run</code> command uses the value set by
  138. <code>set remote exec-file</code> (see <a href="Remote-Configuration.html#set-remote-exec_002dfile">set remote exec-file</a>) to select
  139. the program to run. Command line arguments are supported, except for
  140. wildcard expansion and I/O redirection (see <a href="Arguments.html#Arguments">Arguments</a>).
  141. </p>
  142. <p>If you specify the program to debug on the command line, then the
  143. <code>run</code> command is not required to start execution, and you can
  144. resume using commands like <kbd>step</kbd> and <kbd>continue</kbd> as with
  145. <code>target remote</code> mode.
  146. </p>
  147. <a name="Attaching-in-Types-of-Remote-Connections"></a></dd>
  148. <dt>Attaching</dt>
  149. <dd><p><strong>With target remote mode:</strong> The <small>GDB</small> command <code>attach</code> is
  150. not supported. To attach to a running program using <code>gdbserver</code>, you
  151. must use the <samp>--attach</samp> option (see <a href="Server.html#Running-gdbserver">Running gdbserver</a>).
  152. </p>
  153. <p><strong>With target extended-remote mode:</strong> To attach to a running program,
  154. you may use the <code>attach</code> command after the connection has been
  155. established. If you are using <code>gdbserver</code>, you may also invoke
  156. <code>gdbserver</code> using the <samp>--attach</samp> option
  157. (see <a href="Server.html#Running-gdbserver">Running gdbserver</a>).
  158. </p>
  159. <p>Some remote targets allow <small>GDB</small> to determine the executable file running
  160. in the process the debugger is attaching to. In such a case, <small>GDB</small>
  161. uses the value of <code>exec-file-mismatch</code> to handle a possible mismatch
  162. between the executable file name running in the process and the name of the
  163. current exec-file loaded by <small>GDB</small> (see <a href="Attach.html#set-exec_002dfile_002dmismatch">set exec-file-mismatch</a>).
  164. </p>
  165. </dd>
  166. </dl>
  167. <a name="Host-and-target-files"></a><a name="Host-and-Target-Files"></a>
  168. <h4 class="subsection">20.1.2 Host and Target Files</h4>
  169. <a name="index-remote-debugging_002c-symbol-files"></a>
  170. <a name="index-symbol-files_002c-remote-debugging"></a>
  171. <p><small>GDB</small>, running on the host, needs access to symbol and debugging
  172. information for your program running on the target. This requires
  173. access to an unstripped copy of your program, and possibly any associated
  174. symbol files. Note that this section applies equally to both <code>target
  175. remote</code> mode and <code>target extended-remote</code> mode.
  176. </p>
  177. <p>Some remote targets (see <a href="General-Query-Packets.html#qXfer-executable-filename-read">qXfer executable filename read</a>, and
  178. see <a href="Host-I_002fO-Packets.html#Host-I_002fO-Packets">Host I/O Packets</a>) allow <small>GDB</small> to access program files over
  179. the same connection used to communicate with <small>GDB</small>. With such a
  180. target, if the remote program is unstripped, the only command you need is
  181. <code>target remote</code> (or <code>target extended-remote</code>).
  182. </p>
  183. <p>If the remote program is stripped, or the target does not support remote
  184. program file access, start up <small>GDB</small> using the name of the local
  185. unstripped copy of your program as the first argument, or use the
  186. <code>file</code> command. Use <code>set sysroot</code> to specify the location (on
  187. the host) of target libraries (unless your <small>GDB</small> was compiled with
  188. the correct sysroot using <code>--with-sysroot</code>). Alternatively, you
  189. may use <code>set solib-search-path</code> to specify how <small>GDB</small> locates
  190. target libraries.
  191. </p>
  192. <p>The symbol file and target libraries must exactly match the executable
  193. and libraries on the target, with one exception: the files on the host
  194. system should not be stripped, even if the files on the target system
  195. are. Mismatched or missing files will lead to confusing results
  196. during debugging. On <small>GNU</small>/Linux targets, mismatched or missing
  197. files may also prevent <code>gdbserver</code> from debugging multi-threaded
  198. programs.
  199. </p>
  200. <a name="Remote-Connection-Commands"></a>
  201. <h4 class="subsection">20.1.3 Remote Connection Commands</h4>
  202. <a name="index-remote-connection-commands"></a>
  203. <p><small>GDB</small> can communicate with the target over a serial line, a
  204. local Unix domain socket, or
  205. over an <acronym>IP</acronym> network using <acronym>TCP</acronym> or <acronym>UDP</acronym>. In
  206. each case, <small>GDB</small> uses the same protocol for debugging your
  207. program; only the medium carrying the debugging packets varies. The
  208. <code>target remote</code> and <code>target extended-remote</code> commands
  209. establish a connection to the target. Both commands accept the same
  210. arguments, which indicate the medium to use:
  211. </p>
  212. <dl compact="compact">
  213. <dt><code>target remote <var>serial-device</var></code></dt>
  214. <dt><code>target extended-remote <var>serial-device</var></code></dt>
  215. <dd><a name="index-serial-line_002c-target-remote"></a>
  216. <p>Use <var>serial-device</var> to communicate with the target. For example,
  217. to use a serial line connected to the device named <samp>/dev/ttyb</samp>:
  218. </p>
  219. <div class="smallexample">
  220. <pre class="smallexample">target remote /dev/ttyb
  221. </pre></div>
  222. <p>If you&rsquo;re using a serial line, you may want to give <small>GDB</small> the
  223. &lsquo;<samp>--baud</samp>&rsquo; option, or use the <code>set serial baud</code> command
  224. (see <a href="Remote-Configuration.html#Remote-Configuration">set serial baud</a>) before the
  225. <code>target</code> command.
  226. </p>
  227. </dd>
  228. <dt><code>target remote <var>local-socket</var></code></dt>
  229. <dt><code>target extended-remote <var>local-socket</var></code></dt>
  230. <dd><a name="index-local-socket_002c-target-remote"></a>
  231. <a name="index-Unix-domain-socket"></a>
  232. <p>Use <var>local-socket</var> to communicate with the target. For example,
  233. to use a local Unix domain socket bound to the file system entry <samp>/tmp/gdb-socket0</samp>:
  234. </p>
  235. <div class="smallexample">
  236. <pre class="smallexample">target remote /tmp/gdb-socket0
  237. </pre></div>
  238. <p>Note that this command has the same form as the command to connect
  239. to a serial line. <small>GDB</small> will automatically determine which
  240. kind of file you have specified and will make the appropriate kind
  241. of connection.
  242. This feature is not available if the host system does not support
  243. Unix domain sockets.
  244. </p>
  245. </dd>
  246. <dt><code>target remote <code><var>host</var>:<var>port</var></code></code></dt>
  247. <dt><code>target remote <code>[<var>host</var>]:<var>port</var></code></code></dt>
  248. <dt><code>target remote <code>tcp:<var>host</var>:<var>port</var></code></code></dt>
  249. <dt><code>target remote <code>tcp:[<var>host</var>]:<var>port</var></code></code></dt>
  250. <dt><code>target remote <code>tcp4:<var>host</var>:<var>port</var></code></code></dt>
  251. <dt><code>target remote <code>tcp6:<var>host</var>:<var>port</var></code></code></dt>
  252. <dt><code>target remote <code>tcp6:[<var>host</var>]:<var>port</var></code></code></dt>
  253. <dt><code>target extended-remote <code><var>host</var>:<var>port</var></code></code></dt>
  254. <dt><code>target extended-remote <code>[<var>host</var>]:<var>port</var></code></code></dt>
  255. <dt><code>target extended-remote <code>tcp:<var>host</var>:<var>port</var></code></code></dt>
  256. <dt><code>target extended-remote <code>tcp:[<var>host</var>]:<var>port</var></code></code></dt>
  257. <dt><code>target extended-remote <code>tcp4:<var>host</var>:<var>port</var></code></code></dt>
  258. <dt><code>target extended-remote <code>tcp6:<var>host</var>:<var>port</var></code></code></dt>
  259. <dt><code>target extended-remote <code>tcp6:[<var>host</var>]:<var>port</var></code></code></dt>
  260. <dd><a name="index-TCP-port_002c-target-remote"></a>
  261. <p>Debug using a <acronym>TCP</acronym> connection to <var>port</var> on <var>host</var>.
  262. The <var>host</var> may be either a host name, a numeric <acronym>IPv4</acronym>
  263. address, or a numeric <acronym>IPv6</acronym> address (with or without the
  264. square brackets to separate the address from the port); <var>port</var>
  265. must be a decimal number. The <var>host</var> could be the target machine
  266. itself, if it is directly connected to the net, or it might be a
  267. terminal server which in turn has a serial line to the target.
  268. </p>
  269. <p>For example, to connect to port 2828 on a terminal server named
  270. <code>manyfarms</code>:
  271. </p>
  272. <div class="smallexample">
  273. <pre class="smallexample">target remote manyfarms:2828
  274. </pre></div>
  275. <p>To connect to port 2828 on a terminal server whose address is
  276. <code>2001:0db8:85a3:0000:0000:8a2e:0370:7334</code>, you can either use the
  277. square bracket syntax:
  278. </p>
  279. <div class="smallexample">
  280. <pre class="smallexample">target remote [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:2828
  281. </pre></div>
  282. <p>or explicitly specify the <acronym>IPv6</acronym> protocol:
  283. </p>
  284. <div class="smallexample">
  285. <pre class="smallexample">target remote tcp6:2001:0db8:85a3:0000:0000:8a2e:0370:7334:2828
  286. </pre></div>
  287. <p>This last example may be confusing to the reader, because there is no
  288. visible separation between the hostname and the port number.
  289. Therefore, we recommend the user to provide <acronym>IPv6</acronym> addresses
  290. using square brackets for clarity. However, it is important to
  291. mention that for <small>GDB</small> there is no ambiguity: the number after
  292. the last colon is considered to be the port number.
  293. </p>
  294. <p>If your remote target is actually running on the same machine as your
  295. debugger session (e.g. a simulator for your target running on the
  296. same host), you can omit the hostname. For example, to connect to
  297. port 1234 on your local machine:
  298. </p>
  299. <div class="smallexample">
  300. <pre class="smallexample">target remote :1234
  301. </pre></div>
  302. <p>Note that the colon is still required here.
  303. </p>
  304. </dd>
  305. <dt><code>target remote <code>udp:<var>host</var>:<var>port</var></code></code></dt>
  306. <dt><code>target remote <code>udp:[<var>host</var>]:<var>port</var></code></code></dt>
  307. <dt><code>target remote <code>udp4:<var>host</var>:<var>port</var></code></code></dt>
  308. <dt><code>target remote <code>udp6:[<var>host</var>]:<var>port</var></code></code></dt>
  309. <dt><code>target extended-remote <code>udp:<var>host</var>:<var>port</var></code></code></dt>
  310. <dt><code>target extended-remote <code>udp:<var>host</var>:<var>port</var></code></code></dt>
  311. <dt><code>target extended-remote <code>udp:[<var>host</var>]:<var>port</var></code></code></dt>
  312. <dt><code>target extended-remote <code>udp4:<var>host</var>:<var>port</var></code></code></dt>
  313. <dt><code>target extended-remote <code>udp6:<var>host</var>:<var>port</var></code></code></dt>
  314. <dt><code>target extended-remote <code>udp6:[<var>host</var>]:<var>port</var></code></code></dt>
  315. <dd><a name="index-UDP-port_002c-target-remote"></a>
  316. <p>Debug using <acronym>UDP</acronym> packets to <var>port</var> on <var>host</var>. For example, to
  317. connect to <acronym>UDP</acronym> port 2828 on a terminal server named <code>manyfarms</code>:
  318. </p>
  319. <div class="smallexample">
  320. <pre class="smallexample">target remote udp:manyfarms:2828
  321. </pre></div>
  322. <p>When using a <acronym>UDP</acronym> connection for remote debugging, you should
  323. keep in mind that the &lsquo;U&rsquo; stands for &ldquo;Unreliable&rdquo;. <acronym>UDP</acronym>
  324. can silently drop packets on busy or unreliable networks, which will
  325. cause havoc with your debugging session.
  326. </p>
  327. </dd>
  328. <dt><code>target remote | <var>command</var></code></dt>
  329. <dt><code>target extended-remote | <var>command</var></code></dt>
  330. <dd><a name="index-pipe_002c-target-remote-to"></a>
  331. <p>Run <var>command</var> in the background and communicate with it using a
  332. pipe. The <var>command</var> is a shell command, to be parsed and expanded
  333. by the system&rsquo;s command shell, <code>/bin/sh</code>; it should expect remote
  334. protocol packets on its standard input, and send replies on its
  335. standard output. You could use this to run a stand-alone simulator
  336. that speaks the remote debugging protocol, to make net connections
  337. using programs like <code>ssh</code>, or for other similar tricks.
  338. </p>
  339. <p>If <var>command</var> closes its standard output (perhaps by exiting),
  340. <small>GDB</small> will try to send it a <code>SIGTERM</code> signal. (If the
  341. program has already exited, this will have no effect.)
  342. </p>
  343. </dd>
  344. </dl>
  345. <a name="index-interrupting-remote-programs"></a>
  346. <a name="index-remote-programs_002c-interrupting"></a>
  347. <p>Whenever <small>GDB</small> is waiting for the remote program, if you type the
  348. interrupt character (often <kbd>Ctrl-c</kbd>), <small>GDB</small> attempts to stop the
  349. program. This may or may not succeed, depending in part on the hardware
  350. and the serial drivers the remote system uses. If you type the
  351. interrupt character once again, <small>GDB</small> displays this prompt:
  352. </p>
  353. <div class="smallexample">
  354. <pre class="smallexample">Interrupted while waiting for the program.
  355. Give up (and stop debugging it)? (y or n)
  356. </pre></div>
  357. <p>In <code>target remote</code> mode, if you type <kbd>y</kbd>, <small>GDB</small> abandons
  358. the remote debugging session. (If you decide you want to try again later,
  359. you can use <kbd>target remote</kbd> again to connect once more.) If you type
  360. <kbd>n</kbd>, <small>GDB</small> goes back to waiting.
  361. </p>
  362. <p>In <code>target extended-remote</code> mode, typing <kbd>n</kbd> will leave
  363. <small>GDB</small> connected to the target.
  364. </p>
  365. <dl compact="compact">
  366. <dd><a name="index-detach-_0028remote_0029"></a>
  367. </dd>
  368. <dt><code>detach</code></dt>
  369. <dd><p>When you have finished debugging the remote program, you can use the
  370. <code>detach</code> command to release it from <small>GDB</small> control.
  371. Detaching from the target normally resumes its execution, but the results
  372. will depend on your particular remote stub. After the <code>detach</code>
  373. command in <code>target remote</code> mode, <small>GDB</small> is free to connect to
  374. another target. In <code>target extended-remote</code> mode, <small>GDB</small> is
  375. still connected to the target.
  376. </p>
  377. <a name="index-disconnect"></a>
  378. </dd>
  379. <dt><code>disconnect</code></dt>
  380. <dd><p>The <code>disconnect</code> command closes the connection to the target, and
  381. the target is generally not resumed. It will wait for <small>GDB</small>
  382. (this instance or another one) to connect and continue debugging. After
  383. the <code>disconnect</code> command, <small>GDB</small> is again free to connect to
  384. another target.
  385. </p>
  386. <a name="index-send-command-to-remote-monitor"></a>
  387. <a name="index-extend-GDB-for-remote-targets"></a>
  388. <a name="index-add-new-commands-for-external-monitor"></a>
  389. <a name="index-monitor"></a>
  390. </dd>
  391. <dt><code>monitor <var>cmd</var></code></dt>
  392. <dd><p>This command allows you to send arbitrary commands directly to the
  393. remote monitor. Since <small>GDB</small> doesn&rsquo;t care about the commands it
  394. sends like this, this command is the way to extend <small>GDB</small>&mdash;you
  395. can add new commands that only the external monitor will understand
  396. and implement.
  397. </p></dd>
  398. </dl>
  399. <hr>
  400. <div class="header">
  401. <p>
  402. Next: <a href="File-Transfer.html#File-Transfer" accesskey="n" rel="next">File Transfer</a>, Up: <a href="Remote-Debugging.html#Remote-Debugging" accesskey="u" rel="up">Remote Debugging</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  403. </div>
  404. </body>
  405. </html>