This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/2] aarch64: Decode dwarf2 register numbers
- From: Richard Henderson <rth at twiddle dot net>
- To: binutils at sourceware dot org
- Date: Wed, 6 Aug 2014 17:11:13 -0700
- Subject: [PATCH 2/2] aarch64: Decode dwarf2 register numbers
- Authentication-results: sourceware.org; auth=none
- References: <1407370273-3580-1-git-send-email-rth at twiddle dot net>
Similar to the parsing side in gas. But here I'm less
certain about only printing dN, since these are also used
for uses within .debug_info which could rightly use vN.
---
binutils/dwarf.c | 27 +++++++++++++++++++++++++++
binutils/dwarf.h | 1 +
binutils/objdump.c | 4 ++++
3 files changed, 32 insertions(+)
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index a6986ad..fc44f38 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5093,6 +5093,29 @@ init_dwarf_regnames_x86_64 (void)
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
}
+static const char *const dwarf_regnames_aarch64[] =
+{
+ "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
+ "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15",
+ "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23",
+ "x24", "x25", "x26", "x27", "x28", "x29", "x30", "sp",
+ NULL, "elr", NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+ "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
+ "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23",
+ "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31",
+};
+
+void
+init_dwarf_regnames_aarch64 (void)
+{
+ dwarf_regnames = dwarf_regnames_aarch64;
+ dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_aarch64);
+}
+
void
init_dwarf_regnames (unsigned int e_machine)
{
@@ -5109,6 +5132,10 @@ init_dwarf_regnames (unsigned int e_machine)
init_dwarf_regnames_x86_64 ();
break;
+ case EM_AARCH64:
+ init_dwarf_regnames_aarch64 ();
+ break;
+
default:
break;
}
diff --git a/binutils/dwarf.h b/binutils/dwarf.h
index db235a9..124d9d6 100644
--- a/binutils/dwarf.h
+++ b/binutils/dwarf.h
@@ -235,6 +235,7 @@ extern int dwarf_check;
extern void init_dwarf_regnames (unsigned int);
extern void init_dwarf_regnames_i386 (void);
extern void init_dwarf_regnames_x86_64 (void);
+extern void init_dwarf_regnames_aarch64 (void);
extern int load_debug_section (enum dwarf_section_display_enum, void *);
extern void free_debug_section (enum dwarf_section_display_enum);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 5086a15..413de56 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -2407,6 +2407,10 @@ dump_dwarf (bfd *abfd)
}
break;
+ case bfd_arch_aarch64:
+ init_dwarf_regnames_aarch64();
+ break;
+
default:
break;
}
--
1.8.3.1