diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2014-12-12 14:14:21 +0100 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-12-12 14:15:07 +0100 |
commit | e5a9158d093d53f2bb1057359ac381dcdf6d4305 (patch) | |
tree | 5183ee3d2f2eb16faab802dcf01b660841a0e53f | |
parent | feea5f36a9dd65a0ff279c71744423c419b77ada (diff) | |
download | gdb-e5a9158d093d53f2bb1057359ac381dcdf6d4305.zip gdb-e5a9158d093d53f2bb1057359ac381dcdf6d4305.tar.gz gdb-e5a9158d093d53f2bb1057359ac381dcdf6d4305.tar.bz2 |
S390: Fix gdbserver support for TDB
This makes gdbserver actually provide values for the TDB registers
when the inferior was stopped in a transaction. The change in
linux-low.c is needed to suppress the warning for an unavailable TDB.
The test case 's390-tdbregs.exp' passes with this patch and fails
without.
gdb/gdbserver/ChangeLog:
* linux-low.c (regsets_fetch_inferior_registers): Suppress the
warning upon ENODATA from ptrace.
* linux-s390-low.c (s390_store_tdb): New.
(s390_regsets): Add regset for NT_S390_TDB.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 6 | ||||
-rw-r--r-- | gdb/gdbserver/linux-s390-low.c | 17 |
3 files changed, 30 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 7818793..e65cdbd 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,12 @@ 2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com> + * linux-low.c (regsets_fetch_inferior_registers): Suppress the + warning upon ENODATA from ptrace. + * linux-s390-low.c (s390_store_tdb): New. + (s390_regsets): Add regset for NT_S390_TDB. + +2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com> + * linux-low.c (regsets_store_inferior_registers): Skip regsets without a fill_function. * linux-s390-low.c (s390_fill_last_break): Remove. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 5f62010..5ea9200 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4256,6 +4256,12 @@ regsets_fetch_inferior_registers (struct regsets_info *regsets_info, this process mode. */ disable_regset (regsets_info, regset); } + else if (errno == ENODATA) + { + /* ENODATA may be returned if the regset is currently + not "active". This can happen in normal operation, + so suppress the warning in this case. */ + } else { char s[256]; diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c index 9f77f30..40fb61c 100644 --- a/gdb/gdbserver/linux-s390-low.c +++ b/gdb/gdbserver/linux-s390-low.c @@ -310,6 +310,20 @@ s390_store_system_call (struct regcache *regcache, const void *buf) supply_register_by_name (regcache, "system_call", buf); } +static void +s390_store_tdb (struct regcache *regcache, const void *buf) +{ + int tdb0 = find_regno (regcache->tdesc, "tdb0"); + int tr0 = find_regno (regcache->tdesc, "tr0"); + int i; + + for (i = 0; i < 4; i++) + supply_register (regcache, tdb0 + i, (const char *) buf + 8 * i); + + for (i = 0; i < 16; i++) + supply_register (regcache, tr0 + i, (const char *) buf + 8 * (16 + i)); +} + static struct regset_info s390_regsets[] = { { 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL }, /* Last break address is read-only; no fill function. */ @@ -317,6 +331,9 @@ static struct regset_info s390_regsets[] = { NULL, s390_store_last_break }, { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_SYSTEM_CALL, 0, EXTENDED_REGS, s390_fill_system_call, s390_store_system_call }, + /* TDB is read-only. */ + { PTRACE_GETREGSET, -1, NT_S390_TDB, 0, EXTENDED_REGS, + NULL, s390_store_tdb }, { 0, 0, 0, -1, -1, NULL, NULL } }; |