From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30206 invoked by alias); 24 Apr 2003 20:47:55 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30195 invoked from network); 24 Apr 2003 20:47:54 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 24 Apr 2003 20:47:54 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 198ndW-00010a-00; Thu, 24 Apr 2003 15:48:06 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 198ndE-0001YN-00; Thu, 24 Apr 2003 16:47:48 -0400 Date: Thu, 24 Apr 2003 21:55:00 -0000 From: Daniel Jacobowitz To: Keith Seitz Cc: "gdb-patches@sources.redhat.com" Subject: Re: [RFA] varobj: call CHECK_TYPEDEF Message-ID: <20030424204748.GA5955@nevyn.them.org> Mail-Followup-To: Keith Seitz , "gdb-patches@sources.redhat.com" References: <1051215397.1538.43.camel@lindt.uglyboxes.com> <20030424201853.GA5398@nevyn.them.org> <1051217215.1538.62.camel@lindt.uglyboxes.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1051217215.1538.62.camel@lindt.uglyboxes.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00470.txt.bz2 On Thu, Apr 24, 2003 at 01:46:55PM -0700, Keith Seitz wrote: > On Thu, 2003-04-24 at 13:18, Daniel Jacobowitz wrote: > > CHECK_TYPEDEF does just about what the name suggests - it replaces a > > TYPE_CODE_TYPEDEF type with the type (TYPE_CODE_STRUCT in this case) > > that it points to. Feel free to add a comment to that effect. > > Ah! Duh! :-) > > > The question is whether the caller of get_type ever wants the typedef; > > depending on how it's used these calls may belong in particular > > callers, not in get_type. > > Hmm. Ok, well I would think that varobj would not want the typedef. For > example, if we have, "typedef struct foo Bar" and I declare a variable > of type Bar, varobj should report the number of children as the number > of children of the struct itself, not the typedef. get_type and > get_target_type already explicitly bypass TYPE_CODE_TYPEDEF. > > Now the real ambiguity is: where to put this in varobj's case? Since > get_type (and consequently get_target_type and get_type_deref) are used > all over the place, so we would want to use CHECK_TYPEDEF there. But how > to not call it when not necessary? In the case I'm currently working on, > the TYPE_CODE (type) is TYPE_CODE_PTR and TYPE_CODE (TYPE_TARGET_TYPE > (type)) is TYPE_CODE_STRUCT. Perhaps there is something else I'm > missing? (Of course, this is still how whatis_command does it...) The important question is whether get_type is ever used to display the object's type; in which case we should say Bar, not "struct foo". I haven't looked at where it's used, so I don't know. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer