public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/3] Fix "Remote 'g' packet reply is too long" problems with multiple inferiors
Date: Mon, 02 Oct 2017 15:15:00 -0000	[thread overview]
Message-ID: <1506957311-30028-1-git-send-email-palves@redhat.com> (raw)

This series fixes some problems I uncovered while working on my
multi-target branch [1].

Namely when debugging two inferiors (or more) against gdbserver, and
the inferiors have different architectures, such as e.g., on x86_64
GNU/Linux and one inferior is 64-bit while the other is 32-bit, then
GDB can get confused with the different architectures in a couple
spots, resulting in instances of the infamous "Remote 'g' packet reply
is too long" error.  For example, with the test added in patch #3, we
get:

~~~
  Continuing.
  Remote 'g' packet reply is too long (expected 440 bytes, got 816 bytes): ad064000000000000[snip]
  (gdb) FAIL: gdb.multi/multi-arch.exp: inf1 event with inf2 selected: continue to hello_loop

  c
  Continuing.
  Truncated register 50 in remote 'g' packet
  (gdb) PASS: gdb.multi/multi-arch.exp: inf2 event with inf1 selected: c
~~~

The fix I was aiming for is in patch #3.  The other two patches
preemptively fix problems that patch #3 alone would cause.  They're
sorted this way to avoid introducing temporary regressions.

[1] - https://github.com/palves/gdb/tree/palves/multi-target

Pedro Alves (3):
  Redesign mock environment for gdbarch selftests
  Reimplement support for "maint print registers" with no running
    inferior yet
  Fix "Remote 'g' packet reply is too long" problems with multiple
    inferiors

 gdb/frame.c                            |  17 ------
 gdb/frame.h                            |   8 ---
 gdb/gdbarch-selftests.c                | 105 +++++++++++++++++++++++++++------
 gdb/progspace.c                        |  12 ----
 gdb/progspace.h                        |  11 ++++
 gdb/regcache.c                         |  33 ++++++-----
 gdb/regcache.h                         |  10 ----
 gdb/remote.c                           |  92 +++++++++++++++++++++--------
 gdb/target.c                           |  14 ++---
 gdb/target.h                           |  10 ++++
 gdb/testsuite/gdb.multi/hangout.c      |  14 +++++
 gdb/testsuite/gdb.multi/hello.c        |  15 ++++-
 gdb/testsuite/gdb.multi/multi-arch.exp |  24 ++++++++
 13 files changed, 250 insertions(+), 115 deletions(-)

-- 
2.5.5

             reply	other threads:[~2017-10-02 15:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 15:15 Pedro Alves [this message]
2017-10-02 15:15 ` [PATCH 3/3] " Pedro Alves
2017-10-03 11:36   ` Yao Qi
2017-10-03 11:40   ` Yao Qi
2017-10-03 12:21     ` Pedro Alves
2017-10-03 14:02       ` Pedro Alves
2017-10-04 10:21         ` Yao Qi
2017-10-04 17:38           ` Pedro Alves
2017-10-05 16:50   ` Ulrich Weigand
2017-10-05 17:08     ` Pedro Alves
2017-12-12 21:33   ` Maciej W. Rozycki
2017-12-13  0:45     ` Pedro Alves
2017-12-13 11:31       ` Maciej W. Rozycki
2017-10-02 15:15 ` [PATCH 1/3] Redesign mock environment for gdbarch selftests Pedro Alves
2017-10-03 11:06   ` Yao Qi
2017-10-03 12:05     ` Pedro Alves
2017-10-04 10:39       ` Yao Qi
2017-10-02 15:15 ` [PATCH 2/3] Reimplement support for "maint print registers" with no running inferior yet Pedro Alves
2017-10-03 11:17   ` 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=1506957311-30028-1-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).