<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64872>64872</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[lldb] LLDB sens a QStartNoAckMode packet to remote GDB servers even if they don't support it
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
PoroCYon
</td>
</tr>
</table>
<pre>
This issue has [come up](https://github.com/melonDS-emu/melonDS/pull/1583#issuecomment-1686813396) when testing the GDB-protocol server implementation for melonDS. LLDB sends a `QStartNoAckMode` packet as the very first command sent (as shown in the log in the linked issue). This shouldn't happen: the client first needs to send a `qSupported` packet to check whether the server supports no-ack mode. Only if both do, the client may send the `QStartNoAckMode` packet to switch to no-ack mode (c.f. [GDB documentation](https://sourceware.org/gdb/onlinedocs/gdb/Packet-Acknowledgment.html)):
> If the stub supports ‘QStartNoAckMode’ and prefers to operate in no-acknowledgment mode, it should report that to GDB by including ‘QStartNoAckMode+’ in its response to ‘qSupported’; see [qSupported](https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#qSupported). If GDB also supports ‘QStartNoAckMode’ and it has not been disabled via the set remote noack-packet off command (see [Remote Configuration](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Configuration.html#Remote-Configuration)), GDB may then send a ‘QStartNoAckMode’ packet to the stub. Only then may the stub actually turn off packet acknowledgments. GDB sends a final ‘+’ acknowledgment of the stub’s ‘OK’ response, which can be safely ignored by the stub.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVU2P4zYM_TXKhYjhyPmwDzlMJpvFotvubqeXHmWJjtXIoivJE-TfF5KdjxlstyhaIEgci-IjHx9J4b0-WsQtW-3Yaj8TQ2jJbb-So-ffyc5qUpftb632oL0fEFrhga12kjqEoWerPeNlG0LvWfHE-IHxw1GHdqgzSR3jhw4N2f3LHLvh_o_xQz8Yw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