From: Keith Seitz <keiths@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: "gp >> \"gdb-patches@sourceware.org ml\"" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Fix c++/16253 (tag/variable name collision)
Date: Tue, 25 Mar 2014 18:11:00 -0000 [thread overview]
Message-ID: <5331BB0D.4010606@redhat.com> (raw)
In-Reply-To: <20140324141527.GM4282@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
On 03/24/2014 07:15 AM, Joel Brobecker wrote:
> This may not be directly related to your patch. I seem to have seen
> some unexplainable behavior in GDB occasionally in the recent past
> making me wonder whether there might be something fishy in the symbol
> lookup for Ada.
It is my patch that is causing the problems.
In this case, add_nonlocal_symbols is calling the qf
map_matching_symbols method which is calling match_partial_symbol. Since
this method now does strict matches against domain, an explicit check
for STRUCT_DOMAIN matches must be added.
Give this amendment a shot and see how it goes. I suspect there are
probably one or two more places where this occurs. [The easiest thing to
do is audit any function which uses "VAR_DOMAIN".]
Keith
[-- Attachment #2: 16253-amended-1.patch --]
[-- Type: text/x-patch, Size: 1444 bytes --]
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 00728bf..94c6cf8 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5336,13 +5336,33 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
data.objfile = objfile;
if (is_wild_match)
- objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
- aux_add_nonlocal_symbols, &data,
- wild_match, NULL);
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
+ aux_add_nonlocal_symbols,
+ &data, wild_match, NULL);
+ if (domain == VAR_DOMAIN)
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name,
+ STRUCT_DOMAIN, global,
+ aux_add_nonlocal_symbols,
+ &data, wild_match, NULL);
+ }
+ }
else
- objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
- aux_add_nonlocal_symbols, &data,
- full_match, compare_names);
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
+ aux_add_nonlocal_symbols,
+ &data, full_match,
+ compare_names);
+ if (domain == VAR_DOMAIN)
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name,
+ STRUCT_DOMAIN, global,
+ aux_add_nonlocal_symbols,
+ &data, full_match,
+ compare_names);
+ }
+ }
}
if (num_defns_collected (obstackp) == 0 && global && !is_wild_match)
next prev parent reply other threads:[~2014-03-25 18:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 18:12 Keith Seitz
2014-03-24 14:15 ` Joel Brobecker
2014-03-25 18:11 ` Keith Seitz [this message]
2014-03-26 13:32 ` Joel Brobecker
2014-03-26 13:40 ` Joel Brobecker
2014-03-26 15:34 ` Keith Seitz
2014-04-10 18:54 ` Keith Seitz
2014-04-10 20:29 ` Tom Tromey
2014-05-28 17:55 ` Doug Evans
2014-04-17 19:03 ` Regression for gdb.cp/koenig.exp: p entry (c) [Re: [RFA] Fix c++/16253 (tag/variable name collision)] Jan Kratochvil
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=5331BB0D.4010606@redhat.com \
--to=keiths@redhat.com \
--cc=brobecker@adacore.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