[Lldb-commits] [lldb] [lldb] Add support for gdb-style 'x' packet (PR #124733)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 28 14:50:43 PST 2025


jasonmolenda wrote:

For lldb-server/debugserver, we might want to distinguish if the connecting lldb is old-lldb (only knows the lldb x) or new-lldb (knows lldb x and gdb x).  I think in `GDBRemoteCommunicationClient::GetRemoteQSupported` lldb should add `binary-upload+` to the `features` list it sends to debugserver/lldb-server, and lldb-server/debugserver should reply with `binary-upload+` in its response.  Then lldb-server/debugserver knows to send a gdb-style x, and lldb knows to expect that response.

For right now, lldb-server and debugserver will default to lldb-x behavior, unless it was requested (`binary-upload+`) to use gdb-x behavior.  We will switch that default behavior after a short while, when we are comfortable that old-lldb's will not be connecting to current-debugserver/lldb-servers.

When lldb is sniffing the capability of the remote stub, `x0,0 -> OK` means lldb-x unambiguously.  `x0,0 -> b` and `x0,0 -> Exx` are gdb-x unambiguously.  Any other response (e.g. empty-packet response, indicating an unknown packet) will make lldb fall back to using the asciihex `m` packet to read memory.

Does this seem like a good approach for compatibility?

https://github.com/llvm/llvm-project/pull/124733


More information about the lldb-commits mailing list