From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28416 invoked by alias); 14 May 2007 14:11:19 -0000 Received: (qmail 28406 invoked by uid 22791); 14 May 2007 14:11:18 -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; Mon, 14 May 2007 14:11:12 +0000 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id 237BD4B267; Mon, 14 May 2007 09:11:09 -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 E2C8C4B262; Mon, 14 May 2007 09:11:08 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1HnbGW-0002sk-Gk; Mon, 14 May 2007 10:11:08 -0400 Date: Mon, 14 May 2007 14:11: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: <20070514141108.GA27054@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> <20070410210346.GD2056@caradoc.them.org> <461C1EE8.2090600@hq.tensilica.com> <461C42AD.8030905@hq.tensilica.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <461C42AD.8030905@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-05/txt/msg00232.txt.bz2 On Tue, Apr 10, 2007 at 07:06:37PM -0700, Maxim Grigoriev wrote: > I think I missed one important detail in my patch. > Here is an improved version: > > 2007-04-10 Maxim Grigoriev > > * buildsym.c (start_subfile): Add handling missing case while > building symbol table for a compilation unit. Sorry I didn't get back to you about this. The patch is fine, but still had some formatting issues. I've applied this version - please let me know if it does not work for you. -- Daniel Jacobowitz CodeSourcery 2007-05-14 Maxim Grigoriev * buildsym.c (start_subfile): Handle absolute pathnames while comparing subfile names. Index: buildsym.c =================================================================== RCS file: /cvs/src/src/gdb/buildsym.c,v retrieving revision 1.47 diff -u -p -r1.47 buildsym.c --- buildsym.c 27 Feb 2007 22:57:42 -0000 1.47 +++ buildsym.c 14 May 2007 13:37:19 -0000 @@ -549,11 +549,27 @@ start_subfile (char *name, char *dirname for (subfile = subfiles; subfile; subfile = subfile->next) { - if (FILENAME_CMP (subfile->name, name) == 0) + char *subfile_name; + + /* If NAME is an absolute path, and this subfile is not, then + attempt to create an absolute path to compare. */ + if (IS_ABSOLUTE_PATH (name) + && !IS_ABSOLUTE_PATH (subfile->name) + && subfile->dirname != NULL) + subfile_name = concat (subfile->dirname, SLASH_STRING, + subfile->name, NULL); + else + subfile_name = subfile->name; + + if (FILENAME_CMP (subfile_name, name) == 0) { current_subfile = subfile; + if (subfile_name != subfile->name) + xfree (subfile_name); return; } + if (subfile_name != subfile->name) + xfree (subfile_name); } /* This subfile is not known. Add an entry for it. Make an entry