This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix ptype problem printing typedefs defined differently in different compilation units
On Sat, Feb 11, 2006 at 03:01:01PM -0500, Fred Fish wrote:
> > It looks to me like, with objectprint set, ptype and whatis will now
> > blow up; they call value_rtti_target_type without initializing val.
>
> Yup. The fix would be to remove the test of type==NULL and always
> initialize val, whether or not ptype_eval finds a type to print.
Well, if the results of ptype_eval and evaluate_type are inconsistent
here, won't the result of doing this be meaningless? And if they were
already consistent, then I'm a little confused how your patch works.
Actually I think I'm a little confused either way.
If ptype_eval failed evaluate_type would eventually get called,
and that ought to handle OP_VAR_VALUE just fine.
> Apparently we don't have any test in the gdb testsuite that checks
> using objectprint, as there we no regressions when I ran it after the
> change.
Yes, unfortunately, I suspect this is true.
> > Also ptype will now do the RTTI lookup; I'm not sure whether it
> > should or not.
>
> Not sure either, now that you point it out.
Might as well let it.
--
Daniel Jacobowitz
CodeSourcery