From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32037 invoked by alias); 10 Feb 2012 13:34:32 -0000 Received: (qmail 31839 invoked by uid 22791); 10 Feb 2012 13:34:31 -0000 X-SWARE-Spam-Status: No, hits=-6.6 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; Fri, 10 Feb 2012 13:33:54 +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 q1ADXrjL003054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 08:33:53 -0500 Received: from host2.jankratochvil.net (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q1ADXotG005368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 10 Feb 2012 08:33:52 -0500 Date: Fri, 10 Feb 2012 13:34:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: extend symtabs_from_filename skipping for C++ Message-ID: <20120210133349.GA12398@host2.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 2012-02/txt/msg00185.txt.bz2 On Wed, 08 Feb 2012 21:09:59 +0100, Tom Tromey wrote: > --- a/gdb/linespec.c > +++ b/gdb/linespec.c > @@ -912,9 +912,11 @@ decode_line_internal (struct linespec_state *self, char **argptr) > /* First things first: if ARGPTR starts with a filename, get its > symtab and strip the filename from ARGPTR. > Avoid calling symtab_from_filename if we know can, > - it can be expensive. */ > + it can be expensive. We know we can avoid the call if we see a > + single word (e.g., "break NAME") or if we see a qualified C++ > + name ("break QUAL::NAME"). */ > > - if (*p != '\0') > + if (*p != '\0' && p[1] != ':') I failed to find a countercase but wouldn't you prefer: - if (*p != '\0') + if (*p != '\0' && !(p[0] == ':' && p[1] == ':')) (I did not regression test it.) I find it OK either way. Thanks, Jan