From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20255 invoked by alias); 28 Jun 2010 18:22:55 -0000 Received: (qmail 20170 invoked by uid 22791); 28 Jun 2010 18:22:54 -0000 X-SWARE-Spam-Status: No, hits=-5.9 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, 28 Jun 2010 18:22:49 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SIMmsx000930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Jun 2010 14:22:48 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SIMl6H028382; Mon, 28 Jun 2010 14:22:47 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5SIMkLL028333; Mon, 28 Jun 2010 14:22:46 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 381B4378967; Mon, 28 Jun 2010 12:22:46 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org, Sami Wagiaalla Subject: Re: [patch 2/2] ptype should list also class's typedefs References: <20100614155942.GB23639@host0.dyn.jankratochvil.net> <20100625212929.GB14185@host0.dyn.jankratochvil.net> Reply-To: tromey@redhat.com Date: Mon, 28 Jun 2010 18:22:00 -0000 In-Reply-To: <20100625212929.GB14185@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Fri, 25 Jun 2010 23:29:29 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-06/txt/msg00643.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Tom> It is customary to make new wrapper macros for new fields here. Tom> I'm not sure that adds much benefit, but maybe just consistency is a Tom> good enough reason. Jan> Asked about, no response so I have implemented it as you say, not Jan> agreed upon. gdbtypes.h #defined field accessors Jan> http://sourceware.org/ml/gdb/2010-06/msg00121.html Sorry about the lack of a response. I will reply to this separately. Tom> Access permissions are also dropped, that seems maybe a little more Tom> useful. Jan> I was not aware they apply. Filed GCC PR debug/44668 and GDB PR Jan> c++/11757. Thanks. Jan> There is no memory difference as read_type_die is used by both and Jan> the same TYPE_CODE_TYPEDEF type gets shared by Jan> get_die_type->htab_find_with_hash. Thanks. Jan> GDB now displays: Jan> (gdb) ptype C Jan> type = class C { Jan> private: Jan> C::t g(C::t); Jan> typedef int t; Jan> } Jan> As `g' is printed without `C::' I believe even ` t;' should not be Jan> ` C::t;'. Yeah, I agree. This output looks reasonable, I think I misunderstood what would be printed here. Jan> GDB currently does not try to shorten some common namespaces and it always Jan> uses fully qualified names. It could probably shorten at least `std::': Jan> Do you suggest to already implement some form of such namespaces Jan> shortening? I have no clue how it fits into some general GDB Jan> namespaces shortening plan. I don't think we have any actual plan here. Originally we had talked about making gdb print "whatever the user wrote". There's at least one GCC PR on this topic; the issue is that GCC doesn't preserve the needed information in the DWARF, and arguably it should not. Roland had a couple of ideas in this area that seemed quite nice to me: http://sourceware.org/ml/archer/2009-q3/msg00011.html http://sourceware.org/ml/archer/2009-q3/msg00012.html But AFAIK nobody is working on these yet. Jan> 2010-06-25 Jan Kratochvil Jan> * c-typeprint.c (c_type_print_base): For no fields check include also Jan> TYPE_TYPEDEF_FIELD_COUNT. Print new typedefs section. Jan> * dwarf2read.c (struct typedef_field_list) Jan> (struct field_info) : New. Jan> (dwarf2_add_typedef): New. Jan> (read_structure_type): Call dwarf2_add_typedef for DW_TAG_typedef. Jan> Copy also FI.TYPEDEF_FIELD_LIST. Jan> * gdbtypes.h (struct typedef_field) Jan> (struct cplus_struct_type) Jan> (TYPE_TYPEDEF_FIELD_ARRAY, TYPE_TYPEDEF_FIELD, TYPE_TYPEDEF_FIELD_NAME) Jan> (TYPE_TYPEDEF_FIELD_TYPE, TYPE_TYPEDEF_FIELD_COUNT): New. Jan> 2010-06-25 Jan Kratochvil Jan> * gdb.cp/namespace.exp (ptype OtherFileClass typedefs) Jan> (ptype ::C::OtherFileClass typedefs): New. Jan> * gdb.cp/namespace1.cc (C::OtherFileClass::cOtherFileClassType2) Jan> (C::OtherFileClass::cOtherFileClassVar2): New. Jan> (C::OtherFileClass::cOtherFileClassVar_use): Use also Jan> cOtherFileClassVar2. Jan> (C::cOtherFileType2, C::cOtherFileVar2): New. Jan> (C::cOtherFileVar_use): use also cOtherFileVar2. Jan> * gdb.cp/userdef.exp (ptype &*c): Permit arbitrary trailing text. This is ok. Thanks. Tom