2005-09-30 H.J. Lu <hongjiu.lu@intel.com>
* dwarf.c (fetch_indirect_string): Adjust for section address. (process_debug_info): Likewise. (display_debug_loc): Likewise. (display_debug_ranges): Likewise. * objdump.c (mach_o_dwarf_sections): New. (generic_dwarf_sections): Likewise. (check_mach_o_dwarf): Likewise. (dump_dwarf): Call check_mach_o_dwarf.
This commit is contained in:
parent
365544c3f0
commit
bfe2612a14
3 changed files with 72 additions and 6 deletions
|
@ -2055,6 +2055,51 @@ dump_dwarf_section (bfd *abfd, asection *section,
|
|||
}
|
||||
}
|
||||
|
||||
static const char *mach_o_dwarf_sections [] = {
|
||||
"LC_SEGMENT.__DWARFA.__debug_abbrev", /* .debug_abbrev */
|
||||
"LC_SEGMENT.__DWARFA.__debug_aranges", /* .debug_aranges */
|
||||
"LC_SEGMENT.__DWARFA.__debug_frame", /* .debug_frame */
|
||||
"LC_SEGMENT.__DWARFA.__debug_info", /* .debug_info */
|
||||
"LC_SEGMENT.__DWARFA.__debug_line", /* .debug_line */
|
||||
"LC_SEGMENT.__DWARFA.__debug_pubnames", /* .debug_pubnames */
|
||||
".eh_frame", /* .eh_frame */
|
||||
"LC_SEGMENT.__DWARFA.__debug_macinfo", /* .debug_macinfo */
|
||||
"LC_SEGMENT.__DWARFA.__debug_str", /* .debug_str */
|
||||
"LC_SEGMENT.__DWARFA.__debug_loc", /* .debug_loc */
|
||||
"LC_SEGMENT.__DWARFA.__debug_pubtypes", /* .debug_pubtypes */
|
||||
"LC_SEGMENT.__DWARFA.__debug_ranges", /* .debug_ranges */
|
||||
"LC_SEGMENT.__DWARFA.__debug_static_func", /* .debug_static_func */
|
||||
"LC_SEGMENT.__DWARFA.__debug_static_vars", /* .debug_static_vars */
|
||||
"LC_SEGMENT.__DWARFA.__debug_types", /* .debug_types */
|
||||
"LC_SEGMENT.__DWARFA.__debug_weaknames" /* .debug_weaknames */
|
||||
};
|
||||
|
||||
static const char *generic_dwarf_sections [max];
|
||||
|
||||
static void
|
||||
check_mach_o_dwarf (bfd *abfd)
|
||||
{
|
||||
static enum bfd_flavour old_flavour = bfd_target_unknown_flavour;
|
||||
enum bfd_flavour current_flavour = bfd_get_flavour (abfd);
|
||||
enum dwarf_section_display_enum i;
|
||||
|
||||
if (generic_dwarf_sections [0] == NULL)
|
||||
for (i = 0; i < max; i++)
|
||||
generic_dwarf_sections [i] = debug_displays[i].section.name;
|
||||
|
||||
if (old_flavour != current_flavour)
|
||||
{
|
||||
if (current_flavour == bfd_target_mach_o_flavour)
|
||||
for (i = 0; i < max; i++)
|
||||
debug_displays[i].section.name = mach_o_dwarf_sections [i];
|
||||
else if (old_flavour == bfd_target_mach_o_flavour)
|
||||
for (i = 0; i < max; i++)
|
||||
debug_displays[i].section.name = generic_dwarf_sections [i];
|
||||
|
||||
old_flavour = current_flavour;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the dwarf debugging information. */
|
||||
|
||||
static void
|
||||
|
@ -2074,6 +2119,8 @@ dump_dwarf (bfd *abfd)
|
|||
else
|
||||
abort ();
|
||||
|
||||
check_mach_o_dwarf (abfd);
|
||||
|
||||
bfd_map_over_sections (abfd, dump_dwarf_section, NULL);
|
||||
|
||||
free_debug_memory ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue