From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21750 invoked by alias); 14 Nov 2014 01:10:37 -0000 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 Received: (qmail 21657 invoked by uid 89); 14 Nov 2014 01:10:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f175.google.com Received: from mail-vc0-f175.google.com (HELO mail-vc0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 14 Nov 2014 01:10:34 +0000 Received: by mail-vc0-f175.google.com with SMTP id hy10so354268vcb.34 for ; Thu, 13 Nov 2014 17:10:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=hmtH/ZZk9Rdz0Oq5UlDSmI1Lh+/VBtqZWfh1f/8cTes=; b=Ig54gvCa3Nvr8sSLg9ohbTmVfQ5c3WLenx5pzCqwcVlPB1Cb4hc0MmyvVDlizddTwj BSkqv+vMQMpPwfIeWHOHkJrVU+815kfg8bSfGUSRUArRT2V9RoIg76F9A0DsyiBZDDfl krRudAtNEbAVvhvFrX28bq9Pa5RNy0YL38IBqwxnMmfMRerO5gz/c/M/BdpEd5NhLHQG uQ2mY+mRP5Rcd7v2AeIqopUMj1N1+hgsxRV1WclZ3bqMFACCeCMRXQBl41JIYA6Y2XyK hM7dOk6SaVPJ0SwzMPIZiOS0F9faFNM4JWgBvd1pe0gD80r41eIm0hxW4ICvlqGdUNiT 68Ew== X-Gm-Message-State: ALoCoQnvHt+Dba25GZwz/YaWTA533sqXrKS1UyxG9Q7mfaL8+3hwTNNfztt3hNFxWoo4AJzQ5PXJ MIME-Version: 1.0 X-Received: by 10.220.139.147 with SMTP id e19mr4485716vcu.27.1415927432213; Thu, 13 Nov 2014 17:10:32 -0800 (PST) Received: by 10.52.114.101 with HTTP; Thu, 13 Nov 2014 17:10:32 -0800 (PST) In-Reply-To: References: Date: Fri, 14 Nov 2014 01:10:00 -0000 Message-ID: Subject: Re: [COMMITTED PATCH] Fix PR symtab/17591 From: Doug Evans To: gdb-patches Cc: Sterling Augustine Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00289.txt.bz2 On Thu, Nov 13, 2014 at 4:58 PM, Doug Evans wrote: > Hi. > > This patch fixes pr 17591. > Regression tested on amd64-linux. > > The removing of the parens wasn't taking into account > looking up "(anonymous namespace)". > > It turns out there can be a significant performance cost. > The lookup would use "" which in the program where this > was found had an entry in .gdb_index with ~1000 CUs, > none of which had (anonymous namespace), > so we were needlessly reading in a *lot* of debug info. > > Before: > > (gdb) pt obj > type = ... > Command execution time: 50.712058 (cpu), 52.275078 (wall) > Space used: 2379862016 (+2180878336 for this command) > #symtabs: 150433 (+150064), #primary symtabs: 2090 (+2081), #blocks: 774710 (+773450) > > After: > > (gdb) pt obj > type = ... > Command execution time: 0.850209 (cpu), 0.864219 (wall) > Space used: 232112128 (+33136640 for this command) > #symtabs: 3040 (+2671), #primary symtabs: 107 (+98), #blocks: 22595 (+21335) > > 2014-11-13 Doug Evans > > PR symtab/17591 > * dwarf2read.c (find_slot_in_mapped_hash): Handle > "(anonymous namespace)". > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index ce37adf..0c97447 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -2917,7 +2917,11 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name, > { > /* NAME is already canonical. Drop any qualifiers as .gdb_index does > not contain any. */ > - const char *paren = strchr (name, '('); > + const char *paren = NULL; > + > + /* Need to handle "(anonymous namespace)". */ > + if (*name != '(') > + paren = strchr (name, '('); > > if (paren) > { Bleah. I was focused on the case at hand and wasn't thinking more generally. I'll submit a better patch tomorrow.