]> 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)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 22:57:21 +0000 (15:57 -0700)
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/aarch64-linux-nat.c
gdbserver/linux-aarch64-low.cc

index 189f31702518c31fc41bebd878ed3a169421af7d..7f10ea2f090137c69cee68b6e55356dbfa5cae50 100644 (file)
@@ -573,7 +573,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.  */
@@ -1007,7 +1008,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 9c90f61a6d6945d992450ffba935b183e0db493d..0213fce70228b8e23bde7dfef57a84b798e7d3a7 100644 (file)
@@ -3451,7 +3451,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;
        }
     }