From: Dave Korn <dave.korn.cygwin@googlemail.com>
To: java-patches@gcc.gnu.org
Subject: [PATCH 1/?] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
Date: Wed, 22 Apr 2009 19:04:00 -0000 [thread overview]
Message-ID: <49EF6CA8.4080307@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]
[ Not subbed, please CC me on replies. ]
Hello Java team,
The attached patch fixes the first build problem I run into after turning on
"--enable-libgcj-debug":
[ ... ] -DPIC -o gnu/classpath/jdwp/.libs/natVMVirtualMachine.o
/gnu/gcc/gcc/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc: In function
'void handle_single_step(jvmtiEnv*, step_info*, java::lang::Thread*,
_Jv_Method*, jlocation)':
/gnu/gcc/gcc/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc:903: error:
request for member 'frame_type' in 'thread->java::lang::Thread::frame', which
is of non-class type 'gnu::gcj::RawData*'
/gnu/gcc/gcc/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc: In function
'void jdwpBreakpointCB(jvmtiEnv*, JNIEnv*, java::lang::Thread*, _Jv_Method*,
jlocation)':
/gnu/gcc/gcc/libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc:960: error:
request for member 'frame_type' in 'thread->java::lang::Thread::frame', which
is of non-class type 'gnu::gcj::RawData*'
make[3]: *** [gnu/classpath/jdwp/natVMVirtualMachine.lo] Error 1
It looks like a couple of asserts didn't get updated at some point when the
class definition was reorganised. The member they are trying to test is
easily available from the reinterpreted pointer, so I used that instead.
libjava/ChangeLog:
* gnu/classpath/jdwp/natVMVirtualMachine.cc (handle_single_step): Use
casted pointer in debugging assert.
(jdwpBreakpointCB): Likewise.
Tested on i686-pc-cygwin by resuming a failed build and seeing it get
further. I haven't been able to test the assert in practice yet because I
only get a bit further before running into problem #2, and it occurs to me
that maybe it's entirely superfluous now as the reinterpret_cast will throw a
typeinfo exception if we pass the wrong kind of frame object to it, won't it?
So perhaps just deleting the asserts would be better.
I'll describe problem #2 in a follow-up post.
cheers,
DaveK
[-- Attachment #2: jdwp-debug-fix.diff --]
[-- Type: text/x-c, Size: 1405 bytes --]
Index: libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc
===================================================================
--- libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc (revision 146543)
+++ libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc (working copy)
@@ -900,9 +900,9 @@ handle_single_step (jvmtiEnv *env, struct step_inf
VMMethod *vmmethod = new VMMethod (klass, reinterpret_cast<jlong> (method));
Location *loc = new Location (vmmethod, location);
- JvAssert (thread->frame.frame_type == frame_interpreter);
_Jv_InterpFrame *iframe
= reinterpret_cast<_Jv_InterpFrame *> (thread->interp_frame);
+ JvAssert (iframe->frame_type == frame_interpreter);
jobject instance = iframe->get_this_ptr ();
event::SingleStepEvent *event
= new event::SingleStepEvent (thread, loc, instance);
@@ -957,9 +957,9 @@ jdwpBreakpointCB (jvmtiEnv *env, MAYBE_UNUSED JNIE
jlong methodId = reinterpret_cast<jlong> (method);
VMMethod *meth = VMVirtualMachine::getClassMethod (klass, methodId);
Location *loc = new Location (meth, location);
- JvAssert (thread->frame.frame_type == frame_interpreter);
_Jv_InterpFrame *iframe
= reinterpret_cast<_Jv_InterpFrame *> (thread->interp_frame);
+ JvAssert (iframe->frame_type == frame_interpreter);
jobject instance = iframe->get_this_ptr ();
BreakpointEvent *event = new BreakpointEvent (thread, loc, instance);
next reply other threads:[~2009-04-22 19:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 19:04 Dave Korn [this message]
2009-04-22 22:48 ` Tom Tromey
2009-04-22 22:53 ` Dave Korn
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=49EF6CA8.4080307@gmail.com \
--to=dave.korn.cygwin@googlemail.com \
--cc=java-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).