From dev-return-30083-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Fri Oct 19 19:15:26 2007 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 77198 invoked from network); 19 Oct 2007 19:15:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Oct 2007 19:15:26 -0000 Received: (qmail 24252 invoked by uid 500); 19 Oct 2007 19:15:12 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 24225 invoked by uid 500); 19 Oct 2007 19:15:12 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 24216 invoked by uid 99); 19 Oct 2007 19:15:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 12:15:12 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alexei.fedotov@gmail.com designates 209.85.132.241 as permitted sender) Received: from [209.85.132.241] (HELO an-out-0708.google.com) (209.85.132.241) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 19:15:16 +0000 Received: by an-out-0708.google.com with SMTP id b8so112503ana for ; Fri, 19 Oct 2007 12:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=kRJl/riuprIhSWJNPl6jbs1SsJLlyta0Txkd16db8tM=; b=agGybtI+pBasFwXbY8BzHDHRX5gcqJbriJCD1cDr1BOIELw4p0uQbmoQkVFNoRWeFJL+MslcCVDE+F+NCLtbLngd2nr8FpMnCZ1aDRqMeRZG5nX8YP0MmbNdbTS6XrCb4XJJazW8hjkDIsN/3UajLO/ZUgtrqKp1ef3SnXuvnxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=OMjIkO++k2JxRNAELWfNOchkjZdw4JvTMq2RZqxS55dLkUrNycwMYudTBUpjU0Ter+oUa2M0qdPIEuO8toqDwpbuWo09msqyUIcxfaarJSNMgngGU7wBYPkNeIW5stPGV/gUPZaldF3fCiOVNthzR44vWAS0Ye133un26z74A9Y= Received: by 10.142.101.17 with SMTP id y17mr890066wfb.1192821293707; Fri, 19 Oct 2007 12:14:53 -0700 (PDT) Received: by 10.67.21.8 with HTTP; Fri, 19 Oct 2007 12:14:53 -0700 (PDT) Message-ID: Date: Fri, 19 Oct 2007 23:14:53 +0400 From: "Alexei Fedotov" To: dev@harmony.apache.org Subject: [drlvm][regression] jvmti single step is broken MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hello Gregory, I have filed a bug [1] which may be caused by your recent changes. Thanks. [1] http://issues.apache.org/jira/browse/HARMONY-4981 On 10/19/07, gshimansky@apache.org wrote: > Author: gshimansky > Date: Fri Oct 19 04:09:47 2007 > New Revision: 586379 > > URL: http://svn.apache.org/viewvc?rev=586379&view=rev > Log: > Improved JVMTI for handling invokevirtual and invokeinterface on x86_64 architecture. > Capabilities for breakpoint and single step are turned on. > > > Modified: > harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h > harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h > harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp > harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp > harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp > > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h?rev=586379&r1=586378&r2=586379&view=diff > ============================================================================== > --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h (original) > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h Fri Oct 19 04:09:47 2007 > @@ -78,7 +78,7 @@ > }; > > // Pointer to interface callback function > -typedef bool (*BPInterfaceCallBack)(TIEnv *env, VMBreakPoint* bp, POINTER_SIZE_INT data); > +typedef bool (*BPInterfaceCallBack)(TIEnv *env, const VMBreakPoint* bp, const POINTER_SIZE_INT data); > typedef bool (*BPInterfaceProcedure) (VMBreakPoint *bp); > > class VMBreakPoints > > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h?rev=586379&r1=586378&r2=586379&view=diff > ============================================================================== > --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h (original) > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h Fri Oct 19 04:09:47 2007 > @@ -423,6 +423,6 @@ > unsigned location, jvmti_StepLocation **next_step, unsigned *count); > > // Callback function for JVMTI breakpoint processing > -bool jvmti_process_breakpoint_event(TIEnv *env, VMBreakPoint* bp, POINTER_SIZE_INT data); > +bool jvmti_process_breakpoint_event(TIEnv *env, const VMBreakPoint* bp, const POINTER_SIZE_INT data); > > #endif /* _JVMTI_INTERNAL_H_ */ > > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp?rev=586379&r1=586378&r2=586379&view=diff > ============================================================================== > --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp (original) > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp Fri Oct 19 04:09:47 2007 > @@ -39,7 +39,7 @@ > > > // Callback function for JVMTI breakpoint processing > -bool jvmti_process_breakpoint_event(TIEnv *env, VMBreakPoint* bp, POINTER_SIZE_INT UNREF data) > +bool jvmti_process_breakpoint_event(TIEnv *env, const VMBreakPoint* bp, const POINTER_SIZE_INT UNREF data) > { > assert(bp); > > > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp?rev=586379&r1=586378&r2=586379&view=diff > ============================================================================== > --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp (original) > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp Fri Oct 19 04:09:47 2007 > @@ -87,10 +87,10 @@ > 1, // can_get_source_debug_extension > 1, // can_access_local_variables > 0, // can_maintain_original_method_order > - 0, // can_generate_single_step_events > + 1, // can_generate_single_step_events > 1, // can_generate_exception_events > 1, // can_generate_frame_pop_events > - 0, // can_generate_breakpoint_events > + 1, // can_generate_breakpoint_events > 1, // can_suspend > 0, // can_redefine_any_class > 1, // can_get_current_thread_cpu_time > > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp?rev=586379&r1=586378&r2=586379&view=diff > ============================================================================== > --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp (original) > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp Fri Oct 19 04:09:47 2007 > @@ -494,8 +494,8 @@ > } > } > > -static void jvmti_start_single_step_in_virtual_method(DebugUtilsTI *ti, VMBreakPoint* bp, > - POINTER_SIZE_INT data) > +static void jvmti_start_single_step_in_virtual_method(DebugUtilsTI *ti, const VMBreakPoint* bp, > + const POINTER_SIZE_INT data, const unsigned char bytecode) > { > #if (defined _IA32_) || (defined _EM64T_) > VM_thread *vm_thread = p_TLS_vmthread; > @@ -517,11 +517,11 @@ > > const InstructionDisassembler::Opnd& op = disasm->get_opnd(0); > Method *method; > - if (op.kind == InstructionDisassembler::Kind_Mem) > + if (bytecode == OPCODE_INVOKEVIRTUAL) > { > // Invokevirtual uses indirect call from VTable. The base > // address is in the register, offset is in displacement * > - // scale. This method is much faster than > + // scale. > VTable* vtable = (VTable*)disasm->get_reg_value(op.base, ®s); > assert(vtable); > // For x86 based architectures offset cannot be longer than 32 > @@ -530,7 +530,7 @@ > op.scale + op.disp); > method = class_get_method_from_vt_offset(vtable, offset); > } > - else if (op.kind == InstructionDisassembler::Kind_Reg) > + else if (bytecode == OPCODE_INVOKEINTERFACE) > { > // This is invokeinterface bytecode which uses register > // call so we need to search through all methods for this > @@ -577,7 +577,7 @@ > > // Callback function for JVMTI single step processing > static bool jvmti_process_jit_single_step_event(TIEnv* UNREF unused_env, > - VMBreakPoint* bp, POINTER_SIZE_INT data) > + const VMBreakPoint* bp, const POINTER_SIZE_INT data) > { > assert(bp); > > @@ -610,7 +610,10 @@ > > if ((bool)data) > { > - jvmti_start_single_step_in_virtual_method(ti, bp, data); > + const unsigned char *bytecode = reinterpret_cast(method)->get_byte_code_addr(); > + const unsigned char bc = bytecode[location]; > + assert(bc == OPCODE_INVOKEINTERFACE || bc == OPCODE_INVOKEVIRTUAL); > + jvmti_start_single_step_in_virtual_method(ti, bp, data, bc); > return true; > } > > > > -- With best regards, Alexei, ESSD, Intel