public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/?] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
@ 2009-04-22 19:04 Dave Korn
  2009-04-22 22:48 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Korn @ 2009-04-22 19:04 UTC (permalink / raw)
  To: java-patches

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

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

end of thread, other threads:[~2009-04-22 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22 19:04 [PATCH 1/?] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap Dave Korn
2009-04-22 22:48 ` Tom Tromey
2009-04-22 22:53   ` Dave Korn

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