+2021-06-24 Luis Machado <luis.machado@arm.com>
+
+ * aarch64-linux-tdep.c: Include gdbsupport/capability.h.
+ (maint_print_cap_from_addr_cmd): Print more information.
+
2021-06-24 Luis Machado <luis.machado@arm.com>
* aarch64-tdep.c: Include elf/aarch64.h.
#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. */