From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22636 invoked by alias); 4 Jan 2012 20:42:38 -0000 Received: (qmail 22625 invoked by uid 22791); 4 Jan 2012 20:42:37 -0000 X-SWARE-Spam-Status: No, hits=-7.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Jan 2012 20:42:22 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q04KfxTr018038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 4 Jan 2012 15:41:59 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q04Kfx42025342; Wed, 4 Jan 2012 15:41:59 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q04Kfvp3025250; Wed, 4 Jan 2012 15:41:57 -0500 From: Tom Tromey To: Richard Guenther Cc: gdb@sourceware.org, brobecker@adacore.com Subject: Re: Pending breakpoints on lines that don't exist References: Date: Wed, 04 Jan 2012 20:42:00 -0000 In-Reply-To: (Richard Guenther's message of "Wed, 4 Jan 2012 15:28:40 +0100 (CET)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00010.txt.bz2 >>>>> "Richard" == Richard Guenther writes: Richard> (gdb) b expr.c:10850 Richard> No line 10850 in file "/space/rguenther/src/svn/trunk/libcpp/expr.c". Richard> because I meant /space/rguenther/src/svn/trunk/gcc/expr.c! Now Richard> getting the pending breakpoing seems to be even worse. I'd Richard> expect sth like [...] In 7.4, a linespec like "expr.c:10850" will match line 10850 in all files named expr.c. E.g., from the test suite: (gdb) b thefile.cc:14 Breakpoint 1 at 0x400592: thefile.cc:14. (2 locations) (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 1.1 y 0x0000000000400592 in n(int) at ../../../archer/gdb/testsuite/gdb.linespec/base/two/thefile.cc:14 1.2 y 0x0000000000400556 in m(int) at ../../../archer/gdb/testsuite/gdb.linespec/base/one/thefile.cc:14 This breakpoint got locations in two different files, both named 'thefile.cc'. The rationale behind this is that gdb should not guess what you meant. The right thing also happens if one "thefile.cc" has the indicated line but the other does not. Richard> it's especially bad that gdb does not recognize Richard> (gdb) b gcc/expr.c:10850 Richard> but requires a full path (bah). Yeah, this is still a problem. I intend to fix it at some point, but it is too late for 7.4. I think what makes sense here is to just do the obvious check of the user-supplied name against the final components of the file names. Tom