From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27555 invoked by alias); 9 Nov 2009 21:38:11 -0000 Received: (qmail 27547 invoked by uid 22791); 9 Nov 2009 21:38:10 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp1-g21.free.fr (HELO smtp1-g21.free.fr) (212.27.42.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Nov 2009 21:38:06 +0000 Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id B6343940150; Mon, 9 Nov 2009 22:37:59 +0100 (CET) Received: from [192.168.0.11] (cvl92-3-82-247-217-100.fbx.proxad.net [82.247.217.100]) by smtp1-g21.free.fr (Postfix) with ESMTP id AA33C94011B; Mon, 9 Nov 2009 22:37:56 +0100 (CET) Message-ID: <4AF88BB4.2030101@free.fr> Date: Mon, 09 Nov 2009 21:38:00 -0000 From: =?ISO-8859-1?Q?S=E9bastien_Granjoux?= User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sourceware.org Subject: Re: Fix breakpoints when several source files have the same name References: <4AF87BF4.5040303@free.fr> <20091109210849.GS4557@adacore.com> In-Reply-To: <20091109210849.GS4557@adacore.com> Content-Type: multipart/mixed; boundary="------------000206040202050103090308" 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: 2009-11/txt/msg00190.txt.bz2 This is a multi-part message in MIME format. --------------000206040202050103090308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-length: 619 Hi Joel, Joel Brobecker a écrit : > Would you mind sending unified diffs, next time. There seems to be > a preference of unified diffs over context diffs. No, problem. > Periods need to be followed by 2 spaces (GNU Coding Standards). I realize > that the text you started with had the problem too! Also, I believe there > is a typo "symbol has no full name" -> "symtab has no full name"? I have fixed all this in the attached patch. > Pre-approved with the changes above. Have your assignment request > come through, yet? Yes, I have received the confirmation a week ago. Thanks for your review. Sébastien --------------000206040202050103090308 Content-Type: text/plain; name="ChangeLog.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ChangeLog.txt" Content-length: 200 2009-11-09 Sebastien Granjoux PR mi/9583: * symtab.c (find_line_symtab, append_exact_match_to_sals) (expand_line_sal): Use full filename when setting breakpoints if available --------------000206040202050103090308 Content-Type: text/plain; name="fix_multiple_breakpoint4.path" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_multiple_breakpoint4.path" Content-length: 3358 Index: gdb/symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.216 diff -U3 -r1.216 symtab.c --- gdb/symtab.c 19 Oct 2009 09:51:42 -0000 1.216 +++ gdb/symtab.c 9 Nov 2009 21:29:00 -0000 @@ -2416,18 +2416,25 @@ ALL_PSYMTABS (objfile, p) { - if (strcmp (symtab->filename, p->filename) != 0) + if (FILENAME_CMP (symtab->filename, p->filename) != 0) continue; PSYMTAB_TO_SYMTAB (p); } + /* Get symbol full file name if possible. */ + symtab_to_fullname (symtab); + ALL_SYMTABS (objfile, s) { struct linetable *l; int ind; - if (strcmp (symtab->filename, s->filename) != 0) + if (FILENAME_CMP (symtab->filename, s->filename) != 0) continue; + if (symtab->fullname != NULL + && symtab_to_fullname (s) != NULL + && FILENAME_CMP (symtab->fullname, s->fullname) != 0) + continue; l = LINETABLE (s); ind = find_line_common (l, line, &exact); if (ind >= 0) @@ -4591,12 +4598,14 @@ } /* Helper to expand_line_sal below. Search in the symtabs for any - linetable entry that exactly matches FILENAME and LINENO and append - them to RET. If there is at least one match, return 1; otherwise, - return 0, and return the best choice in BEST_ITEM and BEST_SYMTAB. */ + linetable entry that exactly matches FULLNAME and LINENO and append + them to RET. If FULLNAME is NULL or if a symtab has no full name, + use FILENAME and LINENO instead. If there is at least one match, + return 1; otherwise, return 0, and return the best choice in BEST_ITEM + and BEST_SYMTAB. */ static int -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) @@ -4612,10 +4621,14 @@ ALL_PSPACES (pspace) ALL_PSPACE_SYMTABS (pspace, objfile, symtab) { - if (strcmp (filename, symtab->filename) == 0) + if (FILENAME_CMP (filename, symtab->filename) == 0) { struct linetable *l; int len; + if (fullname != NULL + && symtab_to_fullname (symtab) != NULL + && FILENAME_CMP (fullname, symtab->fullname) != 0) + continue; l = LINETABLE (symtab); if (!l) continue; @@ -4700,7 +4713,7 @@ ALL_PSPACES (pspace) ALL_PSPACE_PSYMTABS (pspace, objfile, psymtab) { - if (strcmp (match_filename, psymtab->filename) == 0) + if (FILENAME_CMP (match_filename, psymtab->filename) == 0) { set_current_program_space (pspace); @@ -4712,10 +4725,13 @@ /* Now search the symtab for exact matches and append them. If none is found, append the best_item and all its exact matches. */ - exact = append_exact_match_to_sals (match_filename, lineno, + symtab_to_fullname (sal.symtab); + exact = append_exact_match_to_sals (sal.symtab->filename, + sal.symtab->fullname, lineno, &ret, &best_item, &best_symtab); if (!exact && best_item) - append_exact_match_to_sals (best_symtab->filename, best_item->line, + append_exact_match_to_sals (best_symtab->filename, + best_symtab->fullname, best_item->line, &ret, &best_item, &best_symtab); } --------------000206040202050103090308--