From fc28f9aa231c8f3386e1c9bdb448d9cdd9cae1a9 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 30 Sep 2011 10:39:45 +0000 Subject: 2011-09-30 Tristan Gingold * dwarf2.c (struct dwarf2_debug): Add field debug_sections. (read_section): Add sec argument. Adjust the code to get section names from it. (read_indirect_string): Adjust call to read_section. (read_abbrevs): Ditto. (decode_line_info): Ditto. (read_debug_ranges): Ditto. (DWARF2_DEBUG_INFO, DWARF2_COMPRESSED_DEBUG_INFO): Remove. (find_debug_info): Add debug_sections parameter. Use it instead the above macros. (place_sections): Get section names from stash. (find_line): Add debug_sections argument. Initialize debug_sections field of stash from it. Adjust calls to find_debug_info. (_bfd_dwarf2_find_nearest_line): Add debug_sections argument. Adjust call to find_line. (_bfd_dwarf2_find_line): Adjust call to find_line. * libcoff-in.h (struct dwarf_debug_section): New declaration. (coff_find_nearest_line_with_names): Likewise. * libcoff.h: Regenerate. * libbfd-in.h (struct dwarf_debug_section): Move declaration. (dwarf_debug_sections): Likewise. (_bfd_dwarf2_find_nearest_line): Add debug_sections argument. * libbfd.h: Regenerate. * elf.c (_bfd_elf_find_nearest_line): Adjust call to _bfd_dwarf2_find_nearest_line. * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Ditto. * elf64-alpha.c (elf64_alpha_find_nearest_line): Ditto. * elf32-arm.c (elf32_arm_find_nearest_line): Ditto. * coffgen.c (coff_find_nearest_line_with_names): New function. (coff_find_nearest_line): Calls coff_find_nearest_line_with_names. * coff-rs6000.c (xcoff_debug_sections): New constant. (xcoff_find_nearest_line): New function. (rs6000coff_vec): Use xcoff_find_nearest_line. (pmac_xcoff_vec): Ditto. --- bfd/coff-rs6000.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'bfd/coff-rs6000.c') diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 5d9b5ae..ffa7a65 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -405,6 +405,50 @@ _bfd_xcoff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, { return FALSE; } + +static const struct dwarf_debug_section xcoff_debug_sections[] = +{ + { ".dwabrev", NULL }, + { ".dwarnge", NULL }, + { NULL, NULL }, /* .debug_frame */ + { ".dwinfo", NULL }, + { ".dwline", NULL }, + { NULL, NULL }, /* .debug_loc */ + { NULL, NULL }, /* .debug_macinfo */ + { NULL, NULL }, /* .debug_macro */ + { ".dwpbnms", NULL }, + { ".dwpbtyp", NULL }, + { ".dwrnges", NULL }, + { NULL, NULL }, /* .debug_static_func */ + { NULL, NULL }, /* .debug_static_vars */ + { ".dwstr", NULL }, + { NULL, NULL }, /* .debug_types */ + /* GNU DWARF 1 extensions */ + { NULL, NULL }, /* .debug_sfnames */ + { NULL, NULL }, /* .debug_srcinfo */ + /* SGI/MIPS DWARF 2 extensions */ + { NULL, NULL }, /* .debug_funcnames */ + { NULL, NULL }, /* .debug_typenames */ + { NULL, NULL }, /* .debug_varnames */ + { NULL, NULL }, /* .debug_weaknames */ + { NULL, NULL }, +}; + +static bfd_boolean +xcoff_find_nearest_line (bfd *abfd, + asection *section, + asymbol **symbols, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *line_ptr) +{ + return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, + section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr); +} + void _bfd_xcoff_swap_sym_in (bfd *abfd, PTR ext1, PTR in1) @@ -4073,7 +4117,7 @@ const bfd_target rs6000coff_vec = _bfd_xcoff_is_local_label_name, coff_bfd_is_target_special_symbol, coff_get_lineno, - coff_find_nearest_line, + xcoff_find_nearest_line, _bfd_generic_find_line, coff_find_inliner_info, coff_bfd_make_debug_symbol, @@ -4328,7 +4372,7 @@ const bfd_target pmac_xcoff_vec = _bfd_xcoff_is_local_label_name, coff_bfd_is_target_special_symbol, coff_get_lineno, - coff_find_nearest_line, + xcoff_find_nearest_line, _bfd_generic_find_line, coff_find_inliner_info, coff_bfd_make_debug_symbol, -- cgit v1.1