gdbserver: make linux target op 'cannot_store_register' a predicate function
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:22 +0000 (15:11 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:22 +0000 (15:11 +0200)
The comment for the linux target op 'cannot_store_register' states the
following:

  /* Returns 0 if we can store the register, 1 if we can not
     store the register, and 2 if failure to store the register
     is acceptable.  */

There is only one low target, linux-ppc-low, that potentially returns
2.  There are two places that call the 'cannot_store_register' target
op in linux-low.cc.  None of these locations distinguish a '2' from a
'1'.  Hence, to simplify the definition, make the function a predicate
that returns either 0 or 1.  This is also consistent with the
companion function, 'cannot_fetch_register'.

gdbserver/ChangeLog:
2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

* linux-low.h (struct linux_target_ops): Update the comment for
'cannot_store_register' to return 0 or 1.
* linux-ppc-low.cc (ppc_cannot_store_register): Return 1 instead
of 2.

gdbserver/ChangeLog
gdbserver/linux-low.h
gdbserver/linux-ppc-low.cc

index 37e38611d5dfa9bbfce500ace08d62585673aa99..b523f982cbf22be74b720830df13a22b17dd18d6 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       * linux-low.h (struct linux_target_ops): Update the comment for
+       'cannot_store_register' to return 0 or 1.
+       * linux-ppc-low.cc (ppc_cannot_store_register): Return 1 instead
+       of 2.
+
 2020-03-20  Simon Marchi  <simon.marchi@efficios.com>
 
        * config.in: Re-generate.
index b69ade98e41db7eea7d8d396b1496c736a03e636..aaf882b8c5bef87b5402d48b45931d9dcad7bbf8 100644 (file)
@@ -135,11 +135,10 @@ struct linux_target_ops
   void (*arch_setup) (void);
 
   const struct regs_info *(*regs_info) (void);
-  int (*cannot_fetch_register) (int);
 
-  /* Returns 0 if we can store the register, 1 if we can not
-     store the register, and 2 if failure to store the register
-     is acceptable.  */
+  /* Return 0 if we can fetch/store the register, 1 if we cannot
+     fetch/store the register.  */
+  int (*cannot_fetch_register) (int);
   int (*cannot_store_register) (int);
 
   /* Hook to fetch a register in some non-standard way.  Used for
index fd6d0369c48f688f56ddff13378ab88460529177..f3837e4796048e86965518dbe5de4f1643db4fb4 100644 (file)
@@ -152,13 +152,13 @@ ppc_cannot_store_register (int regno)
   /* Some kernels do not allow us to store fpscr.  */
   if (!(ppc_hwcap & PPC_FEATURE_HAS_SPE)
       && regno == find_regno (tdesc, "fpscr"))
-    return 2;
+    return 1;
 #endif
 
   /* Some kernels do not allow us to store orig_r3 or trap.  */
   if (regno == find_regno (tdesc, "orig_r3")
       || regno == find_regno (tdesc, "trap"))
-    return 2;
+    return 1;
 
   return 0;
 }
This page took 0.034741 seconds and 4 git commands to generate.