From: Stan Shebs <stanshebs@earthlink.net>
To: gdb-patches@sourceware.org
Subject: Re: [patch] Fix PR 13392 : check offset of JMP insn
Date: Tue, 06 Mar 2012 21:48:00 -0000 [thread overview]
Message-ID: <4F568602.8040005@earthlink.net> (raw)
In-Reply-To: <1331064879.2209.11.camel@soleil>
On 3/6/12 12:14 PM, Philippe Waroquiers wrote:
> On Tue, 2012-03-06 at 17:03 +0000, Pedro Alves wrote:
>> We should send an error back to GDB with "E." instead of printing something
>> to gdbserver's console, and leaving the user with a generic and
>> unhelful error. "4-byte" isn't strictly correct, as this is a signed
>> offset, and I think we can be a bit more clear. So we end up with:
>>
>> sprintf (err,
>> "E.Jump back from jump pad too far from tracepoint "
>> "(offset 0x%" PRIx64 "> int32).", loffset);
>>
>
> In the gdb protocol documentation, all error replies but one
> are described as E NN. Some of them specifies that NN are
> hex digits.
> The exception is the packet qTMinFTPILen:
> the error reply is described as only an E
> (this last sentence intentionnally not finished with a . :).
>
> Is there somewhere a description of what an E. packet is,
> and when this is allowed ?
>
It doesn't look like it's officially described in the manual. The
theory is that ENN dates nearly to the 4-bit era :-) and is pretty much
useless without an agreed-upon table of what the different NN values
mean. But since there are multiple generations of stubs out there that
might or might not have assigned their own meanings to NN, those are
pretty much off-limits now, and so E.<string> is a convenient way to
extend error returns without disrupting backward compatibility too
much. The string is uninterpreted, GDB should just report that an error
happened and print the string verbatim.
It's conceivable that one could do something with GDB that interprets
the error reply (whether NN or a string) and does something differently,
but in practice, if the target side is reporting errors, things are
going straight downhill and the user needs to decide what to do about
it. Also, if a particular result is common enough that GDB has code to
cope with it, then maybe it's just another element of the protocol, not
really an error. :-)
Stan
next prev parent reply other threads:[~2012-03-06 21:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 13:39 Yao Qi
2012-03-06 17:03 ` Pedro Alves
2012-03-06 20:15 ` Philippe Waroquiers
2012-03-06 21:48 ` Stan Shebs [this message]
2012-03-07 20:41 ` Documenting E. packet. (was Re: [patch] Fix PR 13392 : check offset of JMP insn) Philippe Waroquiers
2012-03-07 20:59 ` Pedro Alves
2012-03-07 21:21 ` Philippe Waroquiers
2012-03-07 8:25 ` [patch] Fix PR 13392 : check offset of JMP insn Yao Qi
2012-03-08 17:07 ` Pedro Alves
2012-03-09 3:51 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F568602.8040005@earthlink.net \
--to=stanshebs@earthlink.net \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox