changeset 4940:cc83359f5e5e hs24.60-b01

8019396: SA-JDI: OSThread class initialization throws an exception Summary: Method s.j.h.r.OSThread.initialize throws a an exception Reviewed-by: dholmes, mgerdin
author dsamersoff
date Fri, 04 Oct 2013 12:08:11 +0400
parents fd506dce728a
children 62c54975ca01
files agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java	Thu Oct 03 18:41:44 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java	Fri Oct 04 12:08:11 2013 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,11 +29,10 @@
     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;
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java	Thu Oct 03 18:41:44 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java	Fri Oct 04 12:08:11 2013 +0400
@@ -32,7 +32,7 @@
 // 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 @@
     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 int threadId() {
-        return (int)threadIdField.getValue(addr);
+        return threadIdField.getJInt(addr);
     }
 
 }