From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6926 invoked by alias); 14 Nov 2014 00:58:40 -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 6917 invoked by uid 89); 14 Nov 2014 00:58:40 -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-oi0-f74.google.com Received: from mail-oi0-f74.google.com (HELO mail-oi0-f74.google.com) (209.85.218.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 14 Nov 2014 00:58:38 +0000 Received: by mail-oi0-f74.google.com with SMTP id u20so2201260oif.3 for ; Thu, 13 Nov 2014 16:58:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:cc:date:message-id:mime-version :content-type; bh=JI7bi0P7aKn3iZbij1+5xVsM4nMi1u8WszA/atfyS4U=; b=EMqIF9h332hF2KwybXThk/k7m0SjDRuVv+5W3dknXBwVUYGP9g0lfEZKCUNsoLCm3y QaDUJ3aSozwmEXwQW7nEz5DhCJHqdn1plu8wAh20dbeDQKsPLJhvQPVEwwaGe+oSi8ZJ 5cbd0y2VVfTsWMWgRYDjrXcZsd3hxjj/o2tPQmtPsjaeJ04NWrCJ4ueHTTxQgNhog7oQ +KlFwyy0zP25XC+2KtSoDJRx9CLM/im2RH3dUF3p+C2W5JhbjoPgNSbrkP6lIGG8v7/T vjbqw22vP3Cw5ipKK+coyiKqW9QnJN+NGQZlFhxg+nx1yResiCQNK0p5Z6nF/0ptpzCF 8ROA== X-Gm-Message-State: ALoCoQkb7LupWxmcS3AKDR6pqIiRig80+zMoV3aHoqVcPLC/sWiO4YrSapHKYz3JRZwBijTsHScZ X-Received: by 10.50.73.201 with SMTP id n9mr2532240igv.8.1415926716776; Thu, 13 Nov 2014 16:58:36 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id n63si1133926yho.5.2014.11.13.16.58.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 16:58:36 -0800 (PST) Received: from ruffy.mtv.corp.google.com ([172.17.128.44]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTPS id NKvjL0WT.1; Thu, 13 Nov 2014 16:58:36 -0800 From: Doug Evans To: gdb-patches@sourceware.org Subject: [COMMITTED PATCH] Fix PR symtab/17591 cc: saugustine@google.com Date: Fri, 14 Nov 2014 00:58:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00287.txt.bz2 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) {