[lldb-dev] [RFC] Improving protocol-level compatibility between LLDB and GDB

Jason Molenda via lldb-dev lldb-dev at lists.llvm.org
Tue Apr 27 13:31:14 PDT 2021



> On Apr 27, 2021, at 4:56 AM, Pavel Labath <pavel at labath.sk> wrote:
> 
> I think that's fine, though possible changing the servers to just ignore the length fields, like you did above, might be even better, as then they will work fine regardless of which client they are talking to. They still should advertise their non-brokenness so that the client can form the right packet, but this will be just a formality to satisfy protocol purists (or pickier servers), and not make a functional difference.


Ah, good point.  Let me rework the debugserver patch and look at lldb-server.  I wrote lldb-platform to spec and hadn't even noticed at the time that it was expecting (and ignoring) base 16 here when lldb was using base 10.

The only possible wrinkle I can imagine is if someone took advantage of the argnum to specify a zero-length string argument.  Like they specify args 0, 1, 3, and expect the remote stub to pass an empty string as arg 2.  It's weird that the packet even includes argnum tbh, I can't think of any other reason why you would do it except this.  


J


More information about the lldb-dev mailing list