From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10120 invoked by alias); 22 Apr 2009 19:04:11 -0000 Received: (qmail 9932 invoked by uid 22791); 22 Apr 2009 19:04:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from mail-ew0-f157.google.com (HELO mail-ew0-f157.google.com) (209.85.219.157) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Apr 2009 19:04:03 +0000 Received: by ewy1 with SMTP id 1so149783ewy.8 for ; Wed, 22 Apr 2009 12:03:58 -0700 (PDT) Received: by 10.210.66.13 with SMTP id o13mr94581eba.49.1240427038713; Wed, 22 Apr 2009 12:03:58 -0700 (PDT) Received: from ?82.6.108.62? (cpc2-cmbg8-0-0-cust61.cmbg.cable.ntl.com [82.6.108.62]) by mx.google.com with ESMTPS id 5sm713465eyh.20.2009.04.22.12.03.57 (version=SSLv3 cipher=RC4-MD5); Wed, 22 Apr 2009 12:03:58 -0700 (PDT) Message-ID: <49EF6CA8.4080307@gmail.com> Date: Wed, 22 Apr 2009 19:04:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: java-patches@gcc.gnu.org Subject: [PATCH 1/?] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap. Content-Type: multipart/mixed; boundary="------------010402030100060006010309" Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2009-q2/txt/msg00023.txt.bz2 This is a multi-part message in MIME format. --------------010402030100060006010309 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1921 [ 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 --------------010402030100060006010309 Content-Type: text/x-c; name="jdwp-debug-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="jdwp-debug-fix.diff" Content-length: 1405 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 (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 (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); --------------010402030100060006010309--