aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-07-28 18:04:32 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-09-01 16:47:42 -0700
commit9088360ce54ab0fbee7a0f5af4ecdfa125365e34 (patch)
treeab16bfc5a1250390417e63b95c5fe59dbb58a03f
parentcbec413578b37cb862ae9fa81c6fa4a5b9e2ee71 (diff)
downloadfsf-binutils-gdb-9088360ce54ab0fbee7a0f5af4ecdfa125365e34.zip
fsf-binutils-gdb-9088360ce54ab0fbee7a0f5af4ecdfa125365e34.tar.gz
fsf-binutils-gdb-9088360ce54ab0fbee7a0f5af4ecdfa125365e34.tar.bz2
Morello: Add gdbarch_print_cap* methods.
-rw-r--r--gdb/aarch64-tdep.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index b47817c..faa61ff 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -5143,6 +5143,31 @@ aarch64_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val)
return (val & ~1);
}
+/* Print a capability. */
+
+static void
+morello_print_cap (struct gdbarch *gdbarch, const gdb_byte *contents, bool tag,
+ bool compact, struct ui_file *stream)
+{
+ uint128_t dummy_cap;
+ memcpy (&dummy_cap, contents, sizeof(dummy_cap));
+ capability cap (dummy_cap, tag);
+ fprintf_filtered (stream, "%s ",
+ cap.to_str (compact).c_str ());
+}
+
+/* Print attributes of a capability. */
+
+static void
+morello_print_cap_attributes (struct gdbarch *gdbarch, const gdb_byte *contents,
+ bool tag, struct ui_file *stream)
+{
+ uint128_t dummy_cap;
+ memcpy (&dummy_cap, contents, sizeof(dummy_cap));
+ capability cap (dummy_cap, tag);
+ fprintf_filtered (stream, "%s", cap.metadata_str ().c_str ());
+}
+
/* Given ABFD, try to determine if we are dealing with a symbol file
that uses capabilities.
@@ -5663,6 +5688,10 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_address_to_pointer (gdbarch, aarch64_address_to_pointer);
set_gdbarch_integer_to_address (gdbarch, aarch64_integer_to_address);
+ /* Printing capabilities. */
+ set_gdbarch_print_cap (gdbarch, morello_print_cap);
+ set_gdbarch_print_cap_attributes (gdbarch, morello_print_cap_attributes);
+
/* For marking special symbols indicating a C64 region. */
set_gdbarch_elf_make_msymbol_special (gdbarch,
aarch64_elf_make_msymbol_special);