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: Eli Zaretskii <eliz at gnu dot org>
- To: tromey at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 15 Feb 2014 18:58:05 +0200
- 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> <87ob2ct9ua dot fsf at fleche dot redhat dot com> <83ha84ruai dot fsf at gnu dot org> <87d2ist7ua dot fsf at fleche dot redhat dot com> <83d2isrt08 dot fsf at gnu dot org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 12 Feb 2014 22:11:19 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: gdb-patches@sourceware.org
>
> Yes, the DWARF 2 debuginfo _is_ recorded, but for a file name that has
> nothing to do with the name of the source file from which the program
> was compiled.
This happens in read_file_scope, which is called from process_die.
read_file_scope calls find_file_and_directory, which uses DW_AT_name
attribute to get the file name. And that file name turns out to be
$TMPDIR/ccN8FPgQ.ltrans0.o instead of the expected foo.c, which is the
source file I compiled. So the DWARF 2 debug info is set for that
temporary file name, instead of the source file.
The call to process_die happens as part of set_initial_language, which
looks for a symbol "main".
The name of the source file is available in the psymtab that is
accessible from the die (via the objfile struct). the question is
what should be the conditions under which we need to look there.
E.g., can the fact that DW_AT_name returns a name of an object file be
that condition?