Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/dwarf2] Fix PR/2018 - set array type names
@ 2006-10-06 19:23 Joel Brobecker
  2006-10-06 19:28 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2006-10-06 19:23 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

Hello,

Here is a fix for GDB PR/2018.

I actually submitted this patch a long time ago (Oct 2005!), and for
some reason let it sit unnoticed. I think I was trying to win the
oldest patch unreviewed prize :-).

        http://www.sourceware.org/ml/gdb-patches/2005-10/msg00086.html

In any case, I should have sent a ping much earlier than this. Here is
a freshened-up version of the patch, and retested to make sure it still
fixes the 4 KFAILs in gdb.ada/arrayidx.exp.

2006-10-06 Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (read_array_type): Set the type name if the name
        attribute is present.

Tested on x86-linux, fixes the 4 KFAILs of gdb.ada/arrayidx.exp, no
regression.  OK to commit?

Thanks,
-- 
Joel

[-- Attachment #2: dwarf2read.c.diff --]
[-- Type: text/plain, Size: 594 bytes --]

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.203
diff -u -p -r1.203 dwarf2read.c
--- dwarf2read.c	18 Aug 2006 13:26:31 -0000	1.203
+++ dwarf2read.c	6 Oct 2006 18:38:48 -0000
@@ -4282,6 +4282,10 @@ read_array_type (struct die_info *die, s
   if (attr)
     TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
 
+  attr = dwarf2_attr (die, DW_AT_name, cu);
+  if (attr && DW_STRING (attr))
+    TYPE_NAME (type) = DW_STRING (attr);
+  
   do_cleanups (back_to);
 
   /* Install the type in the die. */

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

* Re: [RFA/dwarf2] Fix PR/2018 - set array type names
  2006-10-06 19:23 [RFA/dwarf2] Fix PR/2018 - set array type names Joel Brobecker
@ 2006-10-06 19:28 ` Daniel Jacobowitz
  2006-10-06 20:39   ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2006-10-06 19:28 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Fri, Oct 06, 2006 at 12:23:03PM -0700, Joel Brobecker wrote:
>         http://www.sourceware.org/ml/gdb-patches/2005-10/msg00086.html

I don't think I looked at this the first time you sent it.  The hack is
disgusting, but that's a problem for another day.  I think the comment
in GCC is simply incorrect for DWARF-2, and the array should have the
correct range type.

> 2006-10-06 Joel Brobecker  <brobecker@adacore.com>
> 
>         * dwarf2read.c (read_array_type): Set the type name if the name
>         attribute is present.
> 
> Tested on x86-linux, fixes the 4 KFAILs of gdb.ada/arrayidx.exp, no
> regression.  OK to commit?

OK.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFA/dwarf2] Fix PR/2018 - set array type names
  2006-10-06 19:28 ` Daniel Jacobowitz
@ 2006-10-06 20:39   ` Joel Brobecker
  2006-10-06 20:49     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2006-10-06 20:39 UTC (permalink / raw)
  To: gdb-patches

> I don't think I looked at this the first time you sent it.  The hack is
> disgusting, but that's a problem for another day.  I think the comment
> in GCC is simply incorrect for DWARF-2, and the array should have the
> correct range type.

I am not sure which hack you refer to; if you're talking about
the encoding we're using, I also agree that it's not very elegant.
It's a artifact that comes from old times when dwarf2 wasn't available
(and still isn't always available on certain targets). However, we
*are* at AdaCore working on producing more standard dwarf, so eventually
the array index should have the correct type. We've made some progress
in that direction already, but it will take a LOT of work to complete.

> > 2006-10-06 Joel Brobecker  <brobecker@adacore.com>
> > 
> >         * dwarf2read.c (read_array_type): Set the type name if the name
> >         attribute is present.
> > 
> > Tested on x86-linux, fixes the 4 KFAILs of gdb.ada/arrayidx.exp, no
> > regression.  OK to commit?
> 
> OK.

Thanks! Will commit shortly, and then remove the KFAILs.

-- 
Joel


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

* Re: [RFA/dwarf2] Fix PR/2018 - set array type names
  2006-10-06 20:39   ` Joel Brobecker
@ 2006-10-06 20:49     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2006-10-06 20:49 UTC (permalink / raw)
  To: gdb-patches

On Fri, Oct 06, 2006 at 01:39:04PM -0700, Joel Brobecker wrote:
> > I don't think I looked at this the first time you sent it.  The hack is
> > disgusting, but that's a problem for another day.  I think the comment
> > in GCC is simply incorrect for DWARF-2, and the array should have the
> > correct range type.
> 
> I am not sure which hack you refer to; if you're talking about
> the encoding we're using, I also agree that it's not very elegant.
> It's a artifact that comes from old times when dwarf2 wasn't available
> (and still isn't always available on certain targets). However, we
> *are* at AdaCore working on producing more standard dwarf, so eventually
> the array index should have the correct type. We've made some progress
> in that direction already, but it will take a LOT of work to complete.

Good.  Glad to know I understood what it was doing correctly :-)

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2006-10-06 20:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-06 19:23 [RFA/dwarf2] Fix PR/2018 - set array type names Joel Brobecker
2006-10-06 19:28 ` Daniel Jacobowitz
2006-10-06 20:39   ` Joel Brobecker
2006-10-06 20:49     ` Daniel Jacobowitz

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