S390: gdbserver: Don't write guarded storage registers
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 21 Mar 2018 16:41:45 +0000 (17:41 +0100)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 21 Mar 2018 16:41:45 +0000 (17:41 +0100)
On S390, the guarded storage register set is only valid if guarded storage
is active.  Reading/writing the register set yields errors if this is not
the case.  Then gdbserver emits warnings like these:

  Warning: ptrace(regsets_store_inferior_registers): No data available

Apart from confusing the user, this can also lead to test case failures
due to unexpected output.  To suppress this, make the guarded storage
regsets read-only for now.

gdb/gdbserver/ChangeLog:

* linux-s390-low.c (s390_fill_gs): Remove function.
(s390_fill_gsbc): Remove function.
(s390_regsets): Set fill functions for the guarded storage regsets
to NULL.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-s390-low.c

index 958a6dd0eaa0ec86b8793571c807c91db1837675..e63d89fb91b6f4d0c641bcb3a385f1aabf75069d 100644 (file)
@@ -1,3 +1,10 @@
+2018-03-21  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * linux-s390-low.c (s390_fill_gs): Remove function.
+       (s390_fill_gsbc): Remove function.
+       (s390_regsets): Set fill functions for the guarded storage regsets
+       to NULL.
+
 2018-03-21  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * linux-s390-low.c (s390_get_hwcap): Replace tdesc parameter by
index 203accdaaa21049bcd591e1a267c0a5b42ffff39..7de70f3a3899ee29c8ec9452b3607d6dca655005 100644 (file)
@@ -374,16 +374,6 @@ s390_store_vxrs_high (struct regcache *regcache, const void *buf)
     supply_register (regcache, v16 + i, (const char *) buf + 16 * i);
 }
 
-static void
-s390_fill_gs (struct regcache *regcache, void *buf)
-{
-  int gsd = find_regno (regcache->tdesc, "gsd");
-  int i;
-
-  for (i = 0; i < 3; i++)
-    collect_register (regcache, gsd + i, (char *) buf + 8 * (i + 1));
-}
-
 static void
 s390_store_gs (struct regcache *regcache, const void *buf)
 {
@@ -394,16 +384,6 @@ s390_store_gs (struct regcache *regcache, const void *buf)
     supply_register (regcache, gsd + i, (const char *) buf + 8 * (i + 1));
 }
 
-static void
-s390_fill_gsbc (struct regcache *regcache, void *buf)
-{
-  int bc_gsd = find_regno (regcache->tdesc, "bc_gsd");
-  int i;
-
-  for (i = 0; i < 3; i++)
-    collect_register (regcache, bc_gsd + i, (char *) buf + 8 * (i + 1));
-}
-
 static void
 s390_store_gsbc (struct regcache *regcache, const void *buf)
 {
@@ -432,10 +412,11 @@ static struct regset_info s390_regsets[] = {
     EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low },
   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0,
     EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high },
-  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_CB, 0,
-    EXTENDED_REGS, s390_fill_gs, s390_store_gs },
-  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_BC, 0,
-    EXTENDED_REGS, s390_fill_gsbc, s390_store_gsbc },
+  /* Guarded storage registers are read-only.  */
+  { PTRACE_GETREGSET, -1, NT_S390_GS_CB, 0, EXTENDED_REGS,
+    NULL, s390_store_gs },
+  { PTRACE_GETREGSET, -1, NT_S390_GS_BC, 0, EXTENDED_REGS,
+    NULL, s390_store_gsbc },
   NULL_REGSET
 };
 
This page took 0.03516 seconds and 4 git commands to generate.