From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10458 invoked by alias); 11 Dec 2006 05:58:23 -0000 Received: (qmail 10448 invoked by uid 22791); 11 Dec 2006 05:58:22 -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; Mon, 11 Dec 2006 05:58:17 +0000 Received: from kahikatea.snap.net.nz (p202-124-125-222.snap.net.nz [202.124.125.222]) by viper.snap.net.nz (Postfix) with ESMTP id CDDE13D8227; Mon, 11 Dec 2006 18:59:24 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id EF3B5BE38A; Mon, 11 Dec 2006 18:53:45 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17788.62054.684436.820815@kahikatea.snap.net.nz> Date: Mon, 11 Dec 2006 05:58:00 -0000 To: Daniel Jacobowitz Cc: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: MI: fix base members in references In-Reply-To: <20061211023534.GA11761@nevyn.them.org> References: <17787.10504.215397.177658@kahikatea.snap.net.nz> <200612100037.24768.ghost@cs.msu.su> <17787.11900.251681.440151@kahikatea.snap.net.nz> <200612100114.44118.ghost@cs.msu.su> <17787.35236.492750.204386@kahikatea.snap.net.nz> <20061210204207.GA1681@nevyn.them.org> <17788.30961.422979.535189@kahikatea.snap.net.nz> <20061211023534.GA11761@nevyn.them.org> X-Mailer: VM 7.19 under Emacs 22.0.91.16 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/msg00161.txt.bz2 > If you can't explain why your change is correct, then by default, it is > not the correct fix. We can't just throw bandages at the codebase; > that's how you get bigger onions, not better programs. I'm not claiming it's correct, just a step in the right direction, but we could go round in circles (or onion rings!) here. Its not a RFA. > > > get_type_deref looks at the type, and if it is a pointer or reference, > > > it dereferences it. I assume that this is because we want to show the > > > children of pointers to structs and references to structs. Is that > > > right? > > > > My patch was just for references to pointers. > > Sorry, I don't know how else to explain what that function does; I'm not querying your explanation, just saying that the patch *wasn't* about showing the children of pointers to structs and references to structs. > that's > the important thing here. What does not happen that you want to make > happen, and why doesn't it happen? The explanation in my previous > message _should_ answer those questions, if I've understood the > discussion right, but maybe it doesn't. What doesn't work: references to pointers to structs/unions. All my patch does is add an extra level of dereferencing to the relevant cplus_* functions. Presumably you could also have references to references to pointers, pointers to references to pointers etc so maybe the change should look something like: while (TYPE_CODE (type) == TYPE_CODE_PTR) || TYPE_CODE (type) == TYPE_CODE_REF) type = get_target_type (type); but I suspect the business of fake children would make this awkward. -- Nick http://www.inet.net.nz/~nickrob