This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
GDB 7.7 crashes on LTO-built executable
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb-patches at sourceware dot org
- Date: Wed, 12 Feb 2014 19:37:02 +0200
- Subject: GDB 7.7 crashes on LTO-built executable
- Authentication-results: sourceware.org; auth=none
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
I compiled a simple test program with -flto using MinGW GCC 4.7.2, and
tried to debug it with GDB 7.7. However, "info source" crashed with
SIGSEGV. It turns out that source_info was trying to output this
line:
printf_filtered (_("Compiled with %s debugging format.\n"), s->debugformat);
and s->debugformat was a NULL pointer.
Looking around, it sounds like when GDB iterates over objfiles, it
gets a weird file name, something like $TMPDIR/ccN8FPgQ.ltrans0.o,
instead of the expected name of the (single) object file name for this
program. The real objfile then ends up with a NULL pointer instead of
its debugformat field.
Is this expected with LTO programs? Is there a better way than saying
"unknown" when s->debugformat is NULL?
TIA