From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8111 invoked by alias); 18 Apr 2006 13:04:39 -0000 Received: (qmail 8103 invoked by uid 22791); 18 Apr 2006 13:04:39 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 18 Apr 2006 13:04:37 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FVpse-0002id-Mr; Tue, 18 Apr 2006 09:04:32 -0400 Date: Tue, 18 Apr 2006 13:04:00 -0000 From: Daniel Jacobowitz To: Frederic RISS Cc: Jim Blandy , GDB Patches Subject: Re: [RFC] Don't lose compilation directory in Dwarf2 line-tables Message-ID: <20060418130432.GC10130@nevyn.them.org> Mail-Followup-To: Frederic RISS , Jim Blandy , GDB Patches References: <1144927446.14807.561.camel@crx549.cro.st.com> <8f2776cb0604131049i69e9b20fv78e60c023f245e56@mail.gmail.com> <1144999942.14807.721.camel@crx549.cro.st.com> <8f2776cb0604140041o63c56c2xa9113d3c4ee259d@mail.gmail.com> <1145002976.14807.744.camel@crx549.cro.st.com> <20060414140449.GA14270@nevyn.them.org> <1145026289.14807.816.camel@crx549.cro.st.com> <1145363529.14807.848.camel@crx549.cro.st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1145363529.14807.848.camel@crx549.cro.st.com> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00238.txt.bz2 On Tue, Apr 18, 2006 at 02:32:09PM +0200, Frederic RISS wrote: > All this file matching seems quite fragile, and the current approach > will get it wrong sometimes. Shouldn't the loop in dwarf2_start_subfile > be killed in favor of a search using both xfullpath(dirname'/'filename) > at the start of buildsym.c::start_subfile? The problem with using xfullpath is that it requires the file to exist and already be found; as long as we are consistent, it's not too fragile, because we're checking against our own output. > @@ -6757,6 +6756,19 @@ dwarf2_start_subfile (char *filename, ch > } > xfree (fullname); > } > + > + /* Make the dirname as absolute as possible. */ Two spaces after periods please. > + > + if (dirname == NULL) > + dirname = comp_dir; > + else > + if (!IS_ABSOLUTE_PATH (dirname) && comp_dir != NULL) > + { > + dirname = concat (comp_dir, SLASH_STRING, dirname, (char *)NULL); > + /* do_cleanups is called after line info procesing */ > + make_cleanup (xfree, dirname); Comment formatting again (and "processing"). But this is really nasty. Why not free it before we return? We don't return dirname, and start_subfile takes a copy. -- Daniel Jacobowitz CodeSourcery