diff options
author | Ian Lance Taylor <iant@golang.org> | 2017-09-20 21:09:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-09-20 21:09:37 +0000 |
commit | 9283471ba0d8b605a5ddf8cbd2814d81d4dd8550 (patch) | |
tree | e52a88d0b1f5cfcb40440155b8e658b582180f36 /libbacktrace/fileline.c | |
parent | 2ffb574542b10b14841c2807047e7396e3a63f37 (diff) | |
download | gcc-9283471ba0d8b605a5ddf8cbd2814d81d4dd8550.zip gcc-9283471ba0d8b605a5ddf8cbd2814d81d4dd8550.tar.gz gcc-9283471ba0d8b605a5ddf8cbd2814d81d4dd8550.tar.bz2 |
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
Diffstat (limited to 'libbacktrace/fileline.c')
-rw-r--r-- | libbacktrace/fileline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libbacktrace/fileline.c b/libbacktrace/fileline.c index 6812058..babbe53 100644 --- a/libbacktrace/fileline.c +++ b/libbacktrace/fileline.c @@ -58,6 +58,7 @@ fileline_initialize (struct backtrace_state *state, int pass; int called_error_callback; int descriptor; + const char *filename; char buf[64]; if (!state->threaded) @@ -84,7 +85,6 @@ fileline_initialize (struct backtrace_state *state, called_error_callback = 0; for (pass = 0; pass < 5; ++pass) { - const char *filename; int does_not_exist; switch (pass) @@ -140,8 +140,8 @@ fileline_initialize (struct backtrace_state *state, if (!failed) { - if (!backtrace_initialize (state, descriptor, error_callback, data, - &fileline_fn)) + if (!backtrace_initialize (state, filename, descriptor, error_callback, + data, &fileline_fn)) failed = 1; } |