]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdbserver/ChangeLog
S390: Enable re-attaching with native-extended-gdbserver
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 21 Mar 2018 16:41:44 +0000 (17:41 +0100)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 21 Mar 2018 16:41:44 +0000 (17:41 +0100)
commit7edb9bd32ba23247a509cbe9d44ccb02da97b66e
treee30515417f5f3da3e43b4a580e87e5d3b996daee
parent0ccf57bd817a73e7d7cef714039f1302fa5298ec
S390: Enable re-attaching with native-extended-gdbserver

On s390x, when running attach.exp with native-extended-gdbserver,
gdbserver crashes in find_regno like this:

  .../regcache.c:252: A problem internal to GDBserver has been detected.
  Unknown register tdb0 requested

On the GDB side it looks like this:

  (gdb) attach 31568
  Attaching to process 31568
  Remote connection closed

The test case attempts to attach to a new process via the already running
gdbserver.  Thus s390_arch_setup is called a second time, and that's where
the problem occurs.  In order to determine the word width (32 or 64 bits),
s390_arch_setup reads the pswm register through the regcache.  For that it
uses a temporary tdesc which is supposed to work for all s390 targets,
since the actual tdesc has not been determined yet.  But in this second
round this doesn't work, because s390_regsets has been updated already and
now contains regsets not described by the temporary tdesc, such as the one
containing tdb0.

This is fixed by rearranging the logic in s390_arch_setup.

gdb/gdbserver/ChangeLog:

* linux-s390-low.c (s390_get_hwcap): Replace tdesc parameter by
the word size.  Add comment.
(s390_get_wordsize): New function.
(s390_arch_setup): No longer select a temporary tdesc to fetch the
pswm with it.  Instead, use s390_get_wordsize to determine the
word size first and derive the correct tdesc from that directly.
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-s390-low.c