From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28859 invoked by alias); 24 Apr 2003 20:44:44 -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 28851 invoked from network); 24 Apr 2003 20:44:44 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 24 Apr 2003 20:44:44 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h3OKiiD01666 for ; Thu, 24 Apr 2003 16:44:44 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3OKiiq25376 for ; Thu, 24 Apr 2003 16:44:44 -0400 Received: from [150.1.200.14] (vpn50-53.rdu.redhat.com [172.16.50.53]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3OKihh02340 for ; Thu, 24 Apr 2003 16:44:43 -0400 Subject: Re: [RFA] varobj: call CHECK_TYPEDEF From: Keith Seitz To: "gdb-patches@sources.redhat.com" In-Reply-To: <20030424201853.GA5398@nevyn.them.org> References: <1051215397.1538.43.camel@lindt.uglyboxes.com> <20030424201853.GA5398@nevyn.them.org> Content-Type: text/plain Organization: Message-Id: <1051217215.1538.62.camel@lindt.uglyboxes.com> Mime-Version: 1.0 Date: Thu, 24 Apr 2003 21:51:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00469.txt.bz2 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...) ?? Keith