aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/dwarf.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-03-07sort.c: New file.Ian Lance Taylor1-9/+10
* sort.c: New file. * stest.c: New file. * internal.h (backtrace_qsort): Declare. * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort. (read_line_info, read_function_entry): Likewise. (read_function_info, build_dwarf_data): Likewise. * elf.c (elf_initialize_syminfo): Likewise. * Makefile.am (libbacktrace_la_SOURCES): Add sort.c. (stest_SOURCES, stest_LDADD): Define. (check_PROGRAMS): Add stest. From-SVN: r208392
2014-01-02Update copyright years in libbacktrace/Richard Sandiford1-1/+1
From-SVN: r206292
2013-12-05alloc.c (backtrace_vector_finish): Add error_callback and data parameters.Ian Lance Taylor1-2/+6
* alloc.c (backtrace_vector_finish): Add error_callback and data parameters. Call backtrace_vector_release. Return address base. * mmap.c (backtrace_vector_finish): Add error_callback and data parameters. Return address base. * dwarf.c (read_function_info): Get new address base from backtrace_vector_finish. * internal.h (backtrace_vector_finish): Update declaration. From-SVN: r205716
2013-11-28dwarf.c (find_address_ranges): New static function, broken out of ↵Ian Lance Taylor1-156/+184
build_address_map. * dwarf.c (find_address_ranges): New static function, broken out of build_address_map. (build_address_map): Call it. * btest.c (check): Check for missing filename or function, rather than crashing. (f3): Check that enough frames were returned. From-SVN: r205490
2013-11-19configure.ac: Check for support of __atomic extensions.Ian Lance Taylor1-27/+9
* configure.ac: Check for support of __atomic extensions. * internal.h: Declare or #define atomic functions for use in backtrace code. * atomic.c: New file. * dwarf.c (dwarf_lookup_pc): Use atomic functions. (dwarf_fileline, backtrace_dwarf_add): Likewise. * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise. (backtrace_initialize): Likewise. * fileline.c (fileline_initialize): Likewise. * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c. * configure, config.h.in, Makefile.in: Rebuild. From-SVN: r204994
2013-01-31dwarf.c (read_function_info): Permit fvec parameter to be NULL.Ian Lance Taylor1-9/+36
* dwarf.c (read_function_info): Permit fvec parameter to be NULL. (dwarf_lookup_pc): Don't use ddata->fvec if threaded. From-SVN: r195620
2013-01-25re PR other/56076 (Several 64-bit libgo tests FAIL in read_line_header)Jakub Jelinek1-1/+2
PR other/56076 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir attribute was not seen. From-SVN: r195478
2013-01-17dwarf.c (struct unit): Add filename and abs_filename fields.Ian Lance Taylor1-2/+51
* dwarf.c (struct unit): Add filename and abs_filename fields. (build_address_map): Set new fields when reading unit. (dwarf_lookup_pc): If we don't find an entry in the line table, just return the main file name. From-SVN: r195257
2013-01-14Update copyright years in libbacktrace.Richard Sandiford1-1/+1
From-SVN: r195165
2012-11-20* dwarf.c (read_attribute): Always clear val.Ian Lance Taylor1-0/+6
From-SVN: r193670
2012-10-10dwarf.c (dwarf_fileline): Add cast to avoid warning.Ian Lance Taylor1-3/+3
* dwarf.c (dwarf_fileline): Add cast to avoid warning. (backtrace_dwarf_add): Likewise. From-SVN: r192288
2012-10-09Add support for tracing through shared libraries.Ian Lance Taylor1-60/+215
* configure.ac: Check for link.h and dl_iterate_phdr. * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef ELF macros before #defining them. (dl_phdr_info, dl_iterate_phdr): Define if system does not have dl_iterate_phdr. (struct elf_syminfo_data): Add next field. (elf_initialize_syminfo): Initialize next field. (elf_add_syminfo_data): New static function. (elf_add): New static function, broken out of backtrace_initialize. Call backtrace_dwarf_add instead of backtrace_dwarf_initialize. (struct phdr_data): Define. (phdr_callback): New static function. (backtrace_initialize): Call elf_add. * dwarf.c (struct dwarf_data): Add next and base_address fields. (add_unit_addr): Add base_address parameter. Change all callers. (add_unit_ranges, build_address_map): Likewise. (add_line): Add ddata parameter. Change all callers. (read_line_program, add_function_range): Likewise. (dwarf_lookup_pc): New static function, broken out of dwarf_fileline. (dwarf_fileline): Call dwarf_lookup_pc. (build_dwarf_data): New static function. (backtrace_dwarf_add): New function. (backtrace_dwarf_initialize): Remove. * internal.h (backtrace_dwarf_initialize): Don't declare. (backtrace_dwarf_add): Declare. * configure, config.h.in: Rebuild. From-SVN: r192267
2012-10-04dwarf.c: If the system header files do not declare strnlen, provide our own ↵Ian Lance Taylor1-2/+16
version. * dwarf.c: If the system header files do not declare strnlen, provide our own version. From-SVN: r192082
2012-10-03dwarf.c (read_uleb128): Fix overflow test.Ian Lance Taylor1-10/+19
* dwarf.c (read_uleb128): Fix overflow test. (read_sleb128): Likewise. (build_address_map): Don't change unit_buf.start. From-SVN: r192053
2012-09-19configure.ac (GCC_HEADER_STDINT): Invoke.Rainer Orth1-1/+0
* configure.ac (GCC_HEADER_STDINT): Invoke. * backtrace.h: If we can't find <stdint.h>, use "gstdint.h". * btest.c: Don't include <stdint.h>. * dwarf.c: Likewise. * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild. Co-Authored-By: Ian Lance Taylor <iant@google.com> From-SVN: r191474
2012-09-18* dwarf.c: Correct test of HAVE_DECL_STRNLEN.Ian Lance Taylor1-1/+1
From-SVN: r191437
2012-09-18configure.ac: Check whether strnlen is declared.Ian Lance Taylor1-0/+5
* configure.ac: Check whether strnlen is declared. * dwarf.c: Declare strnlen if not declared. * configure, config.h.in: Rebuild. From-SVN: r191433
2012-09-17libbacktrace/:Ian Lance Taylor1-0/+2742
* Initial implementation. ./: * MAINTAINERS (Various Maintainers): Add libbacktrace. * configure.ac (host_libs): Add libbacktrace. (target_libraries): Add libbacktrace. * Makefile.def (host_modules): Add libbacktrace. (target_modules): Likewise. * configure, Makefile.in: Rebuild. gcc/go: * config-lang.in (target_libs): Add target-libbacktrace. From-SVN: r191397