From: Tom Tromey <tromey@redhat.com>
To: sami wagiaalla <swagiaal@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] function eval cleanup
Date: Wed, 14 Jul 2010 23:00:00 -0000 [thread overview]
Message-ID: <m3630hmzye.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4C3B6428.8090906@redhat.com> (sami wagiaalla's message of "Mon, 12 Jul 2010 14:51:20 -0400")
>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:
Sami> This code performs function evaluation before overload resolution
Sami> completes. Currently, for C++, this is a waste if overload
Sami> resolution results in a different function than the one which was
Sami> evaluated but it breaks a future patch of mine which introduces a
Sami> fake place holding variable needed for proper template function
Sami> evaluation.
You didn't mention how you tested this...
Sami> + /* If this is a C++ function wait until overload resolution. */
Sami> + if (overload_resolution
Sami> + && (exp->language_defn->la_language == language_cplus))
Sami> {
Sami> - for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
Sami> + (*pos) += 4; /* Skip the evaluation of the symbol. */
Why is it ok to add 4 here?
I think this assumes that the function in question is a symbol.
But is that always the case? What about something like calling via a
function pointer? Or some other more complicated subexpression?
If there is a failing case here, and it was not caught by the test
suite, please also add a regression test.
Some day we should refactor this whole case, it is really hard to
understand. And 'overload_resolution' -- another global affecting
things randomly throughout gdb. Sigh. I wonder if anybody would
complain if we just got rid of it.
Tom
next prev parent reply other threads:[~2010-07-14 23:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-12 18:51 sami wagiaalla
2010-07-14 23:00 ` Tom Tromey [this message]
2010-07-19 15:28 ` sami wagiaalla
2010-07-20 19:05 ` sami wagiaalla
2010-07-20 19:57 ` Tom Tromey
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=m3630hmzye.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=swagiaal@redhat.com \
/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