public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Strange error message from gdb
@ 2007-12-19 17:29 Andrew Haley
  2007-12-19 17:54 ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Haley @ 2007-12-19 17:29 UTC (permalink / raw)
  To: gcc

Die: DW_TAG_interface_type (abbrev = 23, offset = 4181)
	has children: FALSE
	attributes:
		DW_AT_declaration (DW_FORM_flag) flag: TRUE
Dwarf Error: Cannot find type of die [in module /home/aph/a.out]

I suppose this means that gcj is generating bad debug info, but I
don't know what it's complaining about exactly, so I don't know how to
fix it.

Here's the abbrev in question:

 <1><1055>: Abbrev Number: 23 (DW_TAG_interface_type)
  <1056>     DW_AT_declaration : 1      

Clues welcome...

Thanks,
Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

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

* Re: Strange error message from gdb
  2007-12-19 17:29 Strange error message from gdb Andrew Haley
@ 2007-12-19 17:54 ` Daniel Jacobowitz
  2007-12-19 18:01   ` Andrew Haley
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-12-19 17:54 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc

On Wed, Dec 19, 2007 at 05:21:50PM +0000, Andrew Haley wrote:
> Die: DW_TAG_interface_type (abbrev = 23, offset = 4181)
> 	has children: FALSE
> 	attributes:
> 		DW_AT_declaration (DW_FORM_flag) flag: TRUE
> Dwarf Error: Cannot find type of die [in module /home/aph/a.out]
> 
> I suppose this means that gcj is generating bad debug info, but I
> don't know what it's complaining about exactly, so I don't know how to
> fix it.
> 
> Here's the abbrev in question:
> 
>  <1><1055>: Abbrev Number: 23 (DW_TAG_interface_type)
>   <1056>     DW_AT_declaration : 1      

That DIE doesn't have any content.  It says "I am a declartion of an
interface".  But not which interface or what it's called or what the
type is.

I'd need a backtrace to be more specific, but in addition to bad debug
info this may be a limitation in GDB; it does not know anything about
DW_TAG_interface_type.

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: Strange error message from gdb
  2007-12-19 17:54 ` Daniel Jacobowitz
@ 2007-12-19 18:01   ` Andrew Haley
  2007-12-19 19:00     ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Haley @ 2007-12-19 18:01 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gcc

Daniel Jacobowitz writes:
 > On Wed, Dec 19, 2007 at 05:21:50PM +0000, Andrew Haley wrote:
 > > Die: DW_TAG_interface_type (abbrev = 23, offset = 4181)
 > > 	has children: FALSE
 > > 	attributes:
 > > 		DW_AT_declaration (DW_FORM_flag) flag: TRUE
 > > Dwarf Error: Cannot find type of die [in module /home/aph/a.out]
 > > 
 > > I suppose this means that gcj is generating bad debug info, but I
 > > don't know what it's complaining about exactly, so I don't know how to
 > > fix it.
 > > 
 > > Here's the abbrev in question:
 > > 
 > >  <1><1055>: Abbrev Number: 23 (DW_TAG_interface_type)
 > >   <1056>     DW_AT_declaration : 1      
 > 
 > That DIE doesn't have any content.  It says "I am a declartion of an
 > interface".  But not which interface or what it's called or what the
 > type is.

Well, the type is the interface: there's nothing else it might be.

 > I'd need a backtrace to be more specific, but in addition to bad
 > debug info this may be a limitation in GDB; it does not know
 > anything about DW_TAG_interface_type.

OK, thanks.

Anyway, on inspection it seems like read_type_die() in dwarf2read.c
doesn't know how to handle DW_TAG_interface_type.  This is rather odd,
given that dwarf_tag_name() does know about interface types.

Maybe I should just fix gcj not to use DW_TAG_interface_type.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

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

* Re: Strange error message from gdb
  2007-12-19 18:01   ` Andrew Haley
@ 2007-12-19 19:00     ` Daniel Jacobowitz
  2007-12-19 19:05       ` Andrew Haley
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-12-19 19:00 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc

On Wed, Dec 19, 2007 at 05:54:10PM +0000, Andrew Haley wrote:
>  > That DIE doesn't have any content.  It says "I am a declartion of an
>  > interface".  But not which interface or what it's called or what the
>  > type is.
> 
> Well, the type is the interface: there's nothing else it might be.

From the DWARF standard:

 Interface types are represented by debugging information entries with
 the tag DW_TAG_interface_type.

 An interface type entry has a DW_AT_name attribute, whose value is a
 null-terminated string containing the type name as it appears in the
 source program.

 The members of an interface are represented by debugging information
 entries that are owned by the interface type entry and that appear in
 the same order as the corresponding declarations in the source
 program.

So this is a declaration of an interface, but without a name.  GDB is
doing the wrong thing with it, but it still seems wrong to me.  Or do
Java interfaces have no name?

> Anyway, on inspection it seems like read_type_die() in dwarf2read.c
> doesn't know how to handle DW_TAG_interface_type.  This is rather odd,
> given that dwarf_tag_name() does know about interface types.

That's just a complete transcription of the DWARF tags (at some point
in history).

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: Strange error message from gdb
  2007-12-19 19:00     ` Daniel Jacobowitz
@ 2007-12-19 19:05       ` Andrew Haley
  2007-12-19 19:05         ` Daniel Jacobowitz
  2007-12-20  5:51         ` Alexandre Oliva
  0 siblings, 2 replies; 11+ messages in thread
From: Andrew Haley @ 2007-12-19 19:05 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gcc

Daniel Jacobowitz writes:
 > On Wed, Dec 19, 2007 at 05:54:10PM +0000, Andrew Haley wrote:
 > >  > That DIE doesn't have any content.  It says "I am a declartion of an
 > >  > interface".  But not which interface or what it's called or what the
 > >  > type is.
 > > 
 > > Well, the type is the interface: there's nothing else it might be.
 > 
 > >From the DWARF standard:
 > 
 >  Interface types are represented by debugging information entries with
 >  the tag DW_TAG_interface_type.
 > 
 >  An interface type entry has a DW_AT_name attribute, whose value is a
 >  null-terminated string containing the type name as it appears in the
 >  source program.
 > 
 >  The members of an interface are represented by debugging information
 >  entries that are owned by the interface type entry and that appear in
 >  the same order as the corresponding declarations in the source
 >  program.

OK, so the name is missing, and that's wrong.  I should find out why.

 > So this is a declaration of an interface, but without a name.  GDB is
 > doing the wrong thing with it, but it still seems wrong to me.  Or do
 > Java interfaces have no name?
 > 
 > > Anyway, on inspection it seems like read_type_die() in dwarf2read.c
 > > doesn't know how to handle DW_TAG_interface_type.  This is rather odd,
 > > given that dwarf_tag_name() does know about interface types.
 > 
 > That's just a complete transcription of the DWARF tags (at some point
 > in history).

Right, so read_type_die() doesn't know how to handle
DW_TAG_interface_type.  The weird thing is that I have never seen this
error mesage before today, and AFAIAA gcj has been generating these
interface types for a long while.

It seems to me that even if gcj did generate the name for the
interface, gdb would still die because it doesn't have any handlers
for DW_TAG_interface_type in dwarf2read.c

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

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

* Re: Strange error message from gdb
  2007-12-19 19:05       ` Andrew Haley
@ 2007-12-19 19:05         ` Daniel Jacobowitz
  2007-12-20  5:51         ` Alexandre Oliva
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-12-19 19:05 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc

On Wed, Dec 19, 2007 at 07:00:41PM +0000, Andrew Haley wrote:
> It seems to me that even if gcj did generate the name for the
> interface, gdb would still die because it doesn't have any handlers
> for DW_TAG_interface_type in dwarf2read.c

Yes, you're probably right.  It thinks it's some kind of symbol,
probably.  There's a default: in the DIE processing that, strictly
speaking, ought not to be there.

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: Strange error message from gdb
  2007-12-19 19:05       ` Andrew Haley
  2007-12-19 19:05         ` Daniel Jacobowitz
@ 2007-12-20  5:51         ` Alexandre Oliva
  2007-12-20 14:24           ` Andrew Haley
  1 sibling, 1 reply; 11+ messages in thread
From: Alexandre Oliva @ 2007-12-20  5:51 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Daniel Jacobowitz, gcc

On Dec 19, 2007, Andrew Haley <aph@redhat.com> wrote:

> Right, so read_type_die() doesn't know how to handle
> DW_TAG_interface_type.  The weird thing is that I have never seen this
> error mesage before today, and AFAIAA gcj has been generating these
> interface types for a long while.

For very small values of "long while" :-)

This was added by:

2007-12-15  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/7081
	* lang.c (java_classify_record): New.
	(LANG_HOOKS_CLASSIFY_RECORD): Override.

Sorry, I didn't check whether GDB or other debug information consumers
supported this tag.  I just ASSumed they did, given how long they've
been specified (today Dwarf 3 turns 2 :-) and how noisy a failure
would be should one run into such a tag without supporting it.

What now, revert until GDB et al are fixed, or leave it in, for it's
the right thing to do, and it serves as an additional incentive for
debug information consumers to support new Dwarf 3 features?

Or introduce the -gdwarf-3 and get -gdwarf-2 (and -g?) to avoid using
Dwarf 3 features that are not backward compatible?

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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

* Re: Strange error message from gdb
  2007-12-20  5:51         ` Alexandre Oliva
@ 2007-12-20 14:24           ` Andrew Haley
  2007-12-20 14:33             ` Alexandre Oliva
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Haley @ 2007-12-20 14:24 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Daniel Jacobowitz, gcc

Alexandre Oliva writes:
 > On Dec 19, 2007, Andrew Haley <aph@redhat.com> wrote:
 > 
 > > Right, so read_type_die() doesn't know how to handle
 > > DW_TAG_interface_type.  The weird thing is that I have never seen
 > > this error mesage before today, and AFAIAA gcj has been
 > > generating these interface types for a long while.
 > 
 > For very small values of "long while" :-)
 > 
 > This was added by:
 > 
 > 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
 > 
 > 	PR debug/7081
 > 	* lang.c (java_classify_record): New.
 > 	(LANG_HOOKS_CLASSIFY_RECORD): Override.

Yeah, I discovered this today.  Because your patch hadn't been flagged
as affecting Java and no Java maintainer approved it, I hadn't
noticed.

 > Sorry, I didn't check whether GDB or other debug information
 > consumers supported this tag.  I just ASSumed they did, given how
 > long they've been specified (today Dwarf 3 turns 2 :-) and how
 > noisy a failure would be should one run into such a tag without
 > supporting it.

Well, that was a bad thing to do.

 > What now, revert until GDB et al are fixed, or leave it in, for
 > it's the right thing to do, and it serves as an additional
 > incentive for debug information consumers to support new Dwarf 3
 > features?

Please revert it, right now.  It is impossible for anyone to debug gcj
code at the moment.  Once gdb support is in and widely distributed,
then we can change gcc.  Realistically, at least a year or two.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

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

* Re: Strange error message from gdb
  2007-12-20 14:24           ` Andrew Haley
@ 2007-12-20 14:33             ` Alexandre Oliva
  2007-12-20 15:09               ` Andrew Haley
  0 siblings, 1 reply; 11+ messages in thread
From: Alexandre Oliva @ 2007-12-20 14:33 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Daniel Jacobowitz, gcc

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

On Dec 20, 2007, Andrew Haley <aph@redhat.com> wrote:

> Alexandre Oliva writes:
>> PR debug/7081
>> * lang.c (java_classify_record): New.
>> (LANG_HOOKS_CLASSIFY_RECORD): Override.

> Yeah, I discovered this today.  Because your patch hadn't been flagged
> as affecting Java and no Java maintainer approved it, I hadn't
> noticed.

Sorry.

>> What now, revert until GDB et al are fixed, or leave it in, for
>> it's the right thing to do, and it serves as an additional
>> incentive for debug information consumers to support new Dwarf 3
>> features?

> Please revert it, right now.

How about this patch, instead?  It will restore debuggability to Java
while at the same time maintaining the progress of using the
long-supported-by-GDB DW_TAG_class_type in both C++ and Java.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gcc-dwarf-record-types-java-revert.patch --]
[-- Type: text/x-patch, Size: 735 bytes --]

for  gcc/java/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* lang.c (java_classify_record): Don't return
	RECORD_IS_INTERFACE for now.

Index: gcc/java/lang.c
===================================================================
--- gcc/java/lang.c.orig	2007-12-15 18:18:56.000000000 -0200
+++ gcc/java/lang.c	2007-12-20 12:17:26.000000000 -0200
@@ -965,7 +965,9 @@ java_classify_record (tree type)
   if (! CLASS_P (type))
     return RECORD_IS_STRUCT;
 
-  if (CLASS_INTERFACE (TYPE_NAME (type)))
+  /* ??? GDB does not support DW_TAG_interface_type as of December,
+     2007.  Re-enable this at a later time.  */
+  if (0 && CLASS_INTERFACE (TYPE_NAME (type)))
     return RECORD_IS_INTERFACE;
 
   return RECORD_IS_CLASS;

[-- Attachment #3: Type: text/plain, Size: 250 bytes --]



-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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

* Re: Strange error message from gdb
  2007-12-20 14:33             ` Alexandre Oliva
@ 2007-12-20 15:09               ` Andrew Haley
  2007-12-22 22:49                 ` Jan Kratochvil
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Haley @ 2007-12-20 15:09 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Daniel Jacobowitz, gcc

Alexandre Oliva writes:
 > 
 > How about this patch, instead?  It will restore debuggability to Java
 > while at the same time maintaining the progress of using the
 > long-supported-by-GDB DW_TAG_class_type in both C++ and Java.
 > 
 > for  gcc/java/ChangeLog
 > from  Alexandre Oliva  <aoliva@redhat.com>
 > 
 > 	* lang.c (java_classify_record): Don't return
 > 	RECORD_IS_INTERFACE for now.
 > 

OK, thanks.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

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

* Re: Strange error message from gdb
  2007-12-20 15:09               ` Andrew Haley
@ 2007-12-22 22:49                 ` Jan Kratochvil
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Kratochvil @ 2007-12-22 22:49 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Alexandre Oliva, gcc

On Thu, 20 Dec 2007 15:33:14 +0100, Andrew Haley wrote:
> Alexandre Oliva writes:
> > 
> > How about this patch, instead?  It will restore debuggability to Java
> > while at the same time maintaining the progress of using the
> > long-supported-by-GDB DW_TAG_class_type in both C++ and Java.
> > 
> > for  gcc/java/ChangeLog
> > from  Alexandre Oliva  <aoliva@redhat.com>
> > 
> > 	* lang.c (java_classify_record): Don't return
> > 	RECORD_IS_INTERFACE for now.
> > 
> 
> OK, thanks.

FYI GDB HEAD supports it now (just the backward compatible way, no new info
extracted from it so far).
	http://sourceware.org/ml/gdb-cvs/2007-12/msg00123.html


Regards,
Jan

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

end of thread, other threads:[~2007-12-22 21:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-19 17:29 Strange error message from gdb Andrew Haley
2007-12-19 17:54 ` Daniel Jacobowitz
2007-12-19 18:01   ` Andrew Haley
2007-12-19 19:00     ` Daniel Jacobowitz
2007-12-19 19:05       ` Andrew Haley
2007-12-19 19:05         ` Daniel Jacobowitz
2007-12-20  5:51         ` Alexandre Oliva
2007-12-20 14:24           ` Andrew Haley
2007-12-20 14:33             ` Alexandre Oliva
2007-12-20 15:09               ` Andrew Haley
2007-12-22 22:49                 ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).