From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21838 invoked by alias); 8 Feb 2012 20:10:20 -0000 Received: (qmail 21828 invoked by uid 22791); 8 Feb 2012 20:10:18 -0000 X-SWARE-Spam-Status: No, hits=-7.0 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; Wed, 08 Feb 2012 20:10:02 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q18KA1Jt021188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 8 Feb 2012 15:10:01 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q18KA1cv032297; Wed, 8 Feb 2012 15:10:01 -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 q18K9xbS024376; Wed, 8 Feb 2012 15:10:00 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFC: extend symtabs_from_filename skipping for C++ Date: Wed, 08 Feb 2012 20:10:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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/msg00112.txt.bz2 I'd appreciate comments on this. Barring comments I will check it in after a couple days. A while ago Doug committed a patch to change linespec to skip symtabs_from_filename when possible. This was an important performance improvement. We got a bug report in Red Hat bugzilla asking that this be extended to C++ qualified names: https://bugzilla.redhat.com/show_bug.cgi?id=787487 This patch implements this idea. Built and regtested on x86-64 Fedora 15. Tom 2012-02-08 Tom Tromey * linespec.c (decode_line_internal): Skip symtabs_from_filename when we have a C++ qualified name. diff --git a/gdb/linespec.c b/gdb/linespec.c index da88d17..3f53b8e 100644 --- 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] != ':') { TRY_CATCH (file_exception, RETURN_MASK_ERROR) {