aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/xcoff.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-16Update copyright years.Jakub Jelinek1-1/+1
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-06-28libbacktrace: improve XCOFF supportIan Lance Taylor1-17/+18
libbacktrace/ChangeLog: 2021-06-28 Clément Chigot <clement.chigot@atos.net> * xcoff.c (SSUBTYP_DWRNGES): New define. (xcoff_add): Use correct XCOFF DWARF section subtype for DEBUG_RANGES. Remove lineoff workaround. Adjust base_address. (xcoff_initialize_syminfo): Adapt to new base_address. (xcoff_lookup_pc): Likewise. (xcoff_initialize_fileline): Likewise.
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-12-13libbacktrace: add DWARF 5 supportIan Lance Taylor1-0/+2
* 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
2019-12-05libbacktrace: simplify DWARF section handlingIan Lance Taylor1-35/+25
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
2019-09-26re PR libbacktrace/91908 (New libbacktrace tests fail to build)Ian Lance Taylor1-1/+2
PR libbacktrace/91908 * pecoff.c (backtrace_initialize): Explicitly cast unchecked __sync_bool_compare_and_swap to void. * xcoff.c (backtrace_initialize): Likewise. From-SVN: r276168
2019-01-17[libbacktrace] Add altlink field to struct dwarf_dataTom de Vries1-0/+1
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
2019-01-17[libbacktrace] Return struct dwarf_data pointer from elf_addTom de Vries1-1/+2
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
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-08-01xcoff.c (struct xcoff_line, [...]): Remove.Tony Reix1-232/+201
* xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove. (struct xcoff_func, struct xcoff_func_vector): New structs. (xcoff_syminfo): Drop leading dot from symbol name. (xcoff_line_compare, xcoff_line_search): Remove. (xcoff_func_compare, xcoff_func_search): New static functions. (xcoff_lookup_pc): Search function table. (xcoff_add_line, xcoff_process_linenos): Remove. (xcoff_initialize_fileline): Build function table. From-SVN: r263238
2018-01-19xcoff.c (xcoff_incl_compare): New function.Tony Reix1-9/+43
* xcoff.c (xcoff_incl_compare): New function. (xcoff_incl_search): New function. (xcoff_process_linenos): Use bsearch to find include file. (xcoff_initialize_fileline): Sort include file information. From-SVN: r256895
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-09-29xcoff.c: Initial support for DWARF debug sections in XCOFF.Tony Reix1-11/+133
* xcoff.c: Initial support for DWARF debug sections in XCOFF. (STYP_DWARF, SSUBTYP_DW*): Define. (enum dwarf_section): Define. (struct dwsect_info): Define. (xcoff_add): Look for DWARF sections, pass them to backtrace_dwarf_add. From-SVN: r253297
2017-09-20re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info ↵Ian Lance Taylor1-1/+2
is split) 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: Denis Khalikov <d.khalikov@partner.samsung.com> From-SVN: r253032
2017-08-02* xcoff.c (xcoff_process_linenos): Initialize incl to NULL.David Edelsohn1-1/+1
From-SVN: r250824
2017-07-28* xcoff.c: Don't leak a file descriptor if an archive is malformed.Tony Reix1-4/+5
From-SVN: r250684
2017-07-26configure.ac: Check for XCOFF32/XCOFF64.Tony Reix1-24/+1432
* configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery. * filetype.awk: Separate AIX XCOFF32 and XCOFF64. * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats. * configure, config.h.in: Regenerate. From-SVN: r250590
2017-07-21filetype.awk: Add AIX XCOFF type detection.Tony Reix1-0/+76
* filetype.awk: Add AIX XCOFF type detection. * configure.ac: Recognize xcoff format. * Makefile.am (FORMAT_FILES): Add xcoff.c. * fileline.c: Include <unistd.h>. (fileline_initialize): Add case for AIX procfs. * xcoff.c: New file. * configure, Makefile.in: Rebuild. From-SVN: r250435