From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20160 invoked by alias); 15 Feb 2014 16:58:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20146 invoked by uid 89); 15 Feb 2014 16:58:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout27.012.net.il Received: from mtaout27.012.net.il (HELO mtaout27.012.net.il) (80.179.55.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Feb 2014 16:58:08 +0000 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N1100A00R1DLJ00@mtaout27.012.net.il> for gdb-patches@sourceware.org; Sat, 15 Feb 2014 18:56:34 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N11003GVR2ATR80@mtaout27.012.net.il>; Sat, 15 Feb 2014 18:56:34 +0200 (IST) Date: Sat, 15 Feb 2014 16:58:00 -0000 From: Eli Zaretskii Subject: Re: GDB 7.7 crashes on LTO-built executable In-reply-to: <83d2isrt08.fsf@gnu.org> To: tromey@redhat.com Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a9dsb9eq.fsf@gnu.org> References: <83lhxgs05d.fsf@gnu.org> <83ioskrznz.fsf@gnu.org> <87ob2ct9ua.fsf@fleche.redhat.com> <83ha84ruai.fsf@gnu.org> <87d2ist7ua.fsf@fleche.redhat.com> <83d2isrt08.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00510.txt.bz2 > Date: Wed, 12 Feb 2014 22:11:19 +0200 > From: Eli Zaretskii > 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?