From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3404 invoked by alias); 5 Jan 2010 20:12:31 -0000 Received: (qmail 3392 invoked by uid 22791); 5 Jan 2010 20:12:31 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Tue, 05 Jan 2010 20:12:26 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o05KBgLc003328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 5 Jan 2010 15:11:43 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o05KBgR7000739; Tue, 5 Jan 2010 15:11:42 -0500 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 o05KBfew014429; Tue, 5 Jan 2010 15:11:41 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id E8C04378267; Tue, 5 Jan 2010 13:11:40 -0700 (MST) From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA/DWARF] Add DW_AT_GNAT_descriptive_type support References: <20091224180657.GV5942@adacore.com> Reply-To: tromey@redhat.com Date: Tue, 05 Jan 2010 20:12:00 -0000 In-Reply-To: <20091224180657.GV5942@adacore.com> (Joel Brobecker's message of "Thu, 24 Dec 2009 22:06:57 +0400") 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-01/txt/msg00088.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> I have taken the time to order the patches to follow the same order Joel> as if I was to write the patch all over again (gdbtypes updates, Joel> dwarf2read updates, etc). Hopefully this will help reading it. Thanks... though I don't really want to encourage this sort of thing, because it will mean people will start expect it from me ;-) This patch seems pretty reasonable. Joel> There are still a couple of things that are worth discussing: Joel> (a) You'll see that I put a FIXME after modifying the Joel> TYPE_CPLUS_SPECIFIC macro. The comment says it all. I think Joel> that the fix is fine; in fact, we could generalize this approach Joel> to all the accessor macros for the type-specific union - I Joel> wouldn't see a problem with that, and would make the code more Joel> resilient to incorrect field access. For now, I opted for just Joel> fixing this one macro, since C is usually the "universal" "bare" Joel> language. Ada or C++ might be less so: Who would want to use Joel> C++ or Ada to display a Fortran array? :-) The modified macro uses the default if Gnat aux info is available. It seem to me that the check should instead be to see if the C++ info is not available. Joel> (b) We need to determine how GCC will tell GDB that it uses the Joel> DW_AT_GNAT_descriptive_type attribute. [...] Joel> What's the best way for GCC to tell GDB? At AdaCore, we relied Joel> on a hack, where we parsed a special marker in the CU producer Joel> attribute. It's kind of gross, but it served us well. Any Joel> suggestion? How about a new GNU extension attribute in the CU DIE? Joel> + if (! HAVE_CPLUS_STRUCT (type)) Joel> + n_base_classes = 0; Joel> + else Joel> + n_base_classes = TYPE_N_BASECLASSES (type); This seems a little weird to me. Do we need this everywhere we use TYPE_N_BASECLASSES? Tom