From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4680 invoked by alias); 10 Oct 2009 00:42:39 -0000 Received: (qmail 4665 invoked by alias); 10 Oct 2009 00:42:39 -0000 Date: Sat, 10 Oct 2009 00:42:00 -0000 Message-ID: <20091010004239.4664.qmail@sourceware.org> From: "nickrob at snap dot net dot nz" To: gdb-prs@sourceware.org In-Reply-To: <20090901200751.10586.elethiomel@gmail.com> References: <20090901200751.10586.elethiomel@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug mi/10586] Anonymous unions/structs not handled correctly under MI X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2009-q4/txt/msg00039.txt.bz2 ------- 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 * 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.