From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20487 invoked by alias); 23 Jan 2013 19:10:28 -0000 Received: (qmail 20449 invoked by uid 22791); 23 Jan 2013 19:10:27 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_STOCKGEN,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f74.google.com (HELO mail-qa0-f74.google.com) (209.85.216.74) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Jan 2013 19:10:20 +0000 Received: by mail-qa0-f74.google.com with SMTP id r4so135706qaq.5 for ; Wed, 23 Jan 2013 11:10:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:message-id:from:to:subject:x-gm-message-state; bh=0K8cU4RTD2JrqpAlBYlyAHlQj3LAv+n03SRC9WFCL1U=; b=fNSb82L9sdRNjtC/FOEDFC0CJrQFiUKiZLWstmQB3kttb+DE6ecN8s/HA8/K4+Ay0S EWumo6qMuJZmHbutyqJh3WXjdUq3nG4Gc1qYC0l4DLIpi5hlFl0Rgzl3iVaumgpwUoK6 8aLEOULVFGXLtdHGygy11vZWYD5rLl15SW9lEcyZq7NSn/sdgygjIOIaphGeEGYusKB9 9ICw2/KConsgK5V5oWtRObHHX4cF+1ilzWObEA8ZazKn+9JbCCtiF0OJZAc41WeP9+fE QqUfUeDhFP9O0jiNjUByp4p7ZwbXRlWJGsUfgd1k62kgnrMKPVU12M7+owiGjh3ubCmj H/lQ== X-Received: by 10.236.130.141 with SMTP id k13mr799636yhi.19.1358968219585; Wed, 23 Jan 2013 11:10:19 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id i27si941281yhe.4.2013.01.23.11.10.19 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 23 Jan 2013 11:10:19 -0800 (PST) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.17.128.107]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3A37631C21F for ; Wed, 23 Jan 2013 11:10:19 -0800 (PST) Date: Wed, 23 Jan 2013 19:10:00 -0000 Message-Id: From: Doug Evans To: gdb-patches@sourceware.org Subject: [patch] X-Gm-Message-State: ALoCoQn47JEbcdGR0iPlJRzrmZ4op129LbF6U926mYlnzRK51P0Y5CFWSSc/nrsOAVSpge+JQHH6oIYNESZLcQrg6ADVVSiCB9fqqXnTR1ChrS7D04e1qOrp7ZRO8EZIws8g0fs+7VdZY+ITIBcrORiuYxBXsBG/bu9gHH/qiq/CtYKOoapshrGnqPGZCTdoOWcXpKUSqXIBytDfY1i8p3Sp7X9V8qQGuiF//7q0Q25WJwNsQfWjPEY= 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: 2013-01/txt/msg00559.txt.bz2 Hi. linespec.c:find_linespec_symbols first tries to find "foo::bar" as method bar in class foo (via lookup_prefix_sym). If that fails it then tries to find bar in namespace foo. /* If successful, we're done. If NOT_FOUND_ERROR was not thrown, rethrow the exception that we did get. Otherwise, fall back to looking up the entire name as a symbol. This can happen with namespace::function. */ Given that, there's no need for collect_one_symbol (only used by lookup_prefix_sym) to collect namespaces. Regression tested on amd64-linux. I will commit this patch in a few days if there are no objections. 2013-01-23 Doug Evans * linespec.c (collect_one_symbol): Clarify comment. Don't collect TYPE_CODE_NAMESPACE symbols. Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.174 diff -u -p -r1.174 linespec.c --- linespec.c 1 Jan 2013 06:32:46 -0000 1.174 +++ linespec.c 23 Jan 2013 18:36:23 -0000 @@ -2539,7 +2539,7 @@ struct decode_compound_collector }; /* A callback for iterate_over_symbols that is used by - lookup_prefix_sym to collect type symbols. */ + lookup_prefix_sym to collect class symbols. */ static int collect_one_symbol (struct symbol *sym, void *d) @@ -2554,8 +2554,7 @@ collect_one_symbol (struct symbol *sym, t = SYMBOL_TYPE (sym); CHECK_TYPEDEF (t); if (TYPE_CODE (t) != TYPE_CODE_STRUCT - && TYPE_CODE (t) != TYPE_CODE_UNION - && TYPE_CODE (t) != TYPE_CODE_NAMESPACE) + && TYPE_CODE (t) != TYPE_CODE_UNION) return 1; /* Continue iterating. */ slot = htab_find_slot (collector->unique_syms, sym, INSERT);