[patch] function eval cleanup
sami wagiaalla
swagiaal@redhat.com
Mon Jul 19 15:28:00 GMT 2010
> You didn't mention how you tested this...
>
This was tested by running the test suit on Fedora 13 with gcc 4.4.4 on
x8664.
> 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?
>
In this particular location and if the language is C++ we are dealing
with an OP_VAR_VALUE since all the other constructs were eliminated by
the if else chain. So it is always a symbol, but I could add a check for
OP_VAR_VALUE before skipping evaluation.
> If there is a failing case here, and it was not caught by the test
> suite, please also add a regression test.
>
No, no failing case. Just the FIXME by pai. It is kind of tricky to test
because whatever symbol is evaluated here is replace by overload
reslution and quietly re-evaluated.
It only causes problems when meta-symbol for templates is introduced as
it is not meant to be evaluated see patch 2 of Template Lookup.
More information about the Gdb-patches
mailing list