From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23513 invoked by alias); 1 Oct 2009 21:05:09 -0000 Received: (qmail 23502 invoked by uid 22791); 1 Oct 2009 21:05:08 -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; Thu, 01 Oct 2009 21:05:02 +0000 Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id 39EB4940130 for ; Thu, 1 Oct 2009 23:04:55 +0200 (CEST) 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 052D1940193 for ; Thu, 1 Oct 2009 23:04:52 +0200 (CEST) Message-ID: <4AC51974.7010501@free.fr> Date: Thu, 01 Oct 2009 21:05:00 -0000 From: =?ISO-8859-1?Q?S=E9bastien_Granjoux?= User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Fix breakpoints when several source files have the same name Content-Type: multipart/mixed; boundary="------------060503060102000705060807" 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-10/txt/msg00028.txt.bz2 This is a multi-part message in MIME format. --------------060503060102000705060807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-length: 515 Hi All, I have updated my patch to fix a bug in gdb 6.8 that makes breakpoints inserted at the wrong place when a program has several files with the same base name (in different directories). I have checked my fix on the latest development version and updated it because the bug has moved a bit. Moreover I have reduced the number of calls of the symtab_to_fullname function as requested. There is a bug report opened about this here: http://sourceware.org/bugzilla/show_bug.cgi?id=9583 Regards, Sébastien --------------060503060102000705060807 Content-Type: text/plain; name="ChangeLog.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ChangeLog.txt" Content-length: 155 2009-10-01 Sebastien Granjoux PR mi/9583: * symtab.c (find_line_symtab, append_exact_match_to_sals): Use full filename if available --------------060503060102000705060807 Content-Type: text/x-patch; name="fix_multiple_breakpoint.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_multiple_breakpoint.patch" Content-length: 2526 Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.215 diff -U3 -r1.215 symtab.c --- symtab.c 24 Aug 2009 22:00:55 -0000 1.215 +++ symtab.c 1 Oct 2009 20:42:07 -0000 @@ -2410,18 +2410,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) @@ -4581,7 +4588,8 @@ 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) @@ -4595,10 +4603,14 @@ ALL_SYMTABS (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; @@ -4684,10 +4696,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 (sal.symtab->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); } --------------060503060102000705060807--