#include "elf/common.h"
+#include "gdbsupport/capability.h"
+
/* Signal frame handling.
+------------+ ^
CORE_ADDR addr = parse_and_eval_address (args);
cap = target_read_capability (addr);
+ if (cap.empty ())
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "Could not read capability from address %s.\n",
+ phex_nz (addr, 8));
+ return;
+ }
+
for (auto it : cap)
fprintf_unfiltered (gdb_stdlog, "%02x ", it);
+ fputs_unfiltered ("\n", gdb_stdlog);
+
+ bool tag = (cap[0] == 1);
+ uint128_t cap_128bits;
+ memcpy (&cap_128bits, &cap[1], 16);
+ capability capability (cap_128bits, tag);
+
+ fprintf_unfiltered (gdb_stdlog, "verbose: %s\n",
+ capability.to_str (false).c_str ());
fputs_unfiltered ("\n", gdb_stdlog);
+ fprintf_unfiltered (gdb_stdlog, "compact: %s\n",
+ capability.to_str (true).c_str ());
}
/* Implement the maintenance set capability in memory command. */
if (tdep->has_capability ())
{
+ /* Register CHERI-specific linkmap offsets for the AAPCS64_CAP ABI. */
+ if (tdep->abi == AARCH64_ABI_AAPCS64_CAP)
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ svr4_lp64_cheri_fetch_link_map_offsets);
+
/* Initialize the register numbers for the core file register set.
Please note the PCC/CSP position in GDB's target description is
the inverse of the position in the Linux Kernel's user_morello_state