public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/13743] New: Debug Info for Java breaks inferior calls
@ 2004-01-19 17:16 aph at gcc dot gnu dot org
2004-01-19 17:22 ` [Bug java/13743] " aph at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-01-19 17:16 UTC (permalink / raw)
To: gcc-bugs
From: Jeff Johnston <jjohnstn at redhat.com>
In doing some more testing with java inferior call, I found a key
difference between the java and C++ debug info files that is causing gdb
some grief. We can't make inferior calls to non-static java members as
we can't find the vtable.
In C++, the vtable is being represented by a special member called
_vptr.class. In the DW_AT_structure_type for the class, it has a
special DW_AT_containing_type tag which points to the class that
contains this _vptr member. In this case, Property has the _vptr entry
so it points to itself. Gdb is specifically looking for this _vptr
entry and if it can't find it, gives up trying to resolve a virtual
member function.
In java, the DW_AT_containing_type tag is missing from the
DW_AT_structure_type and there isn't a _vptr member entry. I did find a
vtable member in java.lang.Object but I don't know if that is the same.
It might be possible just to point the containing_type to the
java.lang.Object and then have gdb understand and use the vtable entry.
Any thoughts? We're kind of in unchartered ground here.
I have included a better C++ example for you to look at with the debug
info from readelf -wi. The member function dothat() in the Property
class is comparable from java to C++.
--
Summary: Debug Info for Java breaks inferior calls
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: aph at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13743
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug java/13743] Debug Info for Java breaks inferior calls
2004-01-19 17:16 [Bug java/13743] New: Debug Info for Java breaks inferior calls aph at gcc dot gnu dot org
@ 2004-01-19 17:22 ` aph at gcc dot gnu dot org
2004-01-23 11:13 ` aph at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-01-19 17:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aph at gcc dot gnu dot org 2004-01-19 17:22 -------
Created an attachment (id=5523)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5523&action=view)
example code
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |aph at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13743
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug java/13743] Debug Info for Java breaks inferior calls
2004-01-19 17:16 [Bug java/13743] New: Debug Info for Java breaks inferior calls aph at gcc dot gnu dot org
2004-01-19 17:22 ` [Bug java/13743] " aph at gcc dot gnu dot org
@ 2004-01-23 11:13 ` aph at gcc dot gnu dot org
2004-02-27 14:57 ` aph at redhat dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-01-23 11:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aph at gcc dot gnu dot org 2004-01-23 11:13 -------
This is related to 6587, but is not the same bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13743
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug java/13743] Debug Info for Java breaks inferior calls
2004-01-19 17:16 [Bug java/13743] New: Debug Info for Java breaks inferior calls aph at gcc dot gnu dot org
2004-01-19 17:22 ` [Bug java/13743] " aph at gcc dot gnu dot org
2004-01-23 11:13 ` aph at gcc dot gnu dot org
@ 2004-02-27 14:57 ` aph at redhat dot com
2004-09-28 17:45 ` aph at gcc dot gnu dot org
2004-11-06 15:48 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: aph at redhat dot com @ 2004-02-27 14:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aph at redhat dot com 2004-02-27 14:57 -------
Subject: New: Debug Info for Java breaks inferior calls
I've been studying gcj's output, and it seems easy to add the vtable
info that C++ generates. I've appended a patch to do that. As far as
I can see, the output is now the same.
As you correctly guessed, in Java, the vtable pointer is always called
"vtable", and it's always at the same offset in the class. I suppose
I could change the name of the vtable pointer to _vptr.<classname> to
make it the same as C++, but I'd rather not if I can avoid it.
gdb can just use "vtable", I presume. Let me know if that doesn't
work.
Is that enough info?
Thanks,
Andrew.
Index: gcc/java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.178
diff -c -2 -p -w -r1.178 class.c
*** gcc/java/class.c 26 Feb 2004 15:34:05 -0000 1.178
--- gcc/java/class.c 27 Feb 2004 14:34:56 -0000
*************** set_super_info (int access_flags, tree t
*** 443,446 ****
--- 443,447 ----
= super_binfo;
CLASS_HAS_SUPER (this_class) = 1;
+ TYPE_VFIELD (this_class) = TYPE_VFIELD (super_class);
}
Index: gcc/java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.178
diff -c -2 -p -w -r1.178 decl.c
*** gcc/java/decl.c 5 Feb 2004 22:07:32 -0000 1.178
--- gcc/java/decl.c 27 Feb 2004 14:34:56 -0000
*************** java_init_decl_processing (void)
*** 639,642 ****
--- 639,645 ----
PUSH_FIELD (object_type_node, field, "vtable", dtable_ptr_type);
+ DECL_FCONTEXT (field) = object_type_node;
+ TYPE_VFIELD (object_type_node) = field;
+
/* This isn't exactly true, but it is what we have in the source.
There is an unresolved issue here, which is whether the vtable
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13743
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug java/13743] Debug Info for Java breaks inferior calls
2004-01-19 17:16 [Bug java/13743] New: Debug Info for Java breaks inferior calls aph at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-02-27 14:57 ` aph at redhat dot com
@ 2004-09-28 17:45 ` aph at gcc dot gnu dot org
2004-11-06 15:48 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-09-28 17:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aph at gcc dot gnu dot org 2004-09-28 17:45 -------
Fixed now.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13743
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug java/13743] Debug Info for Java breaks inferior calls
2004-01-19 17:16 [Bug java/13743] New: Debug Info for Java breaks inferior calls aph at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-09-28 17:45 ` aph at gcc dot gnu dot org
@ 2004-11-06 15:48 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-06 15:48 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13743
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-11-06 15:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19 17:16 [Bug java/13743] New: Debug Info for Java breaks inferior calls aph at gcc dot gnu dot org
2004-01-19 17:22 ` [Bug java/13743] " aph at gcc dot gnu dot org
2004-01-23 11:13 ` aph at gcc dot gnu dot org
2004-02-27 14:57 ` aph at redhat dot com
2004-09-28 17:45 ` aph at gcc dot gnu dot org
2004-11-06 15:48 ` pinskia at gcc dot gnu dot org
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).