From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18405 invoked by alias); 21 May 2010 20:28:30 -0000 Received: (qmail 18389 invoked by uid 22791); 21 May 2010 20:28:28 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,TW_BJ X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 May 2010 20:28:23 +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 o4LKSIva065600 for ; Fri, 21 May 2010 22:28:19 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o4LKSI0o077363 for ; Fri, 21 May 2010 22:28:18 +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.3/jtpda-5.5pre1) with ESMTP id o4LKSIa7056031 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 21 May 2010 22:28:18 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] dwarf2read.c: Avoid complaint for char array of unspecified size Date: Fri, 21 May 2010 20:35:00 -0000 Message-ID: <000f01caf924$2944e400$7bceac00$@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-05/txt/msg00510.txt.bz2 When I tried to compile GDB on an Arm Linux, I came across several complaint when debugging GDB with itself, he is another patch. This code: external char gdbint []; generated a DW_TAG_subrange_type with zero attributes to describe the `[]' part. (compiled with gcc (Debian 4.3.2-1.1) 4.3.2.). As there was already some code that handled missing children (for Irix), I simply extended it to the case of a child with zero attributes. I implicitly supposed that there could be no child to the subrange type die, which seems reasonable to me, but others might have another opinion. I don't think it is possible to define a multiple dimension array (matrix) in any language with one unspecified length, am I right? Pierre Muller Pascal language support maintainer for GDB 2010-05-21 Pierre Muller * dwarf2read.c (read_array_type): Do not try to read subrange type with zero attributes. Index: src/gdb/dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.386 diff -u -p -r1.386 dwarf2read.c --- src/gdb/dwarf2read.c 17 May 2010 15:55:01 -0000 1.386 +++ src/gdb/dwarf2read.c 21 May 2010 14:47:42 -0000 @@ -5431,8 +5431,12 @@ read_array_type (struct die_info *die, s element_type = die_type (die, cu); /* Irix 6.2 native cc creates array types without children for - arrays with unspecified length. */ - if (die->child == NULL) + arrays with unspecified length. + Likewise, for the following code: + extern char gdbinit []; + GCC generates a DW_TAG_subrange_type with zero attributes. */ + if (die->child == NULL || (die->child->tag == DW_TAG_subrange_type + && die->child->num_attrs == 0)) { index_type = objfile_type (objfile)->builtin_int; range_type = create_range_type (NULL, index_type, 0, -1);