From e72dd36eca3562c36316347b84c4b2e04ed9b852 Mon Sep 17 00:00:00 2001 From: dsamersoff Date: Tue, 6 Aug 2013 14:28:48 +0400 Subject: [PATCH] 8019396: SA-JDI OSThread class initialization throws an exception Summary: Method sun.jvm.hotspot.runtime.OSThread.initialize throws a sun.jvm.hotspot.types.WrongTypeException Reviewed-by: dholmes, mgerdin --- .../share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java | 3 +-- .../src/share/classes/sun/jvm/hotspot/runtime/OSThread.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java index dd800a49b..dbf09b291 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java +++ b/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java @@ -29,11 +29,10 @@ public interface JVMTIThreadState { public static final int JVMTI_THREAD_STATE_ALIVE = 0x0001; public static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002; public static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004; - public static final int JVMTI_THREAD_STATE_WAITING = 0x0008; + public static final int JVMTI_THREAD_STATE_WAITING = 0x0080; public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010; public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020; public static final int JVMTI_THREAD_STATE_SLEEPING = 0x0040; - public static final int JVMTI_THREAD_STATE_WAITING_FOR_NOTIFICATION = 0x0080; public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100; public static final int JVMTI_THREAD_STATE_PARKED = 0x0200; public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400; diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java index fb17c53d3..226a17625 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java @@ -32,7 +32,7 @@ import sun.jvm.hotspot.types.*; // to the sys_thread_t structure of the classic JVM implementation. public class OSThread extends VMObject { private static JIntField interruptedField; - private static JIntField threadIdField; + private static Field threadIdField; static { VM.registerVMInitializedObserver(new Observer() { public void update(Observable o, Object data) { @@ -44,7 +44,7 @@ public class OSThread extends VMObject { private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("OSThread"); interruptedField = type.getJIntField("_interrupted"); - threadIdField = type.getJIntField("_thread_id"); + threadIdField = type.getField("_thread_id"); } public OSThread(Address addr) { @@ -56,7 +56,7 @@ public class OSThread extends VMObject { } public int threadId() { - return (int)threadIdField.getValue(addr); + return threadIdField.getJInt(addr); } } -- GitLab