mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 15:17:13 +08:00
* dwarf.c (init_dwarf_regnames_i386, init_dwarf_regnames_x86_64): New.
(init_dwarf_regnames): Use them. * dwarf.h: Declare them. * objdump.c (dump_dwarf): Use bfd_get_arch + bfd_get_mach to set up the regnames, rather than using elf_machine_code.
This commit is contained in:
@ -1,4 +1,12 @@
|
|||||||
2010-08-23 Richard Henderson <rth@redhat.com>
|
2010-09-02 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
* dwarf.c (init_dwarf_regnames_i386, init_dwarf_regnames_x86_64): New.
|
||||||
|
(init_dwarf_regnames): Use them.
|
||||||
|
* dwarf.h: Declare them.
|
||||||
|
* objdump.c (dump_dwarf): Use bfd_get_arch + bfd_get_mach to set up
|
||||||
|
the regnames, rather than using elf_machine_code.
|
||||||
|
|
||||||
|
2010-09-02 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* objdump.c (dump_dwarf): Use bfd_arch_bits_per_address.
|
* objdump.c (dump_dwarf): Use bfd_arch_bits_per_address.
|
||||||
|
|
||||||
|
@ -3961,6 +3961,13 @@ static const char *const dwarf_regnames_i386[] =
|
|||||||
"tr", "ldtr"
|
"tr", "ldtr"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
init_dwarf_regnames_i386 (void)
|
||||||
|
{
|
||||||
|
dwarf_regnames = dwarf_regnames_i386;
|
||||||
|
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_i386);
|
||||||
|
}
|
||||||
|
|
||||||
static const char *const dwarf_regnames_x86_64[] =
|
static const char *const dwarf_regnames_x86_64[] =
|
||||||
{
|
{
|
||||||
"rax", "rdx", "rcx", "rbx",
|
"rax", "rdx", "rcx", "rbx",
|
||||||
@ -3983,6 +3990,13 @@ static const char *const dwarf_regnames_x86_64[] =
|
|||||||
"mxcsr", "fcw", "fsw"
|
"mxcsr", "fcw", "fsw"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
init_dwarf_regnames_x86_64 (void)
|
||||||
|
{
|
||||||
|
dwarf_regnames = dwarf_regnames_x86_64;
|
||||||
|
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
init_dwarf_regnames (unsigned int e_machine)
|
init_dwarf_regnames (unsigned int e_machine)
|
||||||
{
|
{
|
||||||
@ -3990,14 +4004,12 @@ init_dwarf_regnames (unsigned int e_machine)
|
|||||||
{
|
{
|
||||||
case EM_386:
|
case EM_386:
|
||||||
case EM_486:
|
case EM_486:
|
||||||
dwarf_regnames = dwarf_regnames_i386;
|
init_dwarf_regnames_i386 ();
|
||||||
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_i386);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EM_X86_64:
|
case EM_X86_64:
|
||||||
case EM_L1OM:
|
case EM_L1OM:
|
||||||
dwarf_regnames = dwarf_regnames_x86_64;
|
init_dwarf_regnames_x86_64 ();
|
||||||
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -122,6 +122,8 @@ extern int do_trace_aranges;
|
|||||||
extern int do_wide;
|
extern int do_wide;
|
||||||
|
|
||||||
extern void init_dwarf_regnames (unsigned int);
|
extern void init_dwarf_regnames (unsigned int);
|
||||||
|
extern void init_dwarf_regnames_i386 (void);
|
||||||
|
extern void init_dwarf_regnames_x86_64 (void);
|
||||||
|
|
||||||
extern int load_debug_section (enum dwarf_section_display_enum,
|
extern int load_debug_section (enum dwarf_section_display_enum,
|
||||||
void *);
|
void *);
|
||||||
|
@ -2349,10 +2349,24 @@ dump_dwarf (bfd *abfd)
|
|||||||
else
|
else
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
switch (bfd_get_arch (abfd))
|
||||||
{
|
{
|
||||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
case bfd_arch_i386:
|
||||||
init_dwarf_regnames (bed->elf_machine_code);
|
switch (bfd_get_mach (abfd))
|
||||||
|
{
|
||||||
|
case bfd_mach_x86_64:
|
||||||
|
case bfd_mach_x86_64_intel_syntax:
|
||||||
|
init_dwarf_regnames_x86_64 ();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
init_dwarf_regnames_i386 ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_map_over_sections (abfd, dump_dwarf_section, NULL);
|
bfd_map_over_sections (abfd, dump_dwarf_section, NULL);
|
||||||
|
Reference in New Issue
Block a user