Commit Graph

22 Commits

Author SHA1 Message Date
Jakub Jelinek 99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Ian Lance Taylor 90c2545651 libbacktrace: use ELF symbol table if no debug info available
PR libbacktrace/97080
	* fileline.c (backtrace_syminfo_to_full_callback): New function.
	(backtrace_syminfo_to_full_error_callback): New function.
	* elf.c (elf_nodebug): Call syminfo_fn if possible.
	* internal.h (struct backtrace_call_full): Define.
	(backtrace_syminfo_to_full_callback): Declare.
	(backtrace_syminfo_to_full_error_callback): Declare.
	* mtest.c (f3): Only check all[i] if data.index permits.
2020-09-16 17:04:43 -07:00
Ian Lance Taylor 181f877b6c libbacktrace: fetch executable path on macOS
PR libbacktrace/96973
	* fileline.c (macho_get_executable_path): New static function.
	(fileline_initialize): Call macho_get_executable_path.
2020-09-08 19:09:21 -07:00
Ian Lance Taylor 261356844a libbacktrace: support fetching executable name using sysctl
This supports FreeBSD and NetBSD when /proc is not mounted.

libbacktrace/
	* fileline.c (sysctl_exec_name): New static function.
	(sysctl_exec_name1): New macro or static function.
	(sysctl_exec_name2): Likewise.
	(fileline_initialize): Try sysctl_exec_name[12].
	* configure.ac: Check for sysctl args to fetch executable name.
	* configure: Regenerate.
	* config.h.in: Regenerate.
2020-05-09 15:20:13 -07:00
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Ian Lance Taylor 9283471ba0 re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info 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-09-20 21:09:37 +00:00
Rainer Orth cf311b0355 Fix pid_t printing
* fileline.c (fileline_initialize): Print pid_t as long.

From-SVN: r250675
2017-07-28 16:26:39 +00:00
Tony Reix b3530b946f filetype.awk: Add AIX XCOFF type detection.
* 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
2017-07-21 18:05:08 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Carlos Liam 84ebf639b8 * all: Remove meaningless trailing whitespace.
From-SVN: r240084
2016-09-11 13:44:07 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Richard Sandiford afeba5cb1d Update copyright years in libbacktrace/
From-SVN: r206292
2014-01-02 22:24:37 +00:00
Ian Lance Taylor 49579c7e20 configure.ac: Check for support of __atomic extensions.
* 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-19 01:09:47 +00:00
Richard Sandiford f8a7e1a44d Update copyright years in libbacktrace.
From-SVN: r195165
2013-01-14 18:17:30 +00:00
Ian Lance Taylor 33521509a8 configure.ac: Check for getexecname.
* 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-11-12 21:24:19 +00:00
Ian Lance Taylor 73f4149137 re PR other/55087 (bogus "linux-vdso.so.1: No such file or directory" caused 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-26 20:08:29 +00:00
Ian Lance Taylor 8a447b3d4d re PR other/54749 (libbacktrace)
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-29 17:50:54 +00:00
Rainer Orth c0558468b8 Fix libbacktrace bootstrap with gcc 4.4
* fileline.c: Include <stdlib.h>.
	* mmap.c: Likewise.

From-SVN: r191414
2012-09-18 09:02:50 +00:00
Ian Lance Taylor eff02e4f84 libbacktrace/:
* 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
2012-09-17 16:38:38 +00:00