This is the mail archive of the
mailing list for the GDB project.
Re: PR13984 - gdb stops controlling a thread after "Remote 'g' packet reply is too long: ..." error message
- From: Orgad Shaneh <orgads at gmail dot com>
- To: Luis Machado <lgustavo at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 12 Apr 2016 08:16:19 +0300
- Subject: Re: PR13984 - gdb stops controlling a thread after "Remote 'g' packet reply is too long: ..." error message
- Authentication-results: sourceware.org; auth=none
- References: <CAGHpTBJLq0RhLo=tTP_BmDzNAaVFCHebBvoom21x-ETT9t4ZQw at mail dot gmail dot com> <570C14D4 dot 3030600 at codesourcery dot com>
On Tue, Apr 12, 2016 at 12:19 AM, Luis Machado
> On 04/10/2016 09:49 AM, Orgad Shaneh wrote:
>> Please review the attached patch. It was inspired by the patch
>> attached to the bug report.
> Usually, when you receive that message from GDB it because your target
> reported an incorrect register set as a 'g' reply.
> The correct solution is to fix your remote target to reply the proper
> register set.
> From the description, it sounds like QEMU needs to be adjusted.
Thanks for your reply.
I don't use QEMU. I did not describe my use case in the bug report,
did just now.
I got this message when I tried to remotely debug a
mips64-octeon-linux gdbserver 6.8 with GDB >= 7.5.
GDB <= 7.4.1 works well, but with 7.5 and up I receive this message
and the debugger stops functioning.
The proposed patch fixes this issue for me.
Using a newer gdbserver (Cavium SDK3 comes with 7.6) might also be a
solution, but we need to support the old one as well.
>> From 03ab95933b85dd85c2f4fa5797017e6cee0c8466 Mon Sep 17 00:00:00 2001
>> From: Orgad Shaneh<email@example.com>
>> Date: Sun, 10 Apr 2016 17:39:24 +0300
>> Subject: [PATCH] PR13984, gdb stops controlling a thread...
>> ... after "Remote 'g' packet reply is too long: ..." error message
>> remote.c: Handle long g packets instead of failing
>> gdb/remote.c | 6 +-----
>> 1 file changed, 1 insertion(+), 5 deletions(-)
>> diff --git a/gdb/remote.c b/gdb/remote.c
>> index 5c407b6..e8951dc 100644
>> --- a/gdb/remote.c
>> +++ b/gdb/remote.c
>> @@ -7188,10 +7188,6 @@ process_g_packet (struct regcache *regcache)
>> buf_len = strlen (rs->buf);
>> - /* Further sanity checks, with knowledge of the architecture. */
>> - if (buf_len > 2 * rsa->sizeof_g_packet)
>> - error (_("Remote 'g' packet reply is too long: %s"), rs->buf);
> This is a serious error. If GDB fetches a bogus register set reply, it will
> most definitely do the wrong thing after this.
Possibly, but doing "something wrong" is likely to be better than just
quitting. Maybe we should leave the warning, but still correct the