aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-05-11 10:41:00 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-05-11 10:41:44 -0700
commit3d875af5759b6ac3d0a722ce8b598426c26bf46c (patch)
treee6b4854b0b9096e36a71a5caa05aec83f84757a4
parentbf64a9511f73684c4880fd1818928fdfa1725c4f (diff)
downloadgdb-3d875af5759b6ac3d0a722ce8b598426c26bf46c.zip
gdb-3d875af5759b6ac3d0a722ce8b598426c26bf46c.tar.gz
gdb-3d875af5759b6ac3d0a722ce8b598426c26bf46c.tar.bz2
Add init_dwarf_regnames_iamcu
* dwarf.c (dwarf_regnames_iamcu): New. (init_dwarf_regnames_iamcu): Likewise. (init_dwarf_regnames): Call init_dwarf_regnames_iamcu for EM_IAMCU. * dwarf.h (init_dwarf_regnames_iamcu): New. * objdump.c (dump_dwarf): Call init_dwarf_regnames_iamcu for bfd_arch_iamcu.
-rw-r--r--binutils/ChangeLog9
-rw-r--r--binutils/dwarf.c33
-rw-r--r--binutils/dwarf.h1
-rw-r--r--binutils/objdump.c4
4 files changed, 46 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 70b9aae..45c0bfd 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,14 @@
2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
+ * dwarf.c (dwarf_regnames_iamcu): New.
+ (init_dwarf_regnames_iamcu): Likewise.
+ (init_dwarf_regnames): Call init_dwarf_regnames_iamcu for EM_IAMCU.
+ * dwarf.h (init_dwarf_regnames_iamcu): New.
+ * objdump.c (dump_dwarf): Call init_dwarf_regnames_iamcu for
+ bfd_arch_iamcu.
+
+2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
+
* elfedit.c (enum elfclass): New.
(input_elf_class): Change type to enum elfclass.
(output_elf_class): New.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 5f773bb..96d959a 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5338,6 +5338,27 @@ static const char *const dwarf_regnames_i386[] =
"k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7" /* 93 - 100 */
};
+static const char *const dwarf_regnames_iamcu[] =
+{
+ "eax", "ecx", "edx", "ebx", /* 0 - 3 */
+ "esp", "ebp", "esi", "edi", /* 4 - 7 */
+ "eip", "eflags", NULL, /* 8 - 10 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 11 - 18 */
+ NULL, NULL, /* 19 - 20 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 21 - 28 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 29 - 36 */
+ NULL, NULL, NULL, /* 37 - 39 */
+ "es", "cs", "ss", "ds", "fs", "gs", NULL, NULL, /* 40 - 47 */
+ "tr", "ldtr", /* 48 - 49 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 50 - 57 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 58 - 65 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 66 - 73 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 74 - 81 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 82 - 89 */
+ NULL, NULL, NULL, /* 90 - 92 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL /* 93 - 100 */
+};
+
void
init_dwarf_regnames_i386 (void)
{
@@ -5345,6 +5366,13 @@ init_dwarf_regnames_i386 (void)
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_i386);
}
+void
+init_dwarf_regnames_iamcu (void)
+{
+ dwarf_regnames = dwarf_regnames_iamcu;
+ dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_iamcu);
+}
+
static const char *const dwarf_regnames_x86_64[] =
{
"rax", "rdx", "rcx", "rbx",
@@ -5413,10 +5441,13 @@ init_dwarf_regnames (unsigned int e_machine)
switch (e_machine)
{
case EM_386:
- case EM_IAMCU:
init_dwarf_regnames_i386 ();
break;
+ case EM_IAMCU:
+ init_dwarf_regnames_iamcu ();
+ break;
+
case EM_X86_64:
case EM_L1OM:
case EM_K1OM:
diff --git a/binutils/dwarf.h b/binutils/dwarf.h
index 45f9927..0e661d4 100644
--- a/binutils/dwarf.h
+++ b/binutils/dwarf.h
@@ -196,6 +196,7 @@ extern int dwarf_check;
extern void init_dwarf_regnames (unsigned int);
extern void init_dwarf_regnames_i386 (void);
+extern void init_dwarf_regnames_iamcu (void);
extern void init_dwarf_regnames_x86_64 (void);
extern void init_dwarf_regnames_aarch64 (void);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index f690293..f87c9c3 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -2449,6 +2449,10 @@ dump_dwarf (bfd *abfd)
}
break;
+ case bfd_arch_iamcu:
+ init_dwarf_regnames_iamcu ();
+ break;
+
case bfd_arch_aarch64:
init_dwarf_regnames_aarch64();
break;