From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4534 invoked by alias); 7 Dec 2006 10:36:08 -0000 Received: (qmail 4525 invoked by uid 22791); 7 Dec 2006 10:36:07 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 07 Dec 2006 10:36:01 +0000 Received: from kahikatea.snap.net.nz (p202-124-120-99.snap.net.nz [202.124.120.99]) by viper.snap.net.nz (Postfix) with ESMTP id BCB373DB3DB; Thu, 7 Dec 2006 23:37:05 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id A1A95BE3A7; Thu, 7 Dec 2006 23:31:36 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17783.60807.26167.746362@kahikatea.snap.net.nz> Date: Thu, 07 Dec 2006 10:36:00 -0000 To: Vladimir Prus Cc: Daniel Jacobowitz , Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: MI: fix base members in references In-Reply-To: <200612070921.25566.ghost@cs.msu.su> References: <200611291555.42209.ghost@cs.msu.su> <17783.31160.70662.126254@kahikatea.snap.net.nz> <17783.40741.544295.457176@kahikatea.snap.net.nz> <200612070921.25566.ghost@cs.msu.su> X-Mailer: VM 7.19 under Emacs 22.0.91.13 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00094.txt.bz2 > 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. Since we have been the only two people directly contributing to for a while now MI, and as it would stop the patches piling up, perhaps Vladimir (if interested) and me could now be jointly made maintainers of MI. For the extent of changes that we could make without prior approval, I have in mind all the files in the mi directory plus varobj.c. That should insulate the rest of GDB while exposing Insight slightly. In any case we would be conservative in our changes, and now might be a good time to start with the next release from the main trunk being a long way off. WDYT? -- Nick http://www.inet.net.nz/~nickrob *** /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); if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) || ((TYPE_CODE (type)) == TYPE_CODE_UNION)) *************** cplus_number_of_children (struct varobj *** 2205,2210 **** --- 2207,2214 ---- int kids[3]; type = get_type_deref (var->parent); + if (TYPE_CODE (type) == TYPE_CODE_PTR) + type = get_target_type (type); cplus_class_num_children (type, kids); if (strcmp (var->name, "public") == 0) *************** cplus_name_of_child (struct varobj *pare *** 2269,2274 **** --- 2273,2281 ---- else type = get_type_deref (parent); + if (TYPE_CODE (type) == TYPE_CODE_PTR) + type = get_target_type (type); + name = NULL; switch (TYPE_CODE (type)) { *************** cplus_value_of_child (struct varobj *par *** 2404,2411 **** else type = get_type_deref (parent); ! value = NULL; if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) || ((TYPE_CODE (type)) == TYPE_CODE_UNION)) { --- 2411,2420 ---- else type = get_type_deref (parent); ! if (TYPE_CODE (type) == TYPE_CODE_PTR) ! type = get_target_type (type); + value = NULL; if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) || ((TYPE_CODE (type)) == TYPE_CODE_UNION)) { *************** cplus_type_of_child (struct varobj *pare *** 2481,2486 **** --- 2490,2498 ---- else t = get_type_deref (parent); + if (TYPE_CODE (t) == TYPE_CODE_PTR) + t = get_target_type (t); + type = NULL; switch (TYPE_CODE (t)) {