From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17802 invoked by alias); 9 Jun 2011 13:47:37 -0000 Received: (qmail 17793 invoked by uid 22791); 9 Jun 2011 13:47:36 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Thu, 09 Jun 2011 13:47:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p59DlKgA007125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Jun 2011 09:47:20 -0400 Received: from host1.jankratochvil.net (ovpn-113-23.phx2.redhat.com [10.3.113.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p59DlIS8020027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Jun 2011 09:47:20 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p59DlHXK014295; Thu, 9 Jun 2011 15:47:17 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p59DlGXv014286; Thu, 9 Jun 2011 15:47:16 +0200 Date: Thu, 09 Jun 2011 13:47:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [patch 0/2] physname reg.: C++ breakpoints / linespec fixes Message-ID: <20110609134715.GA13772@host1.jankratochvil.net> References: <20110605202615.GA20427@host1.jankratochvil.net> <20110608144307.GA32073@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110608144307.GA32073@host1.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-06/txt/msg00131.txt.bz2 On Wed, 08 Jun 2011 16:43:07 +0200, Jan Kratochvil wrote: > But for example `file:func' is currently implemented only in linespec and it > should be supported even by expressions - see the bottom example. [...] > ==> a/f.c <== > static void f (void) {} > void x (void) { f (); } > > ==> b/f.c <== > static void f (void) {} > void y (void) { f (); } > > ==> m.c <== > extern void x (void); > extern void y (void); > int > main (void) > { > x (); > y (); > return 0; > } > > gcc -o m a/f.c b/f.c m.c -Wall -g > (gdb) b a/f.c:f > Breakpoint 1 at 0x400478: file a/f.c, line 1. > (gdb) b b/f.c:f > Breakpoint 2 at 0x40048c: file b/f.c, line 1. > (gdb) b f > Note: breakpoint 2 also set at pc 0x40048c. > Breakpoint 3 at 0x40048c: file b/f.c, line 1. > (gdb) p f > $1 = {void (void)} 0x400488 > (gdb) p a/f.c:f > No symbol "a" in current context. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = it should work. > (gdb) p b/f.c:f > No symbol "b" in current context. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = it should work. I forgot it is doable in expressions, just with a different syntax than in linespec: (gdb) p 'a/f.c'::f $1 = {void (void)} 0x400474 (gdb) p 'b/f.c'::f $2 = {void (void)} 0x400488 Regards, Jan