From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6072 invoked by alias); 10 Apr 2007 23:34:08 -0000 Received: (qmail 6063 invoked by uid 22791); 10 Apr 2007 23:34:08 -0000 X-Spam-Check-By: sourceware.org Received: from hq.tensilica.com (HELO mailapp.tensilica.com) (65.205.227.29) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Apr 2007 00:34:04 +0100 Received: from localhost ([127.0.0.1]) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1HbPqb-0004mk-3n; Tue, 10 Apr 2007 16:34:01 -0700 Received: from mailapp.tensilica.com ([127.0.0.1]) by localhost (mailapp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15210-06; Tue, 10 Apr 2007 16:34:00 -0700 (PDT) Received: from maxim_fc5.hq.tensilica.com ([192.168.11.68]) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1HbPqa-0004md-L9; Tue, 10 Apr 2007 16:34:00 -0700 Message-ID: <461C1EE8.2090600@hq.tensilica.com> Date: Tue, 10 Apr 2007 23:34:00 -0000 From: Maxim Grigoriev User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: Maxim Grigoriev , gdb-patches@sources.redhat.com, Daniel Jacobowitz Subject: Re: Handling corner case in building symbol table when "debug_line" includes compilation directory References: <45F8A771.2060008@hq.tensilica.com> <20070315022735.GA9613@caradoc.them.org> <45F8CBDF.9090501@hq.tensilica.com> <20070410210346.GD2056@caradoc.them.org> In-Reply-To: <20070410210346.GD2056@caradoc.them.org> Content-Type: multipart/mixed; boundary="------------070506080204030202040001" 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/msg00122.txt.bz2 This is a multi-part message in MIME format. --------------070506080204030202040001 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1084 Daniel Jacobowitz wrote: . . . . . . >> + 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 I didn't manage to create a test case when "subfile->dirname" is different from "dirname". But, I think your comment is correct. I followed all your suggestions and attached new patch. Thanks for looking into this. 2007-04-10 Maxim Grigoriev * buildsym.c (start_subfile): Add handling missing case while building symbol table for a compilation unit. --------------070506080204030202040001 Content-Type: text/x-patch; name="PATCH2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="PATCH2.diff" Content-length: 869 Index: gdb/buildsym.c =================================================================== RCS file: /cvs/src/src/gdb/buildsym.c,v retrieving revision 1.47 diff -u -r1.47 buildsym.c --- gdb/buildsym.c 27 Feb 2007 22:57:42 -0000 1.47 +++ gdb/buildsym.c 10 Apr 2007 23:22:49 -0000 @@ -549,9 +549,19 @@ for (subfile = subfiles; subfile; subfile = subfile->next) { - if (FILENAME_CMP (subfile->name, name) == 0) + char *subfile_name; + 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; } } --------------070506080204030202040001--