From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21191 invoked by alias); 1 Oct 2009 21:45:16 -0000 Received: (qmail 21181 invoked by uid 22791); 1 Oct 2009 21:45:15 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Oct 2009 21:45:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B0EC22BAB7B; Thu, 1 Oct 2009 17:45:04 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id N6DSaFd5M28d; Thu, 1 Oct 2009 17:45:04 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0C33C2BABC1; Thu, 1 Oct 2009 17:45:02 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 0E997F593D; Thu, 1 Oct 2009 14:44:59 -0700 (PDT) Date: Thu, 01 Oct 2009 21:45:00 -0000 From: Joel Brobecker To: S?bastien Granjoux Cc: gdb-patches@sourceware.org Subject: Re: Fix breakpoints when several source files have the same name Message-ID: <20091001214459.GR10338@adacore.com> References: <4AC51974.7010501@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AC51974.7010501@free.fr> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-10/txt/msg00032.txt.bz2 Sebastien, Do you have a copyright assignment on file with the FSF? I cannot seem to be able to find you in our records, at least not by using your name. If you don't, then I am afraid that we cannot accept this contribution until you do. This is a bit of a lengthy process, so let me know if you need the request forms. > 2009-10-01 Sebastien Granjoux > > PR mi/9583: > * symtab.c (find_line_symtab, append_exact_match_to_sals): > Use full filename if available Overall, this looks OK to me (good catch on the FILENAME_CMP!). I just have a few comments, little nits: > + /* Get symbol full file name if possible */ All comments should be full sentences, meaning that they should start with capital letter, and end with a period. The period should also be followed by 2 spaces, so: /* Get symbol full file name if possible. */ > + if ((symtab->fullname != NULL) > + && (symtab_to_fullname (s) != NULL) > + && (FILENAME_CMP (symtab->fullname, s->fullname) != 0)) You have unecessary parenthesis, and we avoid that in GDB (we find that this makes the code harder to read - if only because it uses a different style than usual). if (symtab->fullname != NULL && symtab_to_fullname (s) != NULL && FILENAME_CMP (symtab->fullname, s->fullname) != 0) > -append_exact_match_to_sals (char *filename, int lineno, > +append_exact_match_to_sals (char *filename, > + char *fullname, int lineno, > struct symtabs_and_lines *ret, > struct linetable_entry **best_item, > struct symtab **best_symtab) The function comment needs to be updated. Can you also put all first 3 arguments on the same line. The line break is unnecessary. > + if ((fullname != NULL) > + && (symtab_to_fullname (symtab) != NULL) > + && (FILENAME_CMP (fullname, symtab->fullname) != 0)) > + continue; Same as above with the extra parens. -- Joel