This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] mi/10586


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> This bug deals with anonymous structs/unions in varobj. As in:
Keith> anonymous structs/unions are unaddressable by MI clients.

Keith> This bug has been sitting around for quite some time. Vladimir Prus
Keith> first mentioned this in 2006 (yikes!), and this bug was filed in
Keith> 2009. At this time, Nick Roberts responded to the bug with a patch
Keith> that fixed the problem.

Keith> I don't know why Nick never submitted the patch here, so I've tweaked
Keith> his original patch and written some tests for it, and I am now
Keith> submitting this.

Thanks.

Keith> 2011-11-11  Keith Seitz  <keiths@redhat.com>
Keith> 	Based on work by Nick Roberts  <nickrob@snap.net.nz>:
Keith> 	* varobj.c (c_describe_child): Synthesize a variable name for
Keith> 	anonymous structs and unions.
Keith> 	(cplus_describe_child): Likewise.

ChangeLog should mention the PR.

Keith> +	type_name = TYPE_FIELD_NAME (type, index);
Keith> +	if (*type_name == '\0')
Keith> +	  name = xstrprintf ("anonymous%d", index);
Keith> +	else
Keith> +	  name = type_name;

What happens if there is a clash between a named field's name and the
generated name for an anonymous field?

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]