This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/3] Fix "Remote 'g' packet reply is too long" problems with multiple inferiors


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]