From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4844 invoked by alias); 10 Apr 2007 21:03:53 -0000 Received: (qmail 4836 invoked by uid 22791); 10 Apr 2007 21:03:52 -0000 X-Spam-Check-By: sourceware.org Received: from return.false.org (HELO return.false.org) (66.207.162.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Apr 2007 22:03:50 +0100 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id A12D24B267; Tue, 10 Apr 2007 16:03:48 -0500 (CDT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by return.false.org (Postfix) with ESMTP id 5106D4B262; Tue, 10 Apr 2007 16:03:48 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HbNVC-0001M2-Pc; Tue, 10 Apr 2007 17:03:46 -0400 Date: Tue, 10 Apr 2007 21:03:00 -0000 From: Daniel Jacobowitz To: Maxim Grigoriev Cc: gdb-patches@sources.redhat.com Subject: Re: Handling corner case in building symbol table when "debug_line" includes compilation directory Message-ID: <20070410210346.GD2056@caradoc.them.org> Mail-Followup-To: Maxim Grigoriev , gdb-patches@sources.redhat.com References: <45F8A771.2060008@hq.tensilica.com> <20070315022735.GA9613@caradoc.them.org> <45F8CBDF.9090501@hq.tensilica.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45F8CBDF.9090501@hq.tensilica.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes 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 X-SW-Source: 2007-04/txt/msg00111.txt.bz2 On Wed, Mar 14, 2007 at 09:30:23PM -0700, Maxim Grigoriev wrote: > I've attached the patch separately. Now, it should be fine. Sorry for > inconvenience. Actually, I apologize - looks like it was my mailer to blame... > So the compilation directory is listed in the directory table. And, there is > a reference from the file table pointing to this directory. > > Normally, we wouldn't see a compilation directory in a line table prologue. Right. Now I understand. This stuff is all quite fragile; we don't keep good track of what dirname is which. I think I puzzled it out, but... > + char *subfile_name; > + if (IS_ABSOLUTE_PATH(name) && !IS_ABSOLUTE_PATH (subfile->name)) > + { > + subfile_name = concat (dirname, SLASH_STRING, > + subfile->name, (char *)NULL); Isn't that the wrong DIRNAME? That's supposed to be a prefix to NAME, but SUBFILE might be in a different directory. You need subfile->dirname (if it's not NULL). As for the patch, watch out for your formatting. Spaces around parentheses and you don't need braces around a single statement. Also, creating a cleanup in a function that doesn't call do_cleanups is bad. It would be better to free it immediately when we're done with it. -- Daniel Jacobowitz CodeSourcery