[lldb-dev] Support for Error Strings in remote protocol

Pavel Labath via lldb-dev lldb-dev at lists.llvm.org
Wed Jun 21 09:40:46 PDT 2017


+1 one from me. I like the idea a lot. Specific details below.

On 21 June 2017 at 16:31, Ravitheja Addepally via lldb-dev
<lldb-dev at lists.llvm.org> wrote:
> Hello all,
>        Currently the remote protocol in LLDB does not allow sending Error
> Strings in response to remote packets, it only allows for "ENN" format where
> N is a hex integer. In our current ongoing work, we would like to have
> support for Sending Error Strings from lldb-server. I would like to invite
> any opinions or suggestions in this matter ?
>
> A very simple proposal would be to just attach an error string maybe as a
> Name:Value Pair ? like so ->
>
> EXX;"Error String"
>  or
> EXX;M"Error String"

I guess the decision here depends on how forward-compatible we want to
be. If we don't anticipate adding further fields here, then the format
can just be
EXX;message
and no quoting is needed. If we want to add more fields in the future
(I don't really see what could they be though), then we should stick
to the standard semi-colon delimited list  format. So, something like:
EXX;message:<message>
But then we need to decide how to encode <message>. I guess the most
"standard" approach would be to hex-encode it, although it will make
them hard to read manually.

>
> I guess removing EXX would make it incompatible with gdb-server. Also adding
> new packets to query errors might not be desired ?
I think we should keep the numeric codes. Sometimes it may be useful
to programmatically switch on them, and that's hard to do with a
string only. For compatibility's sake, I'd only send the error
messages if the client explicitly enables it via some packet.

pl


More information about the lldb-dev mailing list