From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4970 invoked by alias); 20 Jun 2010 22:39:57 -0000 Received: (qmail 4961 invoked by uid 22791); 20 Jun 2010 22:39:56 -0000 X-SWARE-Spam-Status: No, hits=1.1 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,MSGID_MULTIPLE_AT,RCVD_IN_JMF_BL,TW_GD X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Jun 2010 22:39:47 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o5KMde8l076044 ; Mon, 21 Jun 2010 00:39:40 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms6.u-strasbg.fr [IPv6:2001:660:2402:d::15]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o5KMddkt057149 ; Mon, 21 Jun 2010 00:39:39 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o5KMdc94061696 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Mon, 21 Jun 2010 00:39:39 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" Cc: References: <41597.7287375883$1274454923@news.gmane.org> <001001caf925$2c771bb0$85655310$@muller@ics-cnrs.unistra.fr> <201006161708.41089.pedro@codesourcery.com> In-Reply-To: <201006161708.41089.pedro@codesourcery.com> Subject: RE: [RFA]dwarf reader: Avoid complaint on const type Date: Sun, 20 Jun 2010 22:39:00 -0000 Message-ID: <005401cb10c9$7dbcfec0$7936fc40$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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/msg00452.txt.bz2 Hi Pedro, I checked this a little, but it is still unclear to me: gcc-3 only emits a DW_AT_type attribute, no DW_AT_name, so there is no problem in that case. On gcc16, I do see the failure that you see, but I rechecked my tests when I submitted, and there is no sigaltstack failure. I think that wehen I submitted the patch, I was supposing that if the DW_TAG_volatile_type would have a name attribute, it would only be to give the name of the newly defined type, i.e. for a typedef. Apparently, GCC changed a reports the old "unmodified" type name. The patch below should fix this. Pierre Muller PS: gcc does not emit typedefs for volatile types: >>>>Start of test-vol.c<<<<<< enum level { MAIN, OUTER, INNER, LEAF, NR_LEVELS }; /* Levels completed flag. */ typedef volatile enum level level2; volatile enum level level = NR_LEVELS; typedef volatile int volint; volint vol; level2 test = OUTER; int local () { typedef volatile enum level level; level loc; loc = INNER; return 0; } int main () { vol = 5; level = MAIN; test = LEAF; local (); return 0; } >>>>Start of test-vol.c<<<<<< gcc -gdwarf2 test-vol.c results in an executable with no information about volint type. (stabs info gives correct information)... I have to add here that I hate the C way of describing typedefs: (gdb) inf type myint type int; This is almost completely useless, especially when you do a (gdb) inf type myint does not appear anywhere :( Back to the patch itself: ChangeLog entry: 2010-06-21 Pierre Muller * dwarf2read.c (process_die): Do not call new_symbol for DW_TAG_volatile_type and DW_TAG_const_type. (new_symbol): Do not add the name of DW_TAG_volatile_type and DW_TAG_const_type to the symbol list. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.400 diff -u -p -r1.400 dwarf2read.c --- dwarf2read.c 17 Jun 2010 22:36:41 -0000 1.400 +++ dwarf2read.c 20 Jun 2010 21:57:23 -0000 @@ -3210,12 +3210,14 @@ process_die (struct die_info *die, struc case DW_TAG_base_type: case DW_TAG_subrange_type: case DW_TAG_typedef: - case DW_TAG_const_type: - case DW_TAG_volatile_type: /* Add a typedef symbol for the type definition, if it has a DW_AT_name. */ new_symbol (die, read_type_die (die, cu), cu); break; + case DW_TAG_const_type: + case DW_TAG_volatile_type: + read_type_die (die, cu); + break; case DW_TAG_common_block: read_common_block (die, cu); break; @@ -8912,12 +8914,16 @@ new_symbol (struct die_info *die, struct break; case DW_TAG_base_type: case DW_TAG_subrange_type: - case DW_TAG_const_type: - case DW_TAG_volatile_type: SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; add_symbol_to_list (sym, cu->list_in_scope); break; + case DW_TAG_const_type: + case DW_TAG_volatile_type: + /* The name of the type given in the dwarf name atribute is the + name of the `normal' type and not a new type name, so + do not register this as a new type name. */ + break; case DW_TAG_enumerator: attr = dwarf2_attr (die, DW_AT_const_value, cu); if (attr)