Re: MI: fix base members in references

Vladimir Prus
2006-12-09T22:10:29Z

Nick Roberts wrote:

> > Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  I guess we need to
> first > commit the primary references patch and then fix
> c_number_of_children. Not > that I find references to pointers very common
> thing, but better be correct.
>
> The patch below seems to fix it for me. Â Its a diff on 1.63 with your
> yet to be committed changes.

> *** /home/nickrob/src6/gdb/varobj.c~Â Â Â Â 2006-12-07 10:54:18.000000000
> +1300 --- /home/nickrob/src6/gdb/varobj.cÂ Â Â Â Â 2006-12-07
> 23:11:34.000000000 +1300 *************** cplus_number_of_children (struct
> varobj *** 2179,2184 ****
> --- 2179,2186 ----
> if (!CPLUS_FAKE_CHILD (var))
> {
> type = get_type_deref (var);
> + Â  Â  Â  if (TYPE_CODE (type) == TYPE_CODE_PTR)
> + Â Â Â Â Â Â type = get_target_type (type);

I must admit I have big troubles reading context diffs. Will it be a problem
for you to send diffs in unified format?

If I read the patch correctly, you add two lines of code? Given that
get_type_deref is defined like this:

static struct type *
get_type_deref (struct varobj *var)
{
struct type *type;

type = get_type (var);

if (type != NULL && (TYPE_CODE (type) == TYPE_CODE_PTR
|| TYPE_CODE (type) == TYPE_CODE_REF))
type = get_target_type (type);

return type;
}

does the code you've added ever does anything?

- Volodya