From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28317 invoked by alias); 9 Dec 2006 22:10:29 -0000 Received: (qmail 28303 invoked by uid 22791); 9 Dec 2006 22:10:27 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Dec 2006 22:10:23 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1GtAOh-0002H6-Qr for gdb-patches@sources.redhat.com; Sun, 10 Dec 2006 01:10:20 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1GtAOb-0002Gu-W4; Sun, 10 Dec 2006 01:10:14 +0300 From: Vladimir Prus Subject: Re: MI: fix base members in references To: Nick Roberts , gdb-patches@sources.redhat.com Date: Sat, 09 Dec 2006 22:10:00 -0000 References: <200611291555.42209.ghost@cs.msu.su> <17783.60807.26167.746362@kahikatea.snap.net.nz> User-Agent: KNode/0.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Message-Id: 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/msg00145.txt.bz2 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