From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11864 invoked by alias); 24 May 2009 10:49:49 -0000 Received: (qmail 11855 invoked by uid 22791); 24 May 2009 10:49:48 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp3-g21.free.fr (HELO smtp3-g21.free.fr) (212.27.42.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 24 May 2009 10:49:43 +0000 Received: from smtp3-g21.free.fr (localhost [127.0.0.1]) by smtp3-g21.free.fr (Postfix) with ESMTP id A35B38180D0 for ; Sun, 24 May 2009 12:49:36 +0200 (CEST) Received: from [192.168.0.11] (cvl92-3-82-247-217-100.fbx.proxad.net [82.247.217.100]) by smtp3-g21.free.fr (Postfix) with ESMTP id AEFAA81805D for ; Sun, 24 May 2009 12:49:33 +0200 (CEST) Message-ID: <4A1926A2.1000806@free.fr> Date: Sun, 24 May 2009 10:49:00 -0000 From: =?ISO-8859-1?Q?S=E9bastien_Granjoux?= User-Agent: Thunderbird 2.0.0.21 (X11/20090319) 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="------------060107000908080200030106" 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-05/txt/msg00529.txt.bz2 This is a multi-part message in MIME format. --------------060107000908080200030106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-length: 648 Hi All, There is in gdb 6.8 a new bug that makes breakpoints inserted at the wrong place when a program has several files with the same base name (in different directories). In some place, gdb checks only the base name of the file and so doesn't find the right place for the breakpoints. I have opened a bug report about this here: http://sourceware.org/bugzilla/show_bug.cgi?id=9583 I have found it using the mi interface but it appears in the same way with the other commands. Here is a fix attached for this bug. It checks if a full name is available and if yes uses it instead of comparing only the base name. Regards, Sébastien --------------060107000908080200030106 Content-Type: text/plain; name="ChangeLog.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ChangeLog.txt" Content-length: 126 2009-05-24 Sebastien Granjoux PR mi/9583: * symtab.c (find_line_symtab): Use full filename if available --------------060107000908080200030106 Content-Type: text/x-patch; name="fix_9583.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_9583.diff" Content-length: 1323 Index: gdb/symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.208 diff -u -r1.208 symtab.c --- gdb/symtab.c 23 May 2009 10:11:42 -0000 1.208 +++ gdb/symtab.c 24 May 2009 10:24:13 -0000 @@ -2408,9 +2408,19 @@ else best = 0; + /* Get symbol full file name if possible */ + symtab_to_fullname (symtab); + ALL_PSYMTABS (objfile, p) { - if (strcmp (symtab->filename, p->filename) != 0) + const char *fullname; + + if (symtab->fullname && (fullname = psymtab_to_fullname (p))) + { + if (FILENAME_CMP (symtab->fullname, fullname) != 0) + continue; + } + else if (FILENAME_CMP (symtab->filename, p->filename) != 0) continue; PSYMTAB_TO_SYMTAB (p); } @@ -2419,8 +2429,14 @@ { struct linetable *l; int ind; + const char *fullname; - if (strcmp (symtab->filename, s->filename) != 0) + if (symtab->fullname && (fullname = symtab_to_fullname (s))) + { + if (FILENAME_CMP (symtab->fullname, fullname) != 0) + continue; + } + else if (FILENAME_CMP (symtab->filename, s->filename) != 0) continue; l = LINETABLE (s); ind = find_line_common (l, line, &exact); --------------060107000908080200030106--