From: Doug Evans <dje@google.com>
To: gdb-patches@sourceware.org
Subject: [patch]
Date: Wed, 23 Jan 2013 19:10:00 -0000 [thread overview]
Message-ID: <yjt2vcanvhph.fsf@ruffy2.mtv.corp.google.com> (raw)
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 <dje@google.com>
* 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);
next reply other threads:[~2013-01-23 19:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-23 19:10 Doug Evans [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-01-18 4:35 [PATCH] Sergio Durigan Junior
2012-01-18 5:04 ` [PATCH] Joel Brobecker
2012-01-18 5:17 ` [PATCH] Sergio Durigan Junior
2012-01-18 12:48 ` [PATCH] Joel Brobecker
2012-01-18 14:34 ` [PATCH] Sergio Durigan Junior
2009-05-06 0:35 [PATCH] Maxim Grigoriev
2004-04-18 13:09 [PATCH] Mark Kettenis
2004-04-09 16:31 [PATCH] Mark Kettenis
2003-10-30 20:21 [PATCH] Mark Kettenis
2003-10-30 19:36 [PATCH] Mark Kettenis
2003-03-01 13:09 [PATCH] Mark Kettenis
2003-03-03 17:33 ` [PATCH] David Carlton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yjt2vcanvhph.fsf@ruffy2.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox