Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA] dwarf2read.c: Avoid complaint for char array of unspecified size
Date: Fri, 21 May 2010 20:35:00 -0000	[thread overview]
Message-ID: <000f01caf924$2944e400$7bceac00$@muller@ics-cnrs.unistra.fr> (raw)

  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  <muller@ics.u-strasbg.fr>

	* 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);


             reply	other threads:[~2010-05-21 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 20:35 Pierre Muller [this message]
     [not found] <38685.0063725889$1274473713@news.gmane.org>
2010-05-21 22:13 ` Tom Tromey
2010-05-21 23:55   ` Pierre Muller
2010-05-24 15:35     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000f01caf924$2944e400$7bceac00$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox