]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Print additional information on capability store errors
authorLuis Machado <luis.machado@linaro.org>
Mon, 14 Jun 2021 17:19:35 +0000 (14:19 -0300)
committerLuis Machado <luis.machado@linaro.org>
Thu, 24 Jun 2021 13:39:57 +0000 (10:39 -0300)
Augment the warnings about not being able to write to capability registers
or write capabilities to memory. Show the command that needs to be entered
in the shell to enable this particular mode.

gdb/ChangeLog:

2021-06-24  Luis Machado  <luis.machado@arm.com>

* aarch64-linux-nat.c (store_cregs_to_thread)
(aarch64_linux_nat_target::write_capability): Update error message.

gdbserver/ChangeLog:

2021-06-24  Luis Machado  <luis.machado@arm.com>

* linux-aarch64-low.cc (aarch64_target::qxfer_capability): Update
error message.

gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc

index 0ad646af6510e961b5796073833b6fa85fee4cc9..83fc588805316a769bb40a3f04c4007f5731e123 100644 (file)
@@ -1,3 +1,8 @@
+2021-06-24  Luis Machado  <luis.machado@arm.com>
+
+       * aarch64-linux-nat.c (store_cregs_to_thread)
+       (aarch64_linux_nat_target::write_capability): Update error message.
+
 2021-05-24  Luis Machado  <luis.machado@arm.com>
 
        * aarch64-linux-tdep.c (aarch64_linux_cregmap): Update to match
index 4b74c423f5d092de5006dce1de297a8d75259270..70263da9259dcd90cf7f67c094cd3d507da2ffa1 100644 (file)
@@ -546,7 +546,8 @@ store_cregs_to_thread (const struct regcache *regcache)
   regcache->raw_collect (regno++, &cregset.cctlr);
 
   if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_MORELLO, &iovec) < 0)
-    perror_with_name (_("Unable to store capability registers."));
+    perror_with_name (_("Unable to store capability registers.\n"
+                       "Please run \"sysctl cheri.ptrace_forge_cap=1\"."));
 }
 
 /* Implement the "fetch_registers" target_ops method.  */
@@ -1123,7 +1124,8 @@ aarch64_linux_nat_target::write_capability (CORE_ADDR addr,
   memcpy (&cap.val, buffer.data () + 1, 16);
 
   if (!aarch64_linux_write_capability (tid, addr, cap))
-    perror_with_name (_("Unable to write capability from address."));
+    perror_with_name (_("Unable to write capability to address.\n"
+                       "Please run \"sysctl cheri.ptrace_forge_cap=1\"."));
 
   return true;
 }
index a56de0f53775fcf85f2aa8aaad702f7fc99b86f2..c9b2bec8979f32030f65f70824e75aed1ae665c3 100644 (file)
@@ -1,3 +1,8 @@
+2021-06-24  Luis Machado  <luis.machado@arm.com>
+
+       * linux-aarch64-low.cc (aarch64_target::qxfer_capability): Update
+       error message.
+
 2021-03-17  Luis Machado  <luis.machado@arm.com>
 
        * linux-aarch64-low.cc (aarch64_target::qxfer_capability): Handle
index d0eaff553ae34c6f36834b8dc1fa7e669accc019..ce3fee522ce5f745809458a0081915dc4953e8a0 100644 (file)
@@ -3289,7 +3289,8 @@ aarch64_target::qxfer_capability (const CORE_ADDR address,
 
       if (!aarch64_linux_write_capability (tid, address, cap))
        {
-         warning (_("Unable to write capability to address."));
+         warning (_("Unable to write capability to address.\n"
+                    "Please run \"sysctl cheri.ptrace_forge_cap=1\"."));
          return 0;
        }
     }