This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libbacktrace: allow using DWARF if the main executable lacks it
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 22 Jul 2013 17:34:41 +0400 (MSK)
- Subject: libbacktrace: allow using DWARF if the main executable lacks it
- References: <alpine dot LNX dot 2 dot 00 dot 1307221718150 dot 1061 at monopod dot intra dot ispras dot ru>
This fixes a bug that would prevent using DWARF debug info available in
dynamically linked libraries when the main executable did not have DWARF debug
info.
pd.fileline_fn is not examined after dl_iterate_phdr in backtrace_initialize,
so updating *fileline_fn in dl_iterate_phdr is useless as later it is
overwritten from elf_fileline_fn. OK for trunk?
2013-07-22 Alexander Monakov <amonakov@ispras.ru>
* elf.c (backtrace_initialize): Pass elf_fileline_fn to
dl_iterate_phdr callbacks.
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index a90afaa..fde884a 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -865,7 +865,7 @@ backtrace_initialize (struct backtrace_state *state, int descriptor,
pd.state = state;
pd.error_callback = error_callback;
pd.data = data;
- pd.fileline_fn = fileline_fn;
+ pd.fileline_fn = &elf_fileline_fn;
pd.found_sym = &found_sym;
pd.found_dwarf = &found_dwarf;