incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monte...@apache.org
Subject svn commit: r827610 - in /incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti: javaruntime/ javaruntime/model/ reader/
Date Tue, 20 Oct 2009 14:50:18 GMT
Author: monteith
Date: Tue Oct 20 14:50:17 2009
New Revision: 827610

URL: http://svn.apache.org/viewvc?rev=827610&view=rev
Log:
Remove problem with stack being overflowed. Add JavaHeap support.

Added:
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/DeferredReference.java
  (with props)
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/EmptyList.java
  (with props)
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JHeap.java
  (with props)
Modified:
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java
    incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/reader/CJVMTIBinReader.java

Modified: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java?rev=827610&r1=827609&r2=827610&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
Tue Oct 20 14:50:17 2009
@@ -24,20 +24,20 @@
 import javax.tools.diagnostics.image.DataUnavailable;
 import javax.tools.diagnostics.image.ImagePointer;
 import javax.tools.diagnostics.image.MemoryAccessException;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
 import javax.tools.diagnostics.runtime.java.JavaObject;
 import javax.tools.diagnostics.runtime.java.JavaRuntime;
+import javax.tools.diagnostics.runtime.java.JavaThread;
 import javax.tools.diagnostics.runtime.java.JavaVMInitArgs;
 
 import org.apache.kato.jvmti.javaruntime.model.Model;
 import org.apache.kato.jvmti.reader.CLogger;
 
 public class JavaRuntimeImpl implements JavaRuntime {
-
-
-	private Model base=null;
+	private Model model=null;
 	
-	public JavaRuntimeImpl(Model m) throws IOException {
-		this.base=m;
+	public JavaRuntimeImpl(Model model) throws IOException {
+		this.model=model;
 	}
 	
 	@Override
@@ -50,15 +50,20 @@
 		return new LinkedList();
 	}
 
+	private List<JavaHeap> heap = null;
 	@Override
-	public List getHeaps() {
-		return new LinkedList();
+	public List<JavaHeap> getHeaps() {
+		 if (heap == null) {
+			 heap = new LinkedList<JavaHeap>();
+			 heap.add(model.getHeap());
+		 }
+		 return heap;
 	}
 
 	@Override
 	public List getJavaClassLoaders() {
 		
-		return base.getJavaClassLoader();
+		return model.getJavaClassLoader();
 	}
 
 	@Override
@@ -76,27 +81,33 @@
 	@Override
 	public List getMonitors() {
 		
-		return base.getJavaMonitors();
+		return model.getJavaMonitors();
 	}
 
 	@Override
-	public JavaObject getObjectAtAddress(ImagePointer arg0)
+	public JavaObject getObjectAtAddress(ImagePointer pointer)
 			throws CorruptDataException, IllegalArgumentException,
 			MemoryAccessException, DataUnavailable {
-		CLogger.logr.log(Level.FINEST,"Ask for object at"+arg0.getAddress());
-		return base.getObjectAtAddress(arg0.getAddress());
+		CLogger.logr.log(Level.FINEST,"Ask for object at"+pointer.getAddress());
+		
+		JavaObject obj =  model.getObjectAtAddress(pointer.getAddress());
+		
+		if (obj == null) {
+			throw new IllegalArgumentException("Unable to retrieve an object at 0x"+
+					Long.toHexString(pointer.getAddress()));
+		}
+		
+		return obj;
 	}
 
 	@Override
-	public List getThreads() {
-		
-		return base.getThreads();
+	public List<JavaThread> getThreads() {		
+		return model.getThreads();
 	}
 
 	@Override
 	public Object getTraceBuffer(String arg0, boolean arg1)
 			throws CorruptDataException {
-		// TODO Auto-generated method stub
 		return null;
 	}
 

Added: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/DeferredReference.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/DeferredReference.java?rev=827610&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/DeferredReference.java
(added)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/DeferredReference.java
Tue Oct 20 14:50:17 2009
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.jvmti.javaruntime.model;
+
+/**
+ * Holds a reference to an object without itself being a JObject. 
+ * Is used as Field values to prevent unconstrained recursion.
+ * 
+ */
+public class DeferredReference {
+	private long pos;
+	
+	public DeferredReference(long pos) {
+		this.pos = pos;
+	}
+	
+	/**
+	 * @return position of referenced object on disk.
+	 */
+	public long getPos() {
+		return this.pos;
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/DeferredReference.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/EmptyList.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/EmptyList.java?rev=827610&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/EmptyList.java
(added)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/EmptyList.java
Tue Oct 20 14:50:17 2009
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+
+/**
+ * Implements a List with no objects.
+ * Saves creating an empty collection class.
+ *
+ */
+public class EmptyList<E> implements List<E> {
+
+	@Override
+	public boolean add(E e) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public void add(int index, E element) {
+		throw new UnsupportedOperationException();		
+	}
+
+	@Override
+	public boolean addAll(Collection<? extends E> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean addAll(int index, Collection<? extends E> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public void clear() {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean contains(Object o) {
+		return false;
+	}
+
+	@Override
+	public boolean containsAll(Collection<?> c) {
+		return false;
+	}
+
+	@Override
+	public E get(int index) {
+		throw new IndexOutOfBoundsException();
+	}
+
+	@Override
+	public int indexOf(Object o) {
+		return -1;
+	}
+
+	@Override
+	public boolean isEmpty() {
+		return true;
+	}
+
+	@Override
+	public Iterator<E> iterator() {
+		return new Iterator<E>() {
+			@Override
+			public boolean hasNext() {
+				return false;
+			}
+
+			@Override
+			public E next() {
+				throw new NoSuchElementException();
+			}
+
+			@Override
+			public void remove() {
+				throw new UnsupportedOperationException();				
+			}
+		};
+	}
+
+	@Override
+	public int lastIndexOf(Object o) {
+		return -1;
+	}
+
+	@Override
+	public ListIterator<E> listIterator() {
+		return new ListIterator<E>() {
+
+			@Override
+			public void add(E e) {
+				throw new UnsupportedOperationException();				
+			}
+
+			@Override
+			public boolean hasNext() {
+				return false;
+			}
+
+			@Override
+			public boolean hasPrevious() {
+				return false;
+			}
+
+			@Override
+			public E next() {
+				throw new NoSuchElementException();
+			}
+			
+			@Override
+			public int nextIndex() {
+				return 0;
+			}
+
+			@Override
+			public E previous() {
+				throw new NoSuchElementException();
+			}
+
+			@Override
+			public int previousIndex() {
+				return -1;
+			}
+
+			@Override
+			public void remove() {
+				throw new UnsupportedOperationException();				
+			}
+
+			@Override
+			public void set(E e) {
+				throw new UnsupportedOperationException();
+			}
+			
+		};
+	}
+
+	@Override
+	public ListIterator<E> listIterator(int index) {
+		throw new IndexOutOfBoundsException();
+	}
+
+	@Override
+	public boolean remove(Object o) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public E remove(int index) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean removeAll(Collection<?> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public boolean retainAll(Collection<?> c) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public E set(int index, E element) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public int size() {
+		return 0;
+	}
+
+	@Override
+	public List<E> subList(int fromIndex, int toIndex) {
+		throw new IndexOutOfBoundsException();
+	}
+
+	private static Object emptyArray[] = new Object[0];
+	
+	@Override
+	public Object[] toArray() {
+		return emptyArray;
+	}
+
+	@Override
+	public <T> T[] toArray(T[] a) {
+		if (a == null) {
+			throw new NullPointerException();
+		}
+		
+		return a;
+	}
+	
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/EmptyList.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JHeap.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JHeap.java?rev=827610&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JHeap.java
(added)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JHeap.java
Tue Oct 20 14:50:17 2009
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.List;
+
+import javax.tools.diagnostics.image.ImageSection;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
+import javax.tools.diagnostics.runtime.java.JavaObject;
+
+/**
+ * Makes available all of the objects in the heap 
+ * by extracting their List from the Model. 
+ *
+ */
+public class JHeap implements JavaHeap {
+	private static final String HEAP_NAME="Object Heap";	
+	
+	private Model model;
+	
+	public JHeap(Model model) {
+		this.model = model;
+	}
+
+	/**
+	 * Return a made-up name.
+	 */
+	@Override
+	public String getName() {
+		return HEAP_NAME;
+	}
+
+	@Override
+	public List<JavaObject> getObjects() {
+		return model.getObjects();
+	}
+
+	/**
+	 * Returns empty list as we have no image sections to report. 
+	 */
+	@Override
+	public List<ImageSection> getSections() {
+		return new EmptyList<ImageSection>();
+	}
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JHeap.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java?rev=827610&r1=827609&r2=827610&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java
Tue Oct 20 14:50:17 2009
@@ -20,9 +20,6 @@
 import java.util.Map;
 import java.util.logging.Level;
 
-import org.apache.kato.jvmti.reader.CJVMTIBinReader;
-import org.apache.kato.jvmti.reader.CLogger;
-
 import javax.tools.diagnostics.image.CorruptDataException;
 import javax.tools.diagnostics.image.DataUnavailable;
 import javax.tools.diagnostics.image.ImagePointer;
@@ -31,21 +28,31 @@
 import javax.tools.diagnostics.runtime.java.JavaHeap;
 import javax.tools.diagnostics.runtime.java.JavaObject;
 
+import org.apache.kato.jvmti.reader.CLogger;
+
+/**
+ * Represents a Java object.
+ * 
+ * 
+ *
+ */
 public class JObject implements JavaObject {
 
 	private long objid = 0;
 	private long size = 0;
 	private Map<Long, Object> data = new HashMap<Long, Object>();
 	private JClass clazz = null;
-	public boolean visited = false;
+	private boolean visited = false;
 	public boolean isArray = false;
 	public Object[] objArray;
 	public int objectSize = 0;
 	private JObject superClazzObject = null;
-
-	public JObject(JClass clazz, long objID) {
+	private Model model;
+	
+	public JObject(JClass clazz, long objID, Model model) {
 		this.clazz = clazz;
 		this.objid = objID;
+		this.model = model;
 		if (clazz != null) {
 			try {
 				this.isArray = clazz.isArray();
@@ -56,6 +63,10 @@
 		}
 	}
 
+	long getObjectID() {
+		return objid;
+	}
+	
 	public void addValue(long fieldid, Object data) {
 		this.data.put(fieldid, data);
 	}
@@ -135,7 +146,13 @@
 
 	public Object getValue(long id) {
 		if (data.containsKey(id)) {
-			return data.get(id);
+			Object jobj = data.get(id);
+			
+			// Resolve a deferred reference. 
+			if (jobj instanceof DeferredReference) {
+				return model.getObjectAtAddress(((DeferredReference) jobj).getPos());
+			}
+			return jobj;
 		} else {
 			if (superClazzObject != null) {
 				return superClazzObject.getValue(id);
@@ -268,8 +285,7 @@
 
 	@Override
 	public JavaHeap getHeap() throws CorruptDataException, DataUnavailable {
-		// TODO Auto-generated method stub
-		return null;
+		return model.getHeap();
 	}
 
 	@Override
@@ -333,5 +349,13 @@
 	public int getNumFields(){
 		return data.size();
 	}
+
+	public void setVisited(boolean visited) {
+		this.visited = visited;
+	}
+
+	public boolean isVisited() {
+		return visited;
+	}
 	
 }
\ No newline at end of file

Modified: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java?rev=827610&r1=827609&r2=827610&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java
Tue Oct 20 14:50:17 2009
@@ -14,27 +14,28 @@
 
 package org.apache.kato.jvmti.javaruntime.model;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import javax.tools.diagnostics.runtime.java.JavaClass;
 import javax.tools.diagnostics.runtime.java.JavaClassLoader;
+import javax.tools.diagnostics.runtime.java.JavaHeap;
 import javax.tools.diagnostics.runtime.java.JavaMethod;
 import javax.tools.diagnostics.runtime.java.JavaMonitor;
 import javax.tools.diagnostics.runtime.java.JavaObject;
 import javax.tools.diagnostics.runtime.java.JavaThread;
 
 public class Model {
-	
+
 	private ObjectMapList<Long,JavaThread> threadMap=new ObjectMapList<Long,JavaThread>();
 	Map<Long,JavaClass>  classMap=new HashMap<Long,JavaClass>();
 	private ObjectMapList<Long,JavaClassLoader> loadersMap=new ObjectMapList<Long,JavaClassLoader>();
 	private ObjectMapList<Long,JavaMonitor> monitorsMap=new ObjectMapList<Long,JavaMonitor>();
 	private ObjectMapList<Long,JavaMethod>  methodMap=new ObjectMapList<Long,JavaMethod>();
 	private ObjectMapList<Long,JavaObject>  objectMap=new ObjectMapList<Long,JavaObject>();
-	
-	
+
 	public JClass getClass(long id) {
 		if(id==0) return null;
 		JClass m=(JClass) classMap.get(id);
@@ -45,27 +46,25 @@
 		}
 		return m;
 	}
-	
-	
-	
+
 	public JavaObject getObjectAtAddress(long loc){
 		return objectMap.get(loc);
 	}
-	
-	
+
+
 	public JMethod getMethod(long methodid) {
 		if(methodid==0) return null;
 		JMethod m=(JMethod) methodMap.get(methodid);
 		if(m==null) {
 			m=new JMethod();
-		
+
 			methodMap.put(methodid,m);
 		}
 		return m;
-		
+
 	}
 	public JClassLoader getLoader(long classloaderid) {
-		
+
 		JClassLoader loader=(JClassLoader) loadersMap.get(classloaderid);
 		if(loader==null) {
 			loader=new JClassLoader();
@@ -73,23 +72,30 @@
 		}
 		return loader;
 	}
-	
-	
-public JObject getObject(long classid, long objectid) {
-		
+
+
+	public JObject getObject(long classid, long objectid) {
+
 		JObject o=(JObject) objectMap.get(objectid);
 		if(o==null) {
-			
+
 			JClass clazz = null;
-			
+
 			// TODO this is potentially wrong
 			if (classid !=0 ){
-			clazz=getClass(classid);}
-			o=new JObject(clazz,objectid);
+				clazz=getClass(classid);}
+			o=new JObject(clazz,objectid, this);
 			objectMap.put(objectid,o);
 		}
 		return o;
 	}
+	
+	public void putObject(long objectid, JObject obj) {
+		if ((objectid != 0L) && (obj != null)) {
+			objectMap.put(objectid, obj);
+		}
+	}
+	
 	public JMonitor getMonitor(long monitorid) {
 		if(monitorid==0) return null;
 		JMonitor m=(JMonitor) monitorsMap.get(monitorid);
@@ -99,15 +105,16 @@
 		}
 		return m;
 	}
-	public List getThreads() {
+	public List<JavaThread> getThreads() {
 		return threadMap.values();
 	}
-public List getJavaClassLoader() {
+	public List getJavaClassLoader() {
 		return loadersMap.values();
 	}
 	public List getJavaMonitors() {
 		return monitorsMap.values();
 	}
+	
 	public JThread getThread(long id) {
 		JThread t=(JThread) threadMap.get(id);
 		if(t!=null) return t;
@@ -115,5 +122,30 @@
 		threadMap.put(t.id, t);
 		return t;
 	}
+
+	/**
+	 * Returns a list containing all of the JavaObjects.
+	 * Makes sure that the list is unmodifiable.
+	 *  
+	 * @return an unmodifiable list of objects.
+	 */
+	public List<JavaObject> getObjects() {
+		return Collections.unmodifiableList(objectMap.values());		
+	}
+
+	private JHeap heap;
 	
+	/**
+	 * Returns the JavaHeap.
+	 * 
+	 * @return JHeap instance
+	 */
+	public JavaHeap getHeap() {
+		if (heap == null) {
+			heap = new JHeap(this);
+		}
+		
+		return heap;
+	}
+
 }

Modified: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java?rev=827610&r1=827609&r2=827610&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java
Tue Oct 20 14:50:17 2009
@@ -1,113 +1,100 @@
-/*******************************************************************************
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-
-package org.apache.kato.jvmti.javaruntime.model;
-
-import javax.tools.diagnostics.image.CorruptDataException;
-import javax.tools.diagnostics.image.DataUnavailable;
-import javax.tools.diagnostics.image.ImageAddressSpace;
-import javax.tools.diagnostics.image.ImagePointer;
-import javax.tools.diagnostics.image.MemoryAccessException;
-
-public final class SimpleImagePointer implements ImagePointer {
-	private long address=0;
-	public SimpleImagePointer(long id) {
-		this.address=id;
-	}
-
-	@Override
-	public ImagePointer add(long offset) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public long getAddress() {
-		
-		return address;
-	}
-
-	@Override
-	public ImageAddressSpace getAddressSpace() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public byte getByteAt(long index) throws MemoryAccessException,
-			CorruptDataException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public double getDoubleAt(long index)
-			throws MemoryAccessException, CorruptDataException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public float getFloatAt(long index)
-			throws MemoryAccessException, CorruptDataException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public int getIntAt(long index) throws MemoryAccessException,
-			CorruptDataException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public long getLongAt(long index) throws MemoryAccessException,
-			CorruptDataException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public ImagePointer getPointerAt(long index)
-			throws MemoryAccessException, CorruptDataException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public short getShortAt(long index)
-			throws MemoryAccessException, CorruptDataException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public boolean isExecutable() throws DataUnavailable {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public boolean isReadOnly() throws DataUnavailable {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public boolean isShared() throws DataUnavailable {
-		// TODO Auto-generated method stub
-		return false;
-	}
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+package org.apache.kato.jvmti.javaruntime.model;
+
+import javax.tools.diagnostics.image.CorruptDataException;
+import javax.tools.diagnostics.image.DataUnavailable;
+import javax.tools.diagnostics.image.ImageAddressSpace;
+import javax.tools.diagnostics.image.ImagePointer;
+import javax.tools.diagnostics.image.MemoryAccessException;
+
+public final class SimpleImagePointer implements ImagePointer {
+	private long address=0;
+	public SimpleImagePointer(long id) {
+		this.address=id;
+	}
+
+	@Override
+	public ImagePointer add(long offset) {
+		return new SimpleImagePointer(offset + address);
+	}
+
+	@Override
+	public long getAddress() {		
+		return address;
+	}
+
+	@Override
+	public ImageAddressSpace getAddressSpace() {
+		return null;
+	}
+
+	@Override
+	public byte getByteAt(long index) throws MemoryAccessException,
+			CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public double getDoubleAt(long index)
+			throws MemoryAccessException, CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public float getFloatAt(long index)
+			throws MemoryAccessException, CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public int getIntAt(long index) throws MemoryAccessException,
+			CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public long getLongAt(long index) throws MemoryAccessException,
+			CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public ImagePointer getPointerAt(long index)
+			throws MemoryAccessException, CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public short getShortAt(long index)
+			throws MemoryAccessException, CorruptDataException {
+		throw new MemoryAccessException(this, "No memory is available in this dump type.");
+	}
+
+	@Override
+	public boolean isExecutable() throws DataUnavailable {
+		throw new DataUnavailable("No memory is available in this dump type.");
+	}
+
+	@Override
+	public boolean isReadOnly() throws DataUnavailable {
+		throw new DataUnavailable("No memory is available in this dump type.");
+	}
+
+	@Override
+	public boolean isShared() throws DataUnavailable {
+		throw new DataUnavailable("No memory is available in this dump type.");
+	}
 }
\ No newline at end of file

Modified: incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/reader/CJVMTIBinReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/reader/CJVMTIBinReader.java?rev=827610&r1=827609&r2=827610&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/reader/CJVMTIBinReader.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/reader/CJVMTIBinReader.java
Tue Oct 20 14:50:17 2009
@@ -21,6 +21,7 @@
 import java.nio.ByteOrder;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.logging.ConsoleHandler;
 import java.util.logging.Level;
@@ -33,6 +34,7 @@
 import javax.tools.diagnostics.runtime.java.JavaThread;
 import javax.tools.diagnostics.runtime.java.JavaVariable;
 
+import org.apache.kato.jvmti.javaruntime.model.DeferredReference;
 import org.apache.kato.jvmti.javaruntime.model.JClass;
 import org.apache.kato.jvmti.javaruntime.model.JClassLoader;
 import org.apache.kato.jvmti.javaruntime.model.JField;
@@ -46,6 +48,8 @@
 import org.apache.kato.jvmti.javaruntime.model.JThread;
 import org.apache.kato.jvmti.javaruntime.model.Model;
 
+import com.sun.xml.internal.xsom.util.DeferedCollection;
+
 /**
  * 
  * CJVMTIBinReader - Reads cjvmti dump files 
@@ -169,7 +173,7 @@
 				e.printStackTrace();
 			}
 		}
-		
+
 		log.log(Level.INFO, "Finished test read");
 	}
 
@@ -179,10 +183,10 @@
 	 * @throws IOException
 	 */
 	public CJVMTIBinReader(File base) throws IOException {
-		boolean bigEndian = true;
-		
+		boolean bbigEndian = true;
+
 		//log.setLevel(Level.ALL);
-		ConsoleHandler handle = new ConsoleHandler();
+		//ConsoleHandler handle = new ConsoleHandler();
 		//handle.setLevel(Level.ALL);
 		//log.addHandler(handle);
 
@@ -192,7 +196,7 @@
 
 		RandomAccessFile raf2 = new RandomAccessFile(base, "r");
 		variablesIn = new FileImageInputStream(raf2);
-		
+
 		selfGeneratedIDs = variablesIn.length() + 1; // Ensure classes generated by the reader
do not collide with dump file class references
 		variablesIn.readLong();
 		if (variablesIn.readInt() == 1) {
@@ -207,7 +211,7 @@
 		// check Endian setting
 		if (variablesIn.readInt() != 1) {
 			System.err
-					.println("Incorrect format for reader/failed to set endian");
+			.println("Incorrect format for reader/failed to set endian");
 			throw new IOException();
 		}
 
@@ -233,33 +237,49 @@
 		JMonitor.model = model;
 		generateClassLoaderForReader();
 		generatePrimitiveArrayClasses();
-		
-		
-			byte recordGroup = 0;
 
-			try {
-				recordGroup = (byte) variablesIn.readUnsignedByte();
-				log.log(Level.FINEST, "RG: " + recordGroup);
-			} catch (EOFException ee) {
-				log.log(Level.FINEST, "Finished");
+
+		byte recordGroup = 0;
+
+		try {
+			recordGroup = (byte) variablesIn.readUnsignedByte();
+			log.log(Level.FINEST, "RG: " + recordGroup);
+		} catch (EOFException ee) {
+			log.log(Level.FINEST, "Finished");
+		}
+
+
+		switch (recordGroup) {
+		case CJVMTI_THREAD:
+			int numThreads = variablesIn.readInt();
+			long threadRefs[] = new long[numThreads];
+			for (int i = 0; i < numThreads; i++){
+				threadRefs[i] = variablesIn.readLong();
+			}
+			for (int i = 0; i < numThreads; i++) {
+				log.finest("Reading thread at "+Long.toHexString(threadRefs[i]));
+				nreadThread(threadRefs[i]);
+			}
+			break;
+		default:
+			error("record group " + recordGroup + " is not understood");
+		}
+
+		// Resolve field references until empty.
+		while (!unresolvedReferences.isEmpty()) {
+			if (log.isLoggable(Level.FINEST)) {
+				log.log(Level.FINEST, "# unresolved refs="+unresolvedReferences.size());
 			}
 			
+			// Remove first reference and process.
+			long pos = unresolvedReferences.remove(0);
 			
-			switch (recordGroup) {
-			case CJVMTI_THREAD:
-				int numThreads = variablesIn.readInt();
-				long threadRefs[] = new long[numThreads];
-				for (int i = 0; i < numThreads; i++){
-					threadRefs[i] = variablesIn.readLong();
-				}
-				for (int i = 0; i < numThreads; i++) {
-					log.finest("Reading thread at "+Long.toHexString(threadRefs[i]));
-					nreadThread(threadRefs[i]);
-				}
-				break;
-			default:
-				error("record group " + recordGroup + " is not understood");
+			JObject jobj = (JObject) model.getObjectAtAddress(pos);
+			
+			if (jobj == null) {
+				model.putObject(pos, nreadObject(pos));
 			}
+		}
 		
 		log.log(Level.INFO, "CJVMTI bin reader complete");
 	}
@@ -270,7 +290,7 @@
 	 * @throws IOException
 	 */
 	private JLocalVariableTableEntry nlocalVarTable()
-			throws IOException {
+	throws IOException {
 		// log.log(Level.FINEST,"Get local var table");
 		String name = readCString(variablesIn);
 		String sig = readCString(variablesIn);
@@ -303,8 +323,8 @@
 		String mGenSig = readCString(variablesIn);
 		int modifiers = variablesIn.readInt();
 		int count = variablesIn.readInt();
-		
-		
+
+
 		JMethod jm = model.getMethod(methodID);
 		jm.name = mName;
 		jm.signature = mSig;
@@ -313,12 +333,12 @@
 		}
 		jm.genericsignature = mGenSig;
 		jm.mods = modifiers;
-		
+
 		for (int i = 0; i < count; i++) {
 			JLocalVariableTableEntry jlte = nlocalVarTable();
 			jm.addLocalVariableTableEntry(jlte);
 		}
-		
+
 		// Line number table
 		int lntLength = variablesIn.readInt();
 		for (int i = 0; i < lntLength; i++) {
@@ -403,13 +423,13 @@
 	private JClass nreadClass() throws IOException {
 		long id = variablesIn.getStreamPosition();
 		id--; // Class id/ImagePointer
-		
+
 		JClass c = model.getClass(id);
-		
+
 		// Prevent reference loops (check if this class is partly filled in)
 		if (c.classSig != null)
 			return c;
-		
+
 		int modifiers = variablesIn.readInt();
 		c.modifiers = (short) modifiers;
 		log.log(Level.FINEST, "mods " + modifiers + " " + c.modifiers);
@@ -426,7 +446,7 @@
 		c.classSig = name;
 		c.classid = id;
 		c.sourceFile = sourceFile;
-		
+
 		if (variablesIn.readByte() == CJVMTI_METHOD) {
 			int num = variablesIn.readInt();
 			for (int i = 0; i < num; i++) {
@@ -482,7 +502,7 @@
 		} else {
 			throw new IOException();
 		}
-		
+
 		c.superClassID = supC;
 		if (supC != CJVMTI_NULL_OBJECT) {
 			c.superclass = nreadClass(supC);
@@ -518,7 +538,7 @@
 			try {
 				log.log(Level.FINEST, "Class loader : "
 						+ c.getClassLoader().getObject().getJavaClass()
-								.getName() + " for " + c.getName());
+						.getName() + " for " + c.getName());
 			} catch (CorruptDataException e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
@@ -539,13 +559,17 @@
 		if (position == CJVMTI_NULL_OBJECT) {
 			return null;
 		}
-		if (variablesIn.readByte() == CJVMTI_OBJECT) {
+		short id = variablesIn.readByte();
+		if (id == CJVMTI_OBJECT) {
 			return nreadObject();
 		} else {
-			throw new IOException();
+			throw new IOException("Record at 0x"+Long.toHexString(position)+" is not CJVMTI_OBJECT("
+					+CJVMTI_OBJECT+"), it is ("+id+")");
 		}
 	}
 
+	private List<Long> unresolvedReferences = new LinkedList<Long>();
+	
 	/**
 	 * Reads an object at the current file position
 	 * @return Populated java object
@@ -560,11 +584,11 @@
 		JClass c = nreadClass(classRef);
 		log.log(Level.FINEST, "Obj id " + Long.toHexString(objectID));
 		JObject obj = model.getObject(classRef, objectID);
-		
-		if (obj.visited)
+
+		if (obj.isVisited())
 			return obj; // Prevent reference loop
-		obj.visited = true;
-		
+		obj.setVisited(true);
+
 		// Calculate how many instance fields the reader can see on the class hierarchy
 		int instanceFieldCount = 0;
 		JClass superClass = c;
@@ -575,7 +599,7 @@
 			}
 			superClass = model.getClass(superClass.superClassID);
 		}
-		
+
 		// Check they match the dump files recoard
 		if (numInstanceFields != instanceFieldCount) {
 			log.log(Level.FINEST, "Non-matching " + numInstanceFields
@@ -592,8 +616,8 @@
 			countUp++;
 		}
 		offset = variablesIn.getStreamPosition();
-		
-		
+
+
 		// Follow the references grabbing the correct jfield for the hierarchy of classes
 		int fieldCount = 0;
 		int fieldOffset;
@@ -608,11 +632,25 @@
 					}
 					log.finest("Reading in "+fieldCount);
 
-					obj
-							.addValue(jf.getFieldID(),
-									nreadReference(instanceRefs[fieldOffset
-											+ jf.index]));
-
+					long position = instanceRefs[fieldOffset + jf.index];
+					
+					variablesIn.seek(position);									
+					byte type = variablesIn.readByte();
+					
+					if (type == CJVMTI_OBJECT) {
+						// Don't follow field references. Instead store a "deferred" reference						
+						// as the field value, 
+						JObject refObj = (JObject) model.getObjectAtAddress(position);
+						
+						if (refObj == null) {
+							unresolvedReferences.add(position);
+						}						
+						
+						obj.addValue(jf.getFieldID(), new DeferredReference(position));
+					} else {
+						obj.addValue(jf.getFieldID(),
+								nreadReference(position));
+					}
 				}
 			}
 			fieldOffset = fieldCount;
@@ -683,7 +721,7 @@
 					variablesIn.seek(currentReadPos);
 				}
 				obj = model
-						.getObject(arrayClass.getID().getAddress(), position);
+				.getObject(arrayClass.getID().getAddress(), position);
 				obj.objArray = objA;
 				obj.isArray = true;
 				return obj;
@@ -773,18 +811,18 @@
 			}
 			try {
 				System.out
-						.println("Unknown case "
-								+ type
-								+ " "
-								+ Long.toHexString((variablesIn
-										.getStreamPosition() - 1)));
+				.println("Unknown case "
+						+ type
+						+ " "
+						+ Long.toHexString((variablesIn
+								.getStreamPosition() - 1)));
 				throw new Exception();
 			} catch (Exception e) {
 				e.printStackTrace();
 				System.exit(0);
 			}
 		} catch (Exception e) {
-			
+
 			log.log(Level.FINEST, e.toString());
 			e.printStackTrace();
 			log.finest("Tried to read at "+Long.toHexString(position));
@@ -793,7 +831,7 @@
 		return null;
 	}
 
-	
+
 	/**
 	 * This is used to simulate the java boot class loader  
 	 */
@@ -900,83 +938,83 @@
 			log.finer("Error reading frame");
 			System.exit(0);
 		}
-		
-				
-				
-				long methodID = variablesIn.readLong();
-				String methodName = readCString(variablesIn);
-				log.log(Level.FINEST, "Method name is: " + methodName);
-				long declaringClass = variablesIn.readLong();
-				long cPos = variablesIn.getStreamPosition(); // Save where we are before reading in the
declaring class
-				JClass clazz = (JClass) nreadReference(declaringClass);
-				variablesIn.seek(cPos); // Return to our read position
-				
-				
-				byte depth = variablesIn.readByte();
-				if (depth == CJVMTI_LOCAL_NATIVECALL) {
-					log.log(Level.FINEST, "Native call");
-					JStackFrame jsf = new JStackFrame();
-					JLocation loc = new JLocation();
-					JMethod jm = model.getMethod(methodID);
-					loc.linenumber = -1;
-					loc.method = jm;
-					loc.setAddress(-1);
-					loc.filename = clazz.sourceFile;
-					if (loc.filename == null){
-						loc.filename = "nativeCall"; // ..
-					}
-					jsf.setLocation(loc);
-					t.addStackFrame(jsf);
-					return;
-				} else if (depth == CJVMTI_LOCAL_VARIABLE) {
-					log.log(Level.FINEST, "Local var");
-				} else if (depth == CJVMTI_JVMTI_ERROR) {
-					log.log(Level.FINEST, "Data unavailable");
-					return;
-				}
 
-				long location = variablesIn.readLong();
-				log.log(Level.FINEST, "Location is " + location);
-				
-				
-				JStackFrame jsf = new JStackFrame();
-				JLocation loc = new JLocation();
-				jsf.setLocation(loc);
-				loc.setAddress(location);
-				
-				if (clazz != null) {
-					loc.filename = clazz.sourceFile;
-				}
-				
-				loc.method = model.getMethod(methodID);
-				loc.linenumber = loc.method.getLineNumber(location);
-				log.log(Level.FINEST, " Line number " + loc.linenumber + " to "
-						+ location);
-				int varCount = variablesIn.readInt();
-				int slots[] = new int[varCount];
-				long lvarReference[] = new long[varCount];
-				log.log(Level.FINEST, "vars: " + varCount);
-				
-				// Read in all the variable references
-				for (int i2 = 0; i2 < varCount; i2++) {
-					slots[i2] = variablesIn.readInt();
-					lvarReference[i2] = variablesIn.readLong();
-				}
-				
-				// Follow all the variable references
-				for (int i2 = 0; i2 < varCount; i2++){
-					log.finest("Slot "+slots[i2]+" at "+Long.toHexString(lvarReference[i2]));
-					JLocalVariable jlv = new JLocalVariable();
-					jlv.slot = slots[i2];
-					long cpos = variablesIn.getStreamPosition();
-					jlv.value = nreadReference(lvarReference[i2]);
-					variablesIn.seek(cpos);
-					jsf.addVariable(jlv);
-				}
 
-				t.addStackFrame(jsf);
-			
-		
+
+		long methodID = variablesIn.readLong();
+		String methodName = readCString(variablesIn);
+		log.log(Level.FINEST, "Method name is: " + methodName);
+		long declaringClass = variablesIn.readLong();
+		long cPos = variablesIn.getStreamPosition(); // Save where we are before reading in the
declaring class
+		JClass clazz = (JClass) nreadReference(declaringClass);
+		variablesIn.seek(cPos); // Return to our read position
+
+
+		byte depth = variablesIn.readByte();
+		if (depth == CJVMTI_LOCAL_NATIVECALL) {
+			log.log(Level.FINEST, "Native call");
+			JStackFrame jsf = new JStackFrame();
+			JLocation loc = new JLocation();
+			JMethod jm = model.getMethod(methodID);
+			loc.linenumber = -1;
+			loc.method = jm;
+			loc.setAddress(-1);
+			loc.filename = clazz.sourceFile;
+			if (loc.filename == null){
+				loc.filename = "nativeCall"; // ..
+			}
+			jsf.setLocation(loc);
+			t.addStackFrame(jsf);
+			return;
+		} else if (depth == CJVMTI_LOCAL_VARIABLE) {
+			log.log(Level.FINEST, "Local var");
+		} else if (depth == CJVMTI_JVMTI_ERROR) {
+			log.log(Level.FINEST, "Data unavailable");
+			return;
+		}
+
+		long location = variablesIn.readLong();
+		log.log(Level.FINEST, "Location is " + location);
+
+
+		JStackFrame jsf = new JStackFrame();
+		JLocation loc = new JLocation();
+		jsf.setLocation(loc);
+		loc.setAddress(location);
+
+		if (clazz != null) {
+			loc.filename = clazz.sourceFile;
+		}
+
+		loc.method = model.getMethod(methodID);
+		loc.linenumber = loc.method.getLineNumber(location);
+		log.log(Level.FINEST, " Line number " + loc.linenumber + " to "
+				+ location);
+		int varCount = variablesIn.readInt();
+		int slots[] = new int[varCount];
+		long lvarReference[] = new long[varCount];
+		log.log(Level.FINEST, "vars: " + varCount);
+
+		// Read in all the variable references
+		for (int i2 = 0; i2 < varCount; i2++) {
+			slots[i2] = variablesIn.readInt();
+			lvarReference[i2] = variablesIn.readLong();
+		}
+
+		// Follow all the variable references
+		for (int i2 = 0; i2 < varCount; i2++){
+			log.finest("Slot "+slots[i2]+" at "+Long.toHexString(lvarReference[i2]));
+			JLocalVariable jlv = new JLocalVariable();
+			jlv.slot = slots[i2];
+			long cpos = variablesIn.getStreamPosition();
+			jlv.value = nreadReference(lvarReference[i2]);
+			variablesIn.seek(cpos);
+			jsf.addVariable(jlv);
+		}
+
+		t.addStackFrame(jsf);
+
+
 
 	}
 
@@ -1030,12 +1068,12 @@
 		}
 		String threadname = readCString(variablesIn);
 		log.finest("thread name "+threadname);
-		
+
 		long objectRef = variablesIn.readLong();
 		long cpos = variablesIn.getStreamPosition();
 		nreadReference(objectRef);
 		variablesIn.seek(cpos);
-		
+
 		JThread t = model.getThread(objectRef);
 		t.threadName = threadname;
 		log.log(Level.FINEST, t.threadName);
@@ -1045,7 +1083,7 @@
 		readMonitor(t);
 		readContendedMonitor(t);
 
-		
+
 		if (variablesIn.read()==CJVMTI_FRAME){
 			log.finest("Reading frames");
 		}else{
@@ -1061,7 +1099,7 @@
 			nreadFrames(frameRefs[i], t);
 		}
 	}
-	
+
 	/**
 	 * Conveniance method for printing stream position on error
 	 * @param msg



Mime
View raw message