aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace
AgeCommit message (Collapse)AuthorFilesLines
2014-01-02Update copyright years in libbacktrace/Richard Sandiford22-21/+25
From-SVN: r206292
2013-12-06elf.c (ET_DYN): Undefine and define again.Jakub Jelinek2-11/+56
* elf.c (ET_DYN): Undefine and define again. (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN, return early -1 without closing the descriptor. (struct phdr_data): Add exe_descriptor. (phdr_callback): If pd->exe_descriptor is not -1, for very first call if dlpi_name is NULL just call elf_add with the exe_descriptor, otherwise backtrace_close the exe_descriptor if not -1. Adjust call to elf_add. (backtrace_initialize): Adjust call to elf_add. If it returns -1, set pd.exe_descriptor to descriptor, otherwise set it to -1. From-SVN: r205748
2013-12-05alloc.c (backtrace_vector_finish): Add error_callback and data parameters.Ian Lance Taylor5-14/+51
* 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 Taylor3-156/+208
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-19backtrace.h (backtrace_syminfo_callback): Add symsize argument.Jakub Jelinek4-8/+44
* backtrace.h (backtrace_syminfo_callback): Add symsize argument. * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as last argument. * btest.c (struct symdata): Add size field. (callback_three): Add symsize argument. Copy it to the data->size field. (f23): Set symdata.size to 0. (test5): Likewise. If sizeof (int) > 1, lookup address of ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size values. From-SVN: r205028
2013-11-19* atomic.c: Include sys/types.h.Jakub Jelinek2-0/+6
From-SVN: r205008
2013-11-19configure.ac: Check for support of __atomic extensions.Ian Lance Taylor11-79/+263
* 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-11-18elf.c (SHN_UNDEF): Define.Jakub Jelinek2-3/+14
* elf.c (SHN_UNDEF): Define. (elf_initialize_syminfo): Add base_address argument. Ignore symbols with st_shndx == SHN_UNDEF. Add base_address to address fields. (elf_add): Adjust caller. From-SVN: r204975
2013-11-18* elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.Jakub Jelinek2-6/+6
From-SVN: r204971
2013-11-16backtrace.h (backtrace_create_state): Correct comment about threading.Ian Lance Taylor2-2/+6
* backtrace.h (backtrace_create_state): Correct comment about threading. From-SVN: r204905
2013-11-16backtrace.h (backtrace_syminfo): Update comment and parameter name to take ↵Ian Lance Taylor4-25/+94
any address, not just a PC value. * backtrace.h (backtrace_syminfo): Update comment and parameter name to take any address, not just a PC value. * elf.c (STT_OBJECT): Define. (elf_nosyms): Rename parameter pc to addr. (elf_symbol_search): Rename local variable pc to addr. (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols. (elf_syminfo): Rename parameter pc to addr. * btest.c (global): New global variable. (test5): New test. (main): Call test5. From-SVN: r204904
2013-10-18elf.c (elf_add): Don't get the wrong offsets if a debug section is missing.Ian Lance Taylor2-2/+14
* elf.c (elf_add): Don't get the wrong offsets if a debug section is missing. From-SVN: r203810
2013-10-15Add --enable-host-shared configuration optionDavid Malcolm3-2/+21
/ * configure.ac: Add --enable-host-shared * configure: Regenerate. gcc/ * Makefile.in (PICFLAG): New. (enable_host_shared): New. (INTERNAL_CFLAGS): Use PICFLAG. (LIBIBERTY): Use pic build of libiberty.a if configured with --enable-host-shared. * configure.ac: Add --enable-host-shared, setting up new PICFLAG variable. * configure: Regenerate. * doc/install.texi (--enable-shared): Add note contrasting it with... (--enable-host-shared): New option. libbacktrace/ * configure.ac: Add --enable-host-shared, setting up pre-existing PIC_FLAG variable within Makefile.am et al. * configure: Regenerate. libcpp/ * Makefile.in (PICFLAG): New. (ALL_CFLAGS): Add PICFLAG. (ALL_CXXFLAGS): Likewise. * configure.ac: Add --enable-host-shared, setting up new PICFLAG variable. * configure: Regenerate. libdecnumber/ * Makefile.in (PICFLAG): New. (ALL_CFLAGS): Add PICFLAG. * configure.ac: Add --enable-host-shared, setting up new PICFLAG variable. * configure: Regenerate. libiberty/ * configure.ac: If --enable-host-shared, use -fPIC. * configure: Regenerate. zlib/ * configure.ac: Add --enable-host-shared, setting up new PICFLAG variable. * Makefile.am: Add PICFLAG to libz_a_CFLAGS. * Makefile.in: Regenerate. * configure: Regenerate. From-SVN: r203632
2013-09-20libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical ppc host match.Alan Modra2-5/+15
* libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical ppc host match. Support little-endian powerpc linux hosts. Regenerate configure throughout. From-SVN: r202773
2013-07-23elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.Alexander Monakov2-5/+43
* elf.c (elf_syminfo): Loop over the elf_syminfo_data chain. From-SVN: r201159
2013-07-23elf.c (backtrace_initialize): Pass elf_fileline_fn to dl_iterate_phdr callbacks.Alexander Monakov2-1/+6
* elf.c (backtrace_initialize): Pass elf_fileline_fn to dl_iterate_phdr callbacks. From-SVN: r201158
2013-03-25alloc.c: #include <sys/types.h>.Ian Lance Taylor3-0/+7
* alloc.c: #include <sys/types.h>. * mmap.c: Likewise. From-SVN: r197057
2013-01-31dwarf.c (read_function_info): Permit fvec parameter to be NULL.Ian Lance Taylor2-9/+41
* 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 Jelinek2-1/+8
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 Taylor2-2/+58
* 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 Sandiford21-20/+24
From-SVN: r195165
2013-01-01re PR bootstrap/54834 (bootstrap fails when building libbacktrace)Ian Lance Taylor3-2/+9
PR bootstrap/54834 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I $(MULTIBUILDTOP)/../../gcc/include. * Makefile.in: Rebuild. From-SVN: r194770
2013-01-01re PR other/55536 (libbacktrace abort in backtrace_alloc at mmap.c:99 ↵Ian Lance Taylor2-4/+28
running btest) PR other/55536 * mmap.c (backtrace_alloc): Don't call sync functions if not threaded. (backtrace_free): Likewise. From-SVN: r194768
2012-12-12mmapio.c: Define MAP_FAILED if not defined.John David Anglin2-0/+8
* mmapio.c: Define MAP_FAILED if not defined. From-SVN: r194443
2012-12-11re PR bootstrap/54926 (Bootstrap comparison failure for various files in ↵Jakub Jelinek5-10/+63
libbacktrace) PR bootstrap/54926 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@. * configure.ac: If --with-target-subdir, add -frandom-seed=$@ to EXTRA_FLAGS unconditionally, otherwise check whether the compiler accepts it. * Makefile.in: Regenerated. * configure: Regenerated. From-SVN: r194412
2012-12-07re PR bootstrap/54926 (Bootstrap comparison failure for various files in ↵Jakub Jelinek3-2/+8
libbacktrace) PR bootstrap/54926 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@. * Makefile.in: Regenerated. From-SVN: r194303
2012-11-20* dwarf.c (read_attribute): Always clear val.Ian Lance Taylor2-0/+10
From-SVN: r193670
2012-11-13re PR other/55312 (libbacktrace doesn't honor --disable-werror)Ian Lance Taylor3-2/+7
PR other/55312 * configure.ac: Only add -Werror if building a target library. From-SVN: r193485
2012-11-12configure.ac: Check for getexecname.Ian Lance Taylor6-10/+111
* configure.ac: Check for getexecname. * fileline.c: #include <errno.h>. Define getexecname if not available. (fileline_initialize): Try to find the executable in a few different ways. * print.c (error_callback): Only print the filename if it came from the backtrace state. * configure, config.h.in: Rebuild. Co-Authored-By: Gerald Pfeifer <gerald@pfeifer.com> Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> From-SVN: r193454
2012-10-29mmap.c (backtrace_vector_release): Correct last patch: add aligned, not size.Ian Lance Taylor2-1/+7
* mmap.c (backtrace_vector_release): Correct last patch: add aligned, not size. From-SVN: r192956
2012-10-29mmap.c (backtrace_vector_release): Make sure freed block is aligned on ↵Ian Lance Taylor2-2/+17
8-byte boundary. * mmap.c (backtrace_vector_release): Make sure freed block is aligned on 8-byte boundary. From-SVN: r192945
2012-10-26re PR other/55087 (bogus "linux-vdso.so.1: No such file or directory" caused ↵Ian Lance Taylor5-7/+31
by libbacktrace) PR other/55087 * posix.c (backtrace_open): Add does_not_exist parameter. * elf.c (phdr_callback): Do not warn if shared library could not be opened. * fileline.c (fileline_initialize): Update calls to backtrace_open. * internal.h (backtrace_open): Update declaration. From-SVN: r192861
2012-10-26re PR target/55061 (libbacktrace build fails during bootstrap on ↵Jack Howarth3-5/+40
powerpc-apple-darwin9) PR target/55061 * configure.ac: Check for _Unwind_GetIPInfo function declaration. * configure: Regenerate. From-SVN: r192853
2012-10-24re PR target/55061 (libbacktrace build fails during bootstrap on ↵Ian Lance Taylor3-2/+53
powerpc-apple-darwin9) PR target/55061 * configure.ac: Check whether -funwind-tables option works. * configure: Rebuild. From-SVN: r192782
2012-10-11configure.ac: Do not use dl_iterate_phdr on Solaris 10.Ian Lance Taylor3-0/+17
* configure.ac: Do not use dl_iterate_phdr on Solaris 10. * configure: Rebuild. From-SVN: r192371
2012-10-10elf.c: Rename all Elf typedefs to start with b_elf, and be all lower case.Ian Lance Taylor2-61/+66
* elf.c: Rename all Elf typedefs to start with b_elf, and be all lower case. From-SVN: r192331
2012-10-10* elf.c (elf_add_syminfo_data): Add casts to avoid warning.Hans-Peter Nilsson2-2/+6
From-SVN: r192311
2012-10-10dwarf.c (dwarf_fileline): Add cast to avoid warning.Ian Lance Taylor2-3/+8
* 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 Taylor7-106/+579
* 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-04* btest.c (f23): Avoid uninitialized variable warning.Gerald Pfeifer2-1/+5
From-SVN: r192102
2012-10-04dwarf.c: If the system header files do not declare strnlen, provide our own ↵Ian Lance Taylor2-2/+21
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 Taylor2-10/+25
* dwarf.c (read_uleb128): Fix overflow test. (read_sleb128): Likewise. (build_address_map): Don't change unit_buf.start. From-SVN: r192053
2012-10-02ChangeLog: Fix whitespace.Uros Bizjak1-3/+3
* gcc/ChangeLog: Fix whitespace. * libbacktrace/ChangeLog: Ditto. From-SVN: r191982
2012-10-02re PR other/54761 (FAIL log)Uros Bizjak5-5/+26
PR other/54761 * configure.ac (EXTRA_FLAGS): New. * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS). * configure, Makefile.in: Regenerate. From-SVN: r191981
2012-09-29re PR other/54749 (libbacktrace)Ian Lance Taylor2-1/+8
PR other/54749 * fileline.c (fileline_initialize): Pass errnum as -1 when reporting that we could not read executable information after a previous failure. From-SVN: r191855
2012-09-28re PR bootstrap/54732 (Installation failure: libbacktrace rebuilds upon ↵Ian Lance Taylor6-682/+100
install when built with "make bootstrap-lean") PR bootstrap/54732 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE. * Makefile.am: Add dependencies for all objects. * configure, aclocal.m4, Makefile.in: Rebuild. From-SVN: r191819
2012-09-27re PR other/54726 (libbacktrace segfaults on gcc_asserts with stripped gcc)Ian Lance Taylor2-1/+7
PR other/54726 * elf.c (backtrace_initialize): Set *fileln_fn, not state->fileln_fn. From-SVN: r191811
2012-09-19configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled as a target ↵Ian Lance Taylor3-1/+30
library. * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled as a target library. * configure: Rebuild. From-SVN: r191503
2012-09-19configure.ac (GCC_HEADER_STDINT): Invoke.Rainer Orth9-5/+1078
* 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-19re PR bootstrap/54623 (install fails with libbacktrace/backtrace.c:35:20: ↵Ian Lance Taylor3-2/+15
error: unwind.h: No such file or directory) PR bootstrap/54623 * Makefile.am (AM_CPPFLAGS): Define. (AM_CFLAGS): Remove -I options. * Makefile.in: Rebuild. From-SVN: r191459