From: Keith Seitz <keiths@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] c++/11734
Date: Thu, 24 Jun 2010 20:51:00 -0000 [thread overview]
Message-ID: <4C23C52B.1000706@redhat.com> (raw)
In-Reply-To: <AANLkTil8J9g3Z3mJn0Tcw225FAlU-e1CNKmFblwb9hmt@mail.gmail.com>
On 06/23/2010 07:25 PM, Doug Evans wrote:
> I think the change to linespec.c should be a separate patch.
I shall try to isolate the linespec.c change and a test.
> And I think decode_compound shouldn't be modifying what saved_arg
> points to.
Ah, that's right. Gdb passes these things around like they were going
out of style... That is easy enough to avoid, though.
I guess this raises the follow-on question, does something like
"'c::foo()' const" work? I suspect not (with or without my patch). I
will write some new tests for this and see what I can do.
> So it seems like a better way to go is to
> teach locate_first_half about all quote characters.
I'll investigate that avenue, which is, I gather, to treat all single
and double quotes "equivalently." [i.e, probably not exactly
identically: "XXX" == 'XXX'; "XXX' and 'XXX" illegal; not even going to
try "X'Y'Z" -- I'd be better off rewriting linespec.c than tackle some
of these problems!]
> There may be more
> going on here though, I don't understand why decode_line_1 has *both*
> is_quoted and is_quote_enclosed (is there some cleanup that can be
> done here, or is there a technical reason to handle " different from
> '?).
At one time, I convinced myself that I understood the difference between
is_quoted and is_quote_enclosed... I'll have to spend some time to
remind/convince myself again.
> For the lookup_partial_symbol patch:
>
> In the case of simple_name != NULL, do we need to call
> SYMBOL_MATCHES_SEARCH_NAME twice?
> IWBN if psymtabs didn't require that complexity and *only* recorded
> the un-overloaded name.
If I understand your argument correctly, yes, it seems that if we know
that SYMBOL_MATCHES_SEARCH_NAME uses strcmp_iw, then we do not need to
call it twice, since strcmp_iw ("foo", "foo()") will not match. But this
seems just as hacky as relying on a subsequent symtab search to find the
right symbol. What happens if SYMBOL_MATCHES_SEARCH_NAME is changed to
use something other than strcmp_iw. [I know that is highly improbable in
the near future.]
> Could we set name to simple_name when simple_name is created, and then
> have only one call to SYMBOL_MATCHES_SEARCH_NAME?
I've reversed the logic in this (check simple name first),
short-circuiting the second call (again, since we know that it can never
match because SYMBOL_MATCHES_SEARCH_NAME boils down to strcmp_iw, for
which the second argument cannot contain parenthesis unless the first
argument does). This currently shows no regressions, either.
> However psymtabs are searched *after* symtabs.
That's right. psymtabs are searched later:
> This patch works because it turns out that we will later do a search in the
> full symtab, but that's more by accident than design:
Yup. That was what I meant by "hacky."
> This situation is not well solved by our normal psymtabs->symtabs lazy
> expansion design.
> I don't have a specific proposal for a better fix at the moment.
I don't either, but I'm going to try to address your concerns and your
other suggestion to immediately search for the symbol in the symtab.
Thank you for reviewing this.
Keith
prev parent reply other threads:[~2010-06-24 20:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 1:22 Keith Seitz
2010-06-22 9:45 ` Pedro Alves
2010-06-22 15:43 ` Keith Seitz
2010-06-23 17:33 ` Keith Seitz
2010-06-24 2:25 ` Doug Evans
2010-06-24 11:39 ` Matt Rice
2010-06-24 16:05 ` Doug Evans
2010-06-24 20:01 ` Tom Tromey
2010-06-24 20:49 ` Doug Evans
2010-06-24 20:51 ` Keith Seitz [this message]
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=4C23C52B.1000706@redhat.com \
--to=keiths@redhat.com \
--cc=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