Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] dwarf2read.c: Avoid complaint for char array of unspecified size
@ 2010-05-21 20:35 Pierre Muller
  0 siblings, 0 replies; 10+ messages in thread
From: Pierre Muller @ 2010-05-21 20:35 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-06-02 19:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <38685.0063725889$1274473713@news.gmane.org>
2010-05-21 22:13 ` [RFA] dwarf2read.c: Avoid complaint for char array of unspecified size Tom Tromey
2010-05-21 23:55   ` Pierre Muller
2010-05-24 15:35     ` Tom Tromey
2010-05-26 15:21       ` [RFA-v2] " Pierre Muller
     [not found]       ` <34200.8848595016$1274864816@news.gmane.org>
2010-05-27 20:09         ` Tom Tromey
2010-05-28 10:17           ` [RFA-v3] " Pierre Muller
2010-06-01 19:07             ` Tom Tromey
2010-06-02  6:25               ` Pierre Muller
2010-06-02 19:35                 ` Tom Tromey
2010-05-21 20:35 [RFA] " Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox