libbacktrace: simplify DWARF section handling
authorIan Lance Taylor <iant@golang.org>
Thu, 5 Dec 2019 02:20:11 +0000 (02:20 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 5 Dec 2019 02:20:11 +0000 (02:20 +0000)
commit66ab583969c8fe833723703870a061b362de77fa
treeb56c972c897f04194bf100b70bf0a40a31e53468
parent268209f3a0dc07fcf13534610447ab732742eb2f
libbacktrace: simplify DWARF section handling

This is in preparation for adding DWARF 5 support.

* internal.h (enum dwarf_section): Define.
(struct dwarf_sections): Define.
(backtrace_dwarf_add): Update declaration to replace specific
section parameters with dwarf_sections parameter.
* dwarf.c (struct dwarf_data): Replace specific section fields
with dwarf_sections field.
(read_attribute): Use dwarf_sections with altlink.
(build_address_map): Replace specific section parameters with
dwarf_sections parameter.  Change all callers.
(read_line_info): Use dwarf_sections with ddata.
(read_referenced_name): Likewise.
(add_function_ranges): Likewise.
(read_function_entry): Likewise.
(read_function_info): Likewise.
(build_dwarf_data): Replace specific section parameters with
dwarf_sections parameter.  Change all callers.
(backtrace_dwarf_add): Likewise.
* elf.c (enum debug_section): Remove.
(dwarf_section_names): Remove .zdebug names.
(elf_add): Track zsections separately.  Build dwarf_sections.
* pecoff.c (enum debug_section): Remove.
(struct debug_section_info): Remove data field.
(coff_add): Build dwarf_sections.
* xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
references with DEBUG_xxx references.
(xcoff_add): Build dwarf_sections.

From-SVN: r278984
libbacktrace/ChangeLog
libbacktrace/dwarf.c
libbacktrace/elf.c
libbacktrace/internal.h
libbacktrace/pecoff.c
libbacktrace/xcoff.c