Skip to content
Snippets Groups Projects
  1. Jan 04, 2021
  2. Sep 09, 2020
  3. Jan 01, 2020
  4. Dec 13, 2019
    • Ian Lance Taylor's avatar
      libbacktrace: add DWARF 5 support · c926fd82
      Ian Lance Taylor authored
      	* dwarf.c (struct attr): Add val field.
      	(enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
      	ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
      	(struct line_header): Add addrsize field.
      	(struct line_header_format): Define.
      	(struct unit): Add str_offsets_base, addr_base, and rnglists_base
      	fields.
      	(read_uint24): New static function.
      	(read_attribute): Add implicit_val parameter.  Replace dwarf_str
      	and dwarf_str_size parameters with dwarf_sections parameter.  Add
      	support for new DWARF 5 forms.  Change all callers.
      	(resolve_string): New static function.
      	(resolve_addr_index): Likewise.
      	(read_abbrevs): Support DW_FORM_implicit_const.
      	(struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
      	and ranges_is_index fields.
      	(update_pcrange): Support DWARF 5 encodings.
      	(add_high_low_range): New static function, split out of
      	add_ranges.
      	(add_ranges_from_ranges): Likewise.
      	(add_ranges_from_rnglists): New static function.
      	(add_ranges): Just call new helper functions.
      	(find_address_ranges): Use resolve_string for strings, after
      	reading all attributes.  Handle new DWARF 5 attributes.
      	(build_address_map): Support DWARF 5 compilation units.
      	(read_v2_paths): New static function, split out of
      	read_line_header.
      	(read_lnct): New static	function.
      	(read_line_header_format_entries): Likewise.
      	(read_line_header): Add ddata parameter.  Support DWARF 5 line
      	headers.  Call new helper functions.  Change all callers.
      	(read_line_program): Use addrsize from line program header.  Don't
      	special case directory index 0 for DWARF 5.
      	(read_referenced_name): Use resolve_string.
      	(read_function_entry): Handle DWARF 5 encodings.  Use
      	resolve_string.
      	* internal.h (enum dwarf_section): Add DEBUG_ADDR,
      	DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
      	* elf.c (dwarf_section_names): Add new section names.
      	* pecoff.c (dwarf_section_names): Likewise.
      	* xcoff.c (xcoff_add): Clear dwarf_sections before setting
      	fields.
      	* configure.ac: Define HAVE_DWARF5 automake conditional.
      	* Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
      	(dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
      	(dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
      	(dwarf5_alloc_LDADD): Likewise.
      	(BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
      	(CLEANFILES, clean-local): Define.
      
      From-SVN: r279380
      c926fd82
  5. Dec 05, 2019
    • Ian Lance Taylor's avatar
      libbacktrace: simplify DWARF section handling · 66ab5839
      Ian Lance Taylor authored
      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
      66ab5839
  6. Sep 26, 2019
  7. Jan 17, 2019
    • Tom de Vries's avatar
      [libbacktrace] Add altlink field to struct dwarf_data · 9ad458d5
      Tom de Vries authored
      Add an altlink field to struct dwarf_data, and initialize it with the pointer
      to the struct dwarf_data for the .gnu_debugaltlink.
      
      2019-01-17  Tom de Vries  <tdevries@suse.de>
      
      	* dwarf.c (struct dwarf_data): Add altlink field.
      	(backtrace_dwarf_add): Add and handle fileline_altlink parameter.
      	* elf.c	(elf_add): Add argument to backtrace_dwarf_add call.
      	(phdr_callback, backtrace_initialize): Add argument to elf_add calls.
      	* internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
      	* pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
      	* xcoff.c (xcoff_add): Same.
      
      From-SVN: r267994
      9ad458d5
    • Tom de Vries's avatar
      [libbacktrace] Return struct dwarf_data pointer from elf_add · e6f00c83
      Tom de Vries authored
      Allow the caller of elf_add access to the struct dwarf_data pointer
      corresponding to the added elf.
      
      2019-01-17  Tom de Vries  <tdevries@suse.de>
      
      	* internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
      	* dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
      	* elf.c	(elf_add): Add and handle fileline_entry parameter.  Add
      	argument to backtrace_dwarf_add call.
      	(phdr_callback, backtrace_initialize): Add argument to elf_add calls.
      	* pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
      	* xcoff.c (xcoff_add): Same.
      
      From-SVN: r267993
      e6f00c83
  8. Jan 01, 2019
  9. Jan 25, 2018
  10. Jan 03, 2018
  11. Sep 20, 2017
    • Ian Lance Taylor's avatar
      re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info is split) · 9283471b
      Ian Lance Taylor authored
      
      	PR sanitizer/77631
      	Support for external debug info.
      	* elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
      	(S_ISLNK): Define if not defined.
      	(xstrnlen): Define if strnlen is not available.
      	(b_elf_note): Define type.
      	(NT_GNU_BUILD_ID): Define macro.
      	(elf_crc32, elf_crc32_file): New static functions.
      	(elf_is_symlink, elf_readlink): New static functions.
      	(elf_open_debugfile_by_buildid): New static function.
      	(elf_try_debugfile): New static function.
      	(elf_find_debugfile_by_debuglink): New static function.
      	(elf_open_debugfile_by_debuglink): New static function.
      	(elf_add): Add filename and debuginfo parameters.  Adjust all
      	callers.  Look for external debug info notes, and try to fetch
      	debug info from external file.
      	(struct phdr_data): Add exe_filename field.
      	(phdr_callback): Pass filename to elf_add.
      	(backtrace_initialize): Add filename parameter.
      	* internal.h (backtrace_initialize): Add filename parameter.
      	* fileline.c (fileline_initialize): Pass filename to
      	backtrace_initialize.
      	* pecoff.c (fileline_initialize): Add unused filename parameter.
      	* unknown.c (fileline_initialize): Likewise.
      	* xcoff.c (fileline_initialize): Likewise.
      	* configure.ac: Check for objcopy --add-gnu-debuglink.
      	* Makefile.am (dtest): New test target.
      	* configure, Makefile.in: Rebuild.
      
      Co-Authored-By: default avatarDenis Khalikov <d.khalikov@partner.samsung.com>
      
      From-SVN: r253032
      9283471b
  12. Jan 01, 2017
  13. Jan 04, 2016
  14. May 29, 2015
    • Tristan Gingold's avatar
      libbacktrace: add support of PE/COFF · e24afc10
      Tristan Gingold authored
      libbacktrace/
      2015-05-29  Tristan Gingold  <gingold@adacore.com>
      
      	* pecoff.c: New file.
      	* Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
      	* Makefile.in: Regenerate.
      	* filetype.awk: Detect pecoff.
      	* configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
      	Add pecoff.
      	* btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
      	true.
      	* backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
      	* configure: Regenerate.
      	* pecoff.c: New file.
      
      From-SVN: r223859
      e24afc10
Loading