From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15764 invoked by alias); 24 Apr 2003 20:18:57 -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 15757 invoked from network); 24 Apr 2003 20:18:57 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 24 Apr 2003 20:18:57 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 198nBX-0000wk-00; Thu, 24 Apr 2003 15:19:11 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 198nBF-0001QH-00; Thu, 24 Apr 2003 16:18:53 -0400 Date: Thu, 24 Apr 2003 20:52:00 -0000 From: Daniel Jacobowitz To: Keith Seitz Cc: "gdb-patches@sources.redhat.com" Subject: Re: [RFA] varobj: call CHECK_TYPEDEF Message-ID: <20030424201853.GA5398@nevyn.them.org> Mail-Followup-To: Keith Seitz , "gdb-patches@sources.redhat.com" References: <1051215397.1538.43.camel@lindt.uglyboxes.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1051215397.1538.43.camel@lindt.uglyboxes.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00468.txt.bz2 On Thu, Apr 24, 2003 at 01:16:38PM -0700, Keith Seitz wrote: > Hi, > > Well, I am not really sure what this does, or why it is necessary > (check_typedef has no comment in gdbtypes.c), but it's what type_print > code does. > > Occasionally, some (C++?) files can show no child objects because > nfields will be zero. After calling CHECK_TYPEDEF, nfields is suddenly > non-zero. > > This was first reported as insight/219. 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. 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. > > Keith > > ChangeLog > 2003-04-24 Keith Seitz > > * varobj.c (get_type): Call CHECK_TYPEDEF. > (get_type_deref): Likewise. > > > Index: varobj.c > =================================================================== > RCS file: /cvs/src/src/gdb/varobj.c,v > retrieving revision 1.38 > diff -u -p -r1.38 varobj.c > --- varobj.c 4 Dec 2002 00:05:54 -0000 1.38 > +++ varobj.c 24 Apr 2003 20:12:52 -0000 > @@ -1394,6 +1394,7 @@ get_type (struct varobj *var) > while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF) > type = TYPE_TARGET_TYPE (type); > > + CHECK_TYPEDEF (type); > return type; > } > > @@ -1409,6 +1410,7 @@ get_type_deref (struct varobj *var) > || TYPE_CODE (type) == TYPE_CODE_REF)) > type = get_target_type (type); > > + CHECK_TYPEDEF (type); > return type; > } > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer