2011-12-13 Shinichiro Hamaji <shinichiro.hamaji@gmail.com>

* dwarf2.c (bfd_dwarf2_cleanup_debug_info): Accept stash as an
	argument like other functions to support formats other than ELF.
	* elf-bfd.h (bfd_dwarf2_cleanup_debug_info): Move to bfd-in.h.
	* elf.c (_bfd_elf_close_and_cleanup): Pass dwarf2_find_line_info
	in tdata as a parameter.
	* libbfd-in.h (bfd_dwarf2_cleanup_debug_info): Move from
	elf-bfd.h.
	* libbfd.h (bfd_dwarf2_cleanup_debug_info): Regenerate.
	* mach-o-target.c (bfd_mach_o_close_and_cleanup): Remove the
	fallback macro.
	(bfd_mach_o_find_nearest_line): Likewise.
	* mach-o.c (bfd_mach_o_find_nearest_line): Add the definition
	which calls _bfd_dwarf2_find_nearest_line.
	(bfd_mach_o_close_and_cleanup): Likewise.
	* mach-o.h (mach_o_data_struct): Add dwarf2_find_line_info.
	(bfd_mach_o_find_nearest_line): Add declaration.
	(bfd_mach_o_close_and_cleanup): Add declaration.
This commit is contained in:
Tristan Gingold
2011-12-13 14:02:20 +00:00
parent 8837a20f4f
commit d9071b0c42
9 changed files with 76 additions and 18 deletions

View File

@@ -3527,17 +3527,12 @@ _bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED,
}
void
_bfd_dwarf2_cleanup_debug_info (bfd *abfd)
_bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo)
{
struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo;;
struct comp_unit *each;
struct dwarf2_debug *stash;
if (abfd == NULL || elf_tdata (abfd) == NULL)
return;
stash = (struct dwarf2_debug *) elf_tdata (abfd)->dwarf2_find_line_info;
if (stash == NULL)
if (abfd == NULL || stash == NULL)
return;
for (each = stash->all_comp_units; each; each = each->next_unit)