This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug mi/10586] Anonymous unions/structs not handled correctly under MI
- From: "nickrob at snap dot net dot nz" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 10 Oct 2009 00:42:39 -0000
- Subject: [Bug mi/10586] Anonymous unions/structs not handled correctly under MI
- References: <20090901200751.10586.elethiomel@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From nickrob at snap dot net dot nz 2009-10-10 00:42 -------
Subject: Anonymous unions/structs not handled correctly under MI
> I'm changing to status to this as confirmed as it is known longstanding
> problem (see Apple fixes) and it was confirmed by the Eclipse CDT devs.
The patch below seems to fix this. I may have missed something because the
thread suggests that any fix isn't that simple. If that's so, the MI
testsuite overlooks it too because there are no unknown failures.
--
Nick http://users.snap.net.nz/~nickrob
2009-10-10 Nick Roberts <nickrob@snap.net.nz>
* varobj.c (c_describe_child): Use index for the name
for anonymous structs/unions.
*** varobj.c 20 Sep 2009 11:44:22 +1200 1.149
--- varobj.c 10 Oct 2009 12:37:14 +1300
*************** c_describe_child (struct varobj *parent,
*** 2816,2823 ****
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
if (cname)
! *cname = xstrdup (TYPE_FIELD_NAME (type, index));
!
if (cvalue && value)
{
/* For C, varobj index is the same as type index. */
--- 2816,2830 ----
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
if (cname)
! {
! *cname = xstrdup (TYPE_FIELD_NAME (type, index));
! /* Anonymous case. */
! if (strlen (*cname) == 0)
! {
! *cname = (char*) malloc (24);
! sprintf (*cname, "%d", index);
! }
! }
if (cvalue && value)
{
/* For C, varobj index is the same as type index. */
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10586
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.