This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB 7.7 crashes on LTO-built executable
- From: Tom Tromey <tromey at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 12 Feb 2014 12:22:21 -0700
- Subject: Re: GDB 7.7 crashes on LTO-built executable
- Authentication-results: sourceware.org; auth=none
- References: <83lhxgs05d dot fsf at gnu dot org> <83ioskrznz dot fsf at gnu dot org>
>> Is there a better way than saying "unknown" when s->debugformat is
>> NULL?
Eli> A better way to fix the crash, I mean.
I looked a tiny bit.
I don't know what code path hits this, but basically something is not
calling record_debugformat when it ought to. So one way to fix the bug
would be to track down what this is. I would probably start by finding
where the symtab in question was allocated.
The current design seems fragile in that it requires sprinkling these
calls to record_debugformat all around.
I did find this comment in buildsym.c:
/* Save the debug format string (if any) in the symtab. */
symtab->debugformat = subfile->debugformat;
And it does seem that nothing tries to ensure that a subfile's
debugformat is set. So perhaps fixing it at the printf site is fine; or
alternatively changing the field's initialization in start_subfile.
Though it seems better to try to fix the value properly; since "unknown"
can't ever really be correct -- it it's unknown one wonders how gdb
could have read it :)
Tom