Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado <lgustavo@codesourcery.com>
To: Orgad Shaneh <orgads@gmail.com>, <gdb-patches@sourceware.org>
Subject: Re: PR13984 - gdb stops controlling a thread after "Remote 'g' packet reply is too long: ..." error message
Date: Mon, 11 Apr 2016 21:19:00 -0000	[thread overview]
Message-ID: <570C14D4.3030600@codesourcery.com> (raw)
In-Reply-To: <CAGHpTBJLq0RhLo=tTP_BmDzNAaVFCHebBvoom21x-ETT9t4ZQw@mail.gmail.com>

Hi,

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.
>
>
> 0001-PR13984-gdb-stops-controlling-a-thread.patch
>
>
>  From 03ab95933b85dd85c2f4fa5797017e6cee0c8466 Mon Sep 17 00:00:00 2001
> From: Orgad Shaneh<orgad.shaneh@audiocodes.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
>
> PR13984:
>      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.


  reply	other threads:[~2016-04-11 21:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-10 14:49 Orgad Shaneh
2016-04-11 21:19 ` Luis Machado [this message]
2016-04-12  5:16   ` Orgad Shaneh
2016-04-12 13:37     ` Luis Machado
2016-04-13  5:43       ` Orgad Shaneh
2016-04-13 19:11         ` Luis Machado
2016-04-13 20:07           ` Orgad Shaneh
2016-04-13 20:27             ` Pedro Alves
2016-04-13 20:52               ` Orgad Shaneh
2016-04-13 21:57                 ` Pedro Alves
2016-04-14  8:33                   ` Orgad Shaneh
2016-04-14  9:07                     ` Orgad Shaneh
2016-04-14  9:22                       ` Pedro Alves
2016-04-14  9:39                         ` Orgad Shaneh
2016-04-14  9:47                           ` Pedro Alves
2016-04-14 21:21                   ` Maciej W. Rozycki

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=570C14D4.3030600@codesourcery.com \
    --to=lgustavo@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=orgads@gmail.com \
    /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