| <html lang="en"> |
| <head> |
| <title>Stop Reply Packets - Debugging with GDB</title> |
| <meta http-equiv="Content-Type" content="text/html"> |
| <meta name="description" content="Debugging with GDB"> |
| <meta name="generator" content="makeinfo 4.13"> |
| <link title="Top" rel="start" href="index.html#Top"> |
| <link rel="up" href="Remote-Protocol.html#Remote-Protocol" title="Remote Protocol"> |
| <link rel="prev" href="Packets.html#Packets" title="Packets"> |
| <link rel="next" href="General-Query-Packets.html#General-Query-Packets" title="General Query Packets"> |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> |
| <!-- |
| Copyright (C) 1988-2019 Free Software Foundation, Inc. |
| |
| Permission is granted to copy, distribute and/or modify this document |
| under the terms of the GNU Free Documentation License, Version 1.3 or |
| any later version published by the Free Software Foundation; with the |
| Invariant Sections being ``Free Software'' and ``Free Software Needs |
| Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' |
| and with the Back-Cover Texts as in (a) below. |
| |
| (a) The FSF's Back-Cover Text is: ``You are free to copy and modify |
| this GNU Manual. Buying copies from GNU Press supports the FSF in |
| developing GNU and promoting software freedom.'' |
| --> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <style type="text/css"><!-- |
| pre.display { font-family:inherit } |
| pre.format { font-family:inherit } |
| pre.smalldisplay { font-family:inherit; font-size:smaller } |
| pre.smallformat { font-family:inherit; font-size:smaller } |
| pre.smallexample { font-size:smaller } |
| pre.smalllisp { font-size:smaller } |
| span.sc { font-variant:small-caps } |
| span.roman { font-family:serif; font-weight:normal; } |
| span.sansserif { font-family:sans-serif; font-weight:normal; } |
| --></style> |
| </head> |
| <body> |
| <div class="node"> |
| <a name="Stop-Reply-Packets"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="General-Query-Packets.html#General-Query-Packets">General Query Packets</a>, |
| Previous: <a rel="previous" accesskey="p" href="Packets.html#Packets">Packets</a>, |
| Up: <a rel="up" accesskey="u" href="Remote-Protocol.html#Remote-Protocol">Remote Protocol</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">E.3 Stop Reply Packets</h3> |
| |
| <p><a name="index-stop-reply-packets-3481"></a> |
| The ‘<samp><span class="samp">C</span></samp>’, ‘<samp><span class="samp">c</span></samp>’, ‘<samp><span class="samp">S</span></samp>’, ‘<samp><span class="samp">s</span></samp>’, ‘<samp><span class="samp">vCont</span></samp>’, |
| ‘<samp><span class="samp">vAttach</span></samp>’, ‘<samp><span class="samp">vRun</span></samp>’, ‘<samp><span class="samp">vStopped</span></samp>’, and ‘<samp><span class="samp">?</span></samp>’ packets can |
| receive any of the below as a reply. Except for ‘<samp><span class="samp">?</span></samp>’ |
| and ‘<samp><span class="samp">vStopped</span></samp>’, that reply is only returned |
| when the target halts. In the below the exact meaning of <dfn>signal |
| number</dfn> is defined by the header <samp><span class="file">include/gdb/signals.h</span></samp> in the |
| <span class="sc">gdb</span> source code. |
| |
| <p>In non-stop mode, the server will simply reply ‘<samp><span class="samp">OK</span></samp>’ to commands |
| such as ‘<samp><span class="samp">vCont</span></samp>’; any stop will be the subject of a future |
| notification. See <a href="Remote-Non_002dStop.html#Remote-Non_002dStop">Remote Non-Stop</a>. |
| |
| <p>As in the description of request packets, we include spaces in the |
| reply templates for clarity; these are not part of the reply packet's |
| syntax. No <span class="sc">gdb</span> stop reply packet uses spaces to separate its |
| components. |
| |
| <dl> |
| <dt>‘<samp><span class="samp">S </span><var>AA</var></samp>’<dd>The program received signal number <var>AA</var> (a two-digit hexadecimal |
| number). This is equivalent to a ‘<samp><span class="samp">T</span></samp>’ response with no |
| <var>n</var>:<var>r</var> pairs. |
| |
| <br><dt>‘<samp><span class="samp">T </span><var>AA</var> <var>n1</var><span class="samp">:</span><var>r1</var><span class="samp">;</span><var>n2</var><span class="samp">:</span><var>r2</var><span class="samp">;...</span></samp>’<dd><a name="index-g_t_0040samp_007bT_007d-packet-reply-3482"></a>The program received signal number <var>AA</var> (a two-digit hexadecimal |
| number). This is equivalent to an ‘<samp><span class="samp">S</span></samp>’ response, except that the |
| ‘<samp><var>n</var><span class="samp">:</span><var>r</var></samp>’ pairs can carry values of important registers |
| and other information directly in the stop reply packet, reducing |
| round-trip latency. Single-step and breakpoint traps are reported |
| this way. Each ‘<samp><var>n</var><span class="samp">:</span><var>r</var></samp>’ pair is interpreted as follows: |
| |
| <ul> |
| <li>If <var>n</var> is a hexadecimal number, it is a register number, and the |
| corresponding <var>r</var> gives that register's value. The data <var>r</var> is a |
| series of bytes in target byte order, with each byte given by a |
| two-digit hex number. |
| |
| <li>If <var>n</var> is ‘<samp><span class="samp">thread</span></samp>’, then <var>r</var> is the <var>thread-id</var> of |
| the stopped thread, as specified in <a href="thread_002did-syntax.html#thread_002did-syntax">thread-id syntax</a>. |
| |
| <li>If <var>n</var> is ‘<samp><span class="samp">core</span></samp>’, then <var>r</var> is the hexadecimal number of |
| the core on which the stop event was detected. |
| |
| <li>If <var>n</var> is a recognized <dfn>stop reason</dfn>, it describes a more |
| specific event that stopped the target. The currently defined stop |
| reasons are listed below. The <var>aa</var> should be ‘<samp><span class="samp">05</span></samp>’, the trap |
| signal. At most one stop reason should be present. |
| |
| <li>Otherwise, <span class="sc">gdb</span> should ignore this ‘<samp><var>n</var><span class="samp">:</span><var>r</var></samp>’ pair |
| and go on to the next; this allows us to extend the protocol in the |
| future. |
| </ul> |
| |
| <p>The currently defined stop reasons are: |
| |
| <dl> |
| <dt>‘<samp><span class="samp">watch</span></samp>’<dt>‘<samp><span class="samp">rwatch</span></samp>’<dt>‘<samp><span class="samp">awatch</span></samp>’<dd>The packet indicates a watchpoint hit, and <var>r</var> is the data address, in |
| hex. |
| |
| <br><dt>‘<samp><span class="samp">syscall_entry</span></samp>’<dt>‘<samp><span class="samp">syscall_return</span></samp>’<dd>The packet indicates a syscall entry or return, and <var>r</var> is the |
| syscall number, in hex. |
| |
| <p><a name="index-shared-library-events_002c-remote-reply-3483"></a><br><dt>‘<samp><span class="samp">library</span></samp>’<dd>The packet indicates that the loaded libraries have changed. |
| <span class="sc">gdb</span> should use ‘<samp><span class="samp">qXfer:libraries:read</span></samp>’ to fetch a new |
| list of loaded libraries. The <var>r</var> part is ignored. |
| |
| <p><a name="index-replay-log-events_002c-remote-reply-3484"></a><br><dt>‘<samp><span class="samp">replaylog</span></samp>’<dd>The packet indicates that the target cannot continue replaying |
| logged execution events, because it has reached the end (or the |
| beginning when executing backward) of the log. The value of <var>r</var> |
| will be either ‘<samp><span class="samp">begin</span></samp>’ or ‘<samp><span class="samp">end</span></samp>’. See <a href="Reverse-Execution.html#Reverse-Execution">Reverse Execution</a>, |
| for more information. |
| |
| <br><dt>‘<samp><span class="samp">swbreak</span></samp>’<dd><a name="swbreak-stop-reason"></a>The packet indicates a software breakpoint instruction was executed, |
| irrespective of whether it was <span class="sc">gdb</span> that planted the |
| breakpoint or the breakpoint is hardcoded in the program. The <var>r</var> |
| part must be left empty. |
| |
| <p>On some architectures, such as x86, at the architecture level, when a |
| breakpoint instruction executes the program counter points at the |
| breakpoint address plus an offset. On such targets, the stub is |
| responsible for adjusting the PC to point back at the breakpoint |
| address. |
| |
| <p>This packet should not be sent by default; older <span class="sc">gdb</span> versions |
| did not support it. <span class="sc">gdb</span> requests it, by supplying an |
| appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature (see <a href="qSupported.html#qSupported">qSupported</a>). The |
| remote stub must also supply the appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature |
| indicating support. |
| |
| <p>This packet is required for correct non-stop mode operation. |
| |
| <br><dt>‘<samp><span class="samp">hwbreak</span></samp>’<dd>The packet indicates the target stopped for a hardware breakpoint. |
| The <var>r</var> part must be left empty. |
| |
| <p>The same remarks about ‘<samp><span class="samp">qSupported</span></samp>’ and non-stop mode above |
| apply. |
| |
| <p><a name="index-fork-events_002c-remote-reply-3485"></a><br><dt>‘<samp><span class="samp">fork</span></samp>’<dd>The packet indicates that <code>fork</code> was called, and <var>r</var> |
| is the thread ID of the new child process. Refer to |
| <a href="thread_002did-syntax.html#thread_002did-syntax">thread-id syntax</a> for the format of the <var>thread-id</var> |
| field. This packet is only applicable to targets that support |
| fork events. |
| |
| <p>This packet should not be sent by default; older <span class="sc">gdb</span> versions |
| did not support it. <span class="sc">gdb</span> requests it, by supplying an |
| appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature (see <a href="qSupported.html#qSupported">qSupported</a>). The |
| remote stub must also supply the appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature |
| indicating support. |
| |
| <p><a name="index-vfork-events_002c-remote-reply-3486"></a><br><dt>‘<samp><span class="samp">vfork</span></samp>’<dd>The packet indicates that <code>vfork</code> was called, and <var>r</var> |
| is the thread ID of the new child process. Refer to |
| <a href="thread_002did-syntax.html#thread_002did-syntax">thread-id syntax</a> for the format of the <var>thread-id</var> |
| field. This packet is only applicable to targets that support |
| vfork events. |
| |
| <p>This packet should not be sent by default; older <span class="sc">gdb</span> versions |
| did not support it. <span class="sc">gdb</span> requests it, by supplying an |
| appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature (see <a href="qSupported.html#qSupported">qSupported</a>). The |
| remote stub must also supply the appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature |
| indicating support. |
| |
| <p><a name="index-vforkdone-events_002c-remote-reply-3487"></a><br><dt>‘<samp><span class="samp">vforkdone</span></samp>’<dd>The packet indicates that a child process created by a vfork |
| has either called <code>exec</code> or terminated, so that the |
| address spaces of the parent and child process are no longer |
| shared. The <var>r</var> part is ignored. This packet is only |
| applicable to targets that support vforkdone events. |
| |
| <p>This packet should not be sent by default; older <span class="sc">gdb</span> versions |
| did not support it. <span class="sc">gdb</span> requests it, by supplying an |
| appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature (see <a href="qSupported.html#qSupported">qSupported</a>). The |
| remote stub must also supply the appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature |
| indicating support. |
| |
| <p><a name="index-exec-events_002c-remote-reply-3488"></a><br><dt>‘<samp><span class="samp">exec</span></samp>’<dd>The packet indicates that <code>execve</code> was called, and <var>r</var> |
| is the absolute pathname of the file that was executed, in hex. |
| This packet is only applicable to targets that support exec events. |
| |
| <p>This packet should not be sent by default; older <span class="sc">gdb</span> versions |
| did not support it. <span class="sc">gdb</span> requests it, by supplying an |
| appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature (see <a href="qSupported.html#qSupported">qSupported</a>). The |
| remote stub must also supply the appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature |
| indicating support. |
| |
| <p><a name="index-thread-create-event_002c-remote-reply-3489"></a><a name="thread-create-event"></a><br><dt>‘<samp><span class="samp">create</span></samp>’<dd>The packet indicates that the thread was just created. The new thread |
| is stopped until <span class="sc">gdb</span> sets it running with a resumption packet |
| (see <a href="vCont-packet.html#vCont-packet">vCont packet</a>). This packet should not be sent by default; |
| <span class="sc">gdb</span> requests it with the <a href="QThreadEvents.html#QThreadEvents">QThreadEvents</a> packet. See |
| also the ‘<samp><span class="samp">w</span></samp>’ (see <a href="thread-exit-event.html#thread-exit-event">thread exit event</a>) remote reply below. The |
| <var>r</var> part is ignored. |
| |
| </dl> |
| |
| <br><dt>‘<samp><span class="samp">W </span><var>AA</var></samp>’<dt>‘<samp><span class="samp">W </span><var>AA</var><span class="samp"> ; process:</span><var>pid</var></samp>’<dd>The process exited, and <var>AA</var> is the exit status. This is only |
| applicable to certain targets. |
| |
| <p>The second form of the response, including the process ID of the |
| exited process, can be used only when <span class="sc">gdb</span> has reported |
| support for multiprocess protocol extensions; see <a href="multiprocess-extensions.html#multiprocess-extensions">multiprocess extensions</a>. Both <var>AA</var> and <var>pid</var> are formatted as big-endian |
| hex strings. |
| |
| <br><dt>‘<samp><span class="samp">X </span><var>AA</var></samp>’<dt>‘<samp><span class="samp">X </span><var>AA</var><span class="samp"> ; process:</span><var>pid</var></samp>’<dd>The process terminated with signal <var>AA</var>. |
| |
| <p>The second form of the response, including the process ID of the |
| terminated process, can be used only when <span class="sc">gdb</span> has reported |
| support for multiprocess protocol extensions; see <a href="multiprocess-extensions.html#multiprocess-extensions">multiprocess extensions</a>. Both <var>AA</var> and <var>pid</var> are formatted as big-endian |
| hex strings. |
| |
| <p><a name="thread-exit-event"></a><a name="index-thread-exit-event_002c-remote-reply-3490"></a><br><dt>‘<samp><span class="samp">w </span><var>AA</var><span class="samp"> ; </span><var>tid</var></samp>’<dd> |
| The thread exited, and <var>AA</var> is the exit status. This response |
| should not be sent by default; <span class="sc">gdb</span> requests it with the |
| <a href="QThreadEvents.html#QThreadEvents">QThreadEvents</a> packet. See also <a href="thread-create-event.html#thread-create-event">thread create event</a> above. |
| <var>AA</var> is formatted as a big-endian hex string. |
| |
| <br><dt>‘<samp><span class="samp">N</span></samp>’<dd>There are no resumed threads left in the target. In other words, even |
| though the process is alive, the last resumed thread has exited. For |
| example, say the target process has two threads: thread 1 and thread |
| 2. The client leaves thread 1 stopped, and resumes thread 2, which |
| subsequently exits. At this point, even though the process is still |
| alive, and thus no ‘<samp><span class="samp">W</span></samp>’ stop reply is sent, no thread is actually |
| executing either. The ‘<samp><span class="samp">N</span></samp>’ stop reply thus informs the client |
| that it can stop waiting for stop replies. This packet should not be |
| sent by default; older <span class="sc">gdb</span> versions did not support it. |
| <span class="sc">gdb</span> requests it, by supplying an appropriate |
| ‘<samp><span class="samp">qSupported</span></samp>’ feature (see <a href="qSupported.html#qSupported">qSupported</a>). The remote stub must |
| also supply the appropriate ‘<samp><span class="samp">qSupported</span></samp>’ feature indicating |
| support. |
| |
| <br><dt>‘<samp><span class="samp">O </span><var>XX</var><span class="samp">...</span></samp>’<dd>‘<samp><var>XX</var><span class="samp">...</span></samp>’ is hex encoding of <span class="sc">ascii</span> data, to be |
| written as the program's console output. This can happen at any time |
| while the program is running and the debugger should continue to wait |
| for ‘<samp><span class="samp">W</span></samp>’, ‘<samp><span class="samp">T</span></samp>’, etc. This reply is not permitted in non-stop mode. |
| |
| <br><dt>‘<samp><span class="samp">F </span><var>call-id</var><span class="samp">,</span><var>parameter</var><span class="samp">...</span></samp>’<dd><var>call-id</var> is the identifier which says which host system call should |
| be called. This is just the name of the function. Translation into the |
| correct system call is only applicable as it's defined in <span class="sc">gdb</span>. |
| See <a href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension">File-I/O Remote Protocol Extension</a>, for a list of implemented |
| system calls. |
| |
| <p>‘<samp><var>parameter</var><span class="samp">...</span></samp>’ is a list of parameters as defined for |
| this very system call. |
| |
| <p>The target replies with this packet when it expects <span class="sc">gdb</span> to |
| call a host system call on behalf of the target. <span class="sc">gdb</span> replies |
| with an appropriate ‘<samp><span class="samp">F</span></samp>’ packet and keeps up waiting for the next |
| reply packet from the target. The latest ‘<samp><span class="samp">C</span></samp>’, ‘<samp><span class="samp">c</span></samp>’, ‘<samp><span class="samp">S</span></samp>’ |
| or ‘<samp><span class="samp">s</span></samp>’ action is expected to be continued. See <a href="File_002dI_002fO-Remote-Protocol-Extension.html#File_002dI_002fO-Remote-Protocol-Extension">File-I/O Remote Protocol Extension</a>, for more details. |
| |
| </dl> |
| |
| </body></html> |
| |