From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10398 invoked by alias); 11 Jun 2003 23:51:12 -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 7465 invoked from network); 11 Jun 2003 23:49:48 -0000 Received: from unknown (HELO smtp6.Stanford.EDU) (171.67.16.33) by sources.redhat.com with SMTP; 11 Jun 2003 23:49:48 -0000 Received: (from root@localhost) by smtp6.Stanford.EDU (8.12.9/8.12.9) id h5BNnlgw019885 for gdb-patches@sources.redhat.com; Wed, 11 Jun 2003 16:49:47 -0700 (PDT) Received: from jackfruit.Stanford.EDU (jackfruit.Stanford.EDU [171.64.38.136]) by smtp6.Stanford.EDU (8.12.9/8.12.9) with ESMTP id h5BNngrN019849; Wed, 11 Jun 2003 16:49:42 -0700 (PDT) Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h5BNng110794; Wed, 11 Jun 2003 16:49:42 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Keith Seitz Cc: Andrew Cagney , "gdb-patches@sources.redhat.com" , Daniel Jacobowitz Subject: Re: [RFA] varobj: call CHECK_TYPEDEF References: <1051215397.1538.43.camel@lindt.uglyboxes.com> <3EA84A9B.5020308@redhat.com> <1051221433.1534.72.camel@lindt.uglyboxes.com> <3EA8629B.50603@redhat.com> <1055362509.1571.63.camel@lindt.uglyboxes.com> From: David Carlton Date: Wed, 11 Jun 2003 23:51:00 -0000 In-Reply-To: <1055362509.1571.63.camel@lindt.uglyboxes.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-06/txt/msg00402.txt.bz2 On 11 Jun 2003 13:15:10 -0700, Keith Seitz said: > So where do we stand with this? I've just gone and looked over the thread and at Keith's patch; I think the idea is sound, but the implementation isn't. The comments at the top of get_type say that it's supposed to skip past typedefs, so calling CHECK_TYPEDEF certainly seems legitimate. But CHECK_TYPEDEF calls check_typedef, which already goes through chains of typedefs, so you can get rid of the loop in get_type. So I would rewrite get_type as follows: static struct type * get_type (struct varobj *var) { struct type *type; type = var->type; if (type != NULL) CHECK_TYPEDEF (type); return type; } And I don't think you should change get_type_deref at all, but you should change get_target_type as follows: static struct type * get_target_type (struct type *type) { if (type != NULL) { type = TYPE_TARGET_TYPE (type); if (type != NULL) CHECK_TYPEDEF (type); } return type; } (I do wonder a bit if all of those "type != NULL" checks are necessary, but that's a separate question.) I'm not qualified to approve these patches, but the idea seems obvious to me. David Carlton carlton@math.stanford.edu