diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-12-05 02:20:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-12-05 02:20:11 +0000 |
commit | 66ab583969c8fe833723703870a061b362de77fa (patch) | |
tree | b56c972c897f04194bf100b70bf0a40a31e53468 /libbacktrace/internal.h | |
parent | 268209f3a0dc07fcf13534610447ab732742eb2f (diff) | |
download | gcc-66ab583969c8fe833723703870a061b362de77fa.zip gcc-66ab583969c8fe833723703870a061b362de77fa.tar.gz gcc-66ab583969c8fe833723703870a061b362de77fa.tar.bz2 |
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
Diffstat (limited to 'libbacktrace/internal.h')
-rw-r--r-- | libbacktrace/internal.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h index 065b953..31004bb 100644 --- a/libbacktrace/internal.h +++ b/libbacktrace/internal.h @@ -286,22 +286,36 @@ extern int backtrace_initialize (struct backtrace_state *state, void *data, fileline *fileline_fn); +/* An enum for the DWARF sections we care about. */ + +enum dwarf_section +{ + DEBUG_INFO, + DEBUG_LINE, + DEBUG_ABBREV, + DEBUG_RANGES, + DEBUG_STR, + + DEBUG_MAX +}; + +/* Data for the DWARF sections we care about. */ + +struct dwarf_sections +{ + const unsigned char *data[DEBUG_MAX]; + size_t size[DEBUG_MAX]; +}; + +/* DWARF data read from a file, used for .gnu_debugaltlink. */ + struct dwarf_data; /* Add file/line information for a DWARF module. */ extern int backtrace_dwarf_add (struct backtrace_state *state, uintptr_t base_address, - const unsigned char* dwarf_info, - size_t dwarf_info_size, - const unsigned char *dwarf_line, - size_t dwarf_line_size, - const unsigned char *dwarf_abbrev, - size_t dwarf_abbrev_size, - const unsigned char *dwarf_ranges, - size_t dwarf_range_size, - const unsigned char *dwarf_str, - size_t dwarf_str_size, + const struct dwarf_sections *dwarf_sections, int is_bigendian, struct dwarf_data *fileline_altlink, backtrace_error_callback error_callback, |