harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene S. Ostrovsky (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3730) [drlvm][jvmti] SINGLE_STEP events are not reported in JIT mode
Date Fri, 27 Apr 2007 09:27:18 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492236

Eugene S. Ostrovsky commented on HARMONY-3730:

Stepan, thanks 
  Fix is good.

  jvmti works only in interpreter mode on x86_64. On IA32 this test must be run in jit (default)
mode and optional in interpreter mode.
If there's no way to make the test run in both jit and interpreter mode for IA32 and only
in interpreter mode for x86_64 than it should be excluded for x86_64.

> [drlvm][jvmti] SINGLE_STEP events are not reported in JIT mode
> --------------------------------------------------------------
>                 Key: HARMONY-3730
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3730
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r531438
>            Reporter: Ivan Popov
>         Assigned To: Gregory Shimansky
>            Priority: Critical
>         Attachments: H3730-Regression-test.patch, H3730-Single-Step-prediction-from-native.patch,
H3730-Single-Step-prediction-from-native_v2.patch, TestClass.java
> 'Step Return' sometime works incorrectly in Eclipse debugger when Harmony is launched
in JIT mode. To reproduce this use attached TestClass.java example:
> 1. Load TestClass.java into Eclipse
> 2. Set breakpoint to line 26
> 3. Launch this class under debugger (Run->Debug...) 
> 4. After stopped at breakpoint line click 'Step Return'
> In -Xint mode the application will be stopped at line 19 (or in some system calls before
this line, if classlib is compiled with debug info). But in JIT mode this code is executed
without steps and application is stopped at Exception constructor in line 21 or even in system
shutdown code. This incorrect behavior causes problem with Eclipse Scrapbook functionality,
details are here: http://thread.gmane.org/gmane.comp.java.harmony.devel/26043/focus=26079.
> The problem is that SINGLE_STEP events are not generated for the executed code in this
case. Below are details.
> After the application is stopped at breakpoint the stack is the following:
> Thread [main] (Suspended (breakpoint at line 26 in TestClass))	
> 	TestClass.hello() line: 26	
> 	VMReflection.invokeMethod(long, Object, Object[]) line: not available [native method]

> 	Method.invoke(Object, Object[]) line: 381	
> 	TestClass.run() line: 17	
> 	TestClass.main(String[]) line: 7	
> After user clicked 'Step Return', JDWP agent sets NotifyFramePop hook for the current
frame hello() and resumes VM. When current method hello() returns, agent receives FRAME_POP
event. Then it turns on SINGLE_STEP event and waits for step event is received for the next
instruction in the calling method. 
> In -Xint mode it works well, I see the following JVMTI events are generated:
>   EVENT: [RequestManager.cpp:1417] FRAME_POP event: class=LTestClass; method=hello loc=8
>   EVENT: [RequestManager.cpp:1344] STEP event: class=Ljava/lang/reflect/Method; method=invoke
> Code of native method VMReflection.invokeMethod() is skipped and application is stopped
in Method.invoke().
> But in JIT mode the following JVMTI events are generated:
>   EVENT: [RequestManager.cpp:1417] FRAME_POP event: class=LTestClass; method=hello loc=8
>   EVENT: [RequestManager.cpp:1344] STEP event: class=Ljava/lang/Exception; method=<init>
> In this case not only code of native method VMReflection.invokeMethod() is skipped, but
also all subsequent code until constructor of Exception is invoked.
> I think this happens because SINGLE_STEP event is turned on while native method is on
top of the thread stack. This causes JVMTI not to generate step events even after returning
from native method.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message