From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4918 invoked by alias); 20 Sep 2010 10:04:27 -0000 Received: (qmail 4910 invoked by uid 22791); 20 Sep 2010 10:04:26 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Sep 2010 10:04:21 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8KA4KWE014789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Sep 2010 06:04:20 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8KA4HRs013882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 20 Sep 2010 06:04:19 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o8KA4Hu5006045; Mon, 20 Sep 2010 12:04:17 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o8KA4HoX006038; Mon, 20 Sep 2010 12:04:17 +0200 Date: Mon, 20 Sep 2010 12:02:00 -0000 From: Jan Kratochvil To: Paul Bolle Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [RFC] python: gdb.Type: strip typedefs past pointers too Message-ID: <20100920100417.GA5751@host1.dyn.jankratochvil.net> References: <1284753356.21566.10.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1284753356.21566.10.camel@localhost.localdomain> User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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: 2010-09/txt/msg00339.txt.bz2 On Fri, 17 Sep 2010 21:55:56 +0200, Paul Bolle wrote: > 1) I drafted a patch (pasted below this message) that works around this > limitation: > > (gdb) ptype wchar_t > type = long int > (gdb) ptype wchar_t * > type = long int * What is the goal of this patch? strip_typedefs I understand to be the Python interface to check_typedef. check_typedef is there to prepare whatever type you get to a point where you have something you can process as pointer/array/integer/etc. It also sets type sizeof of the outer typedef to sizeof of the resolved inner type for opaque types, depending on how they got resolved. With VLA patch the resolved size also depends on the current/variable size. I still do not see a use case why is it useful to resolve typedefs in the inner sub-types. Some functions will call check_typedef again while recursively processing the type anyway. What is your use case? The strip_typedefs description should be fixed anyway as the text is now ambiguous. Regards, Jan