incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r782115 - in /incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti: javaruntime/JavaRuntimeImpl.java process/ImageImpl.java reader/BinReader.java
Date Fri, 05 Jun 2009 19:40:46 GMT
Author: spoole
Date: Fri Jun  5 19:40:45 2009
New Revision: 782115

URL: http://svn.apache.org/viewvc?rev=782115&view=rev
Log:
updates to jvmti project to handle local vars

Modified:
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java?rev=782115&r1=782114&r2=782115&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
Fri Jun  5 19:40:45 2009
@@ -16,6 +16,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.LinkedList;
 import java.util.List;
 
 import org.apache.kato.image.CorruptDataException;
@@ -39,20 +40,17 @@
 	
 	@Override
 	public List getCompiledMethods() {
-		// TODO Auto-generated method stub
-		return null;
+		return new LinkedList();
 	}
 
 	@Override
 	public List getHeapRoots() {
-		// TODO Auto-generated method stub
-		return null;
+		return new LinkedList();
 	}
 
 	@Override
 	public List getHeaps() {
-		// TODO Auto-generated method stub
-		return null;
+		return new LinkedList();
 	}
 
 	@Override
@@ -101,14 +99,13 @@
 
 	@Override
 	public String getFullVersion() throws CorruptDataException {
-		// TODO Auto-generated method stub
-		return null;
+
+		return "PYJVMTI 1.6.0";
 	}
 
 	@Override
 	public String getVersion() throws CorruptDataException {
-		// TODO Auto-generated method stub
-		return null;
+		return "1.6.0";
 	}
 
 }

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java?rev=782115&r1=782114&r2=782115&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
Fri Jun  5 19:40:45 2009
@@ -42,7 +42,7 @@
 			public String getCommandLine()
 					throws DataUnavailable,
 					CorruptDataException {
-				throw new DataUnavailable("no env");
+				return "<none>";
 			}
 
 			@Override
@@ -57,7 +57,7 @@
 					throws DataUnavailable,
 					CorruptDataException {
 				
-				throw new DataUnavailable("no env");
+				return new Properties();
 			}
 
 			@Override
@@ -174,12 +174,12 @@
 
 	@Override
 	public long getCreationTime() throws DataUnavailable {
-		throw new DataUnavailable();
+		return 0;
 	}
 
 	@Override
 	public String getHostName() throws DataUnavailable, CorruptDataException {
-		throw new DataUnavailable();
+		return "host";
 	}
 
 	@Override
@@ -189,35 +189,35 @@
 
 	@Override
 	public long getInstalledMemory() throws DataUnavailable {
-		throw new DataUnavailable();
+		return 0;
 	}
 
 	@Override
 	public int getProcessorCount() throws DataUnavailable {
-		throw new DataUnavailable();
+		return 1;
 	}
 
 	@Override
 	public String getProcessorSubType() throws DataUnavailable,
 			CorruptDataException {
-		throw new DataUnavailable();
+		return "sub";
 	}
 
 	@Override
 	public String getProcessorType() throws DataUnavailable,
 			CorruptDataException {
-		throw new DataUnavailable();
+		return "proc";
 	}
 
 	@Override
 	public String getSystemSubType() throws DataUnavailable,
 			CorruptDataException {
-		throw new DataUnavailable();
+		return "syssub";	
 	}
 
 	@Override
 	public String getSystemType() throws DataUnavailable, CorruptDataException {
-		throw new DataUnavailable();
+		return "sys";
 	}
 
 }

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java?rev=782115&r1=782114&r2=782115&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java
Fri Jun  5 19:40:45 2009
@@ -55,6 +55,7 @@
 	private ObjectMapList<Integer,JavaClassLoader> loadersMap=new ObjectMapList<Integer,JavaClassLoader>();
 	private ObjectMapList<Integer,JavaMonitor> monitorsMap=new ObjectMapList<Integer,JavaMonitor>();
 	private ObjectMapList<Integer,JavaMethod>  methodMap=new ObjectMapList<Integer,JavaMethod>();
+	private ObjectMapList<Integer,JavaObject>  objectMap=new ObjectMapList<Integer,JavaObject>();
 	FileImageInputStream in=null;
 	
 	 
@@ -105,6 +106,10 @@
 			case 300 :   // thread groups
 				readThreadGroups();
 				break;
+			case 700 :   // objects
+				readObjects();
+				break;
+				
 			default  :  error("record group "+recordGroup+" is not understood");
 			}
 		}
@@ -122,6 +127,153 @@
 		
 		
 	}
+
+	private void readObjects() throws IOException {
+		// start of assuming at byte 2 of the record group
+		// for Objects thats just a count...
+		int count=in.readInt();
+		trace("reading "+count+" objects records");
+		
+		for(int i=0;i<count;i++) {
+			readObject();
+		}
+		
+	 	
+	}
+	private void readObject() throws IOException {
+		int id=in.readShort();
+		int fieldcount=in.readShort();
+		if(id!=701) error("unexpected object record id of "+id);
+		
+		int objID=in.readInt();
+		int clazzID=in.readInt();
+		JClass clazz=getClass(clazzID);
+		JObject obj=new JObject(clazz,objID);
+		
+		// read and add fields...
+		if(fieldcount>0) {
+			for(int i=0;i<fieldcount;i++) {
+				readFieldValue(obj);
+			}
+		}
+		
+	}
+	private void readFieldValue(JObject obj) throws IOException {
+		
+		int id=in.readShort();
+		int fieldid=in.readShort();
+		if(id!=702) error("unexpected field value record id of "+id);
+		String signature=readName();
+		
+		if( signature.equals("Z"))  {
+				int value=in.readInt();
+				obj.addValue(fieldid,signature,value);
+		}
+		else if( signature.equals("C"))  {
+			char value=in.readChar();
+			obj.addValue(fieldid,signature,value);
+	    }
+		else if( signature.equals("I"))  {
+			int value=in.readInt();
+			obj.addValue(fieldid,signature,value);
+	    }
+		else if( signature.equals("B"))  {
+			int value=in.readInt();
+		
+			obj.addValue(fieldid,signature,value);
+	    }
+		else if( signature.equals("S"))  {
+			int value=in.readInt();
+			obj.addValue(fieldid,signature,value);
+	    }
+		else if( signature.equals("J"))  {
+			long value=in.readLong();
+			obj.addValue(fieldid,signature,value);
+	    }
+		else if( signature.equals("[C"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			char[] data=new char[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readChar();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+		else if( signature.equals("[I"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			int[] data=new int[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readInt();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+		else if( signature.equals("[B"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			short[] data=new short[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readShort();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+		else if( signature.equals("[S"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			short[] data=new short[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readShort();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+               
+		else if( signature.equals("[J"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			long[] data=new long[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readLong();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+                
+		else if( signature.equals("[F"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			float[] data=new float[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readFloat();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+            
+		else if( signature.equals("[D"))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			double[] data=new double[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readDouble();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+                      
+		else if( signature.startsWith("["))  {
+			int length=in.readInt();
+			int objid=in.readInt();
+			long[] data=new long[length];
+			for(int i=0;i<length;i++) {
+				data[i]=in.readInt();
+			}
+			obj.addValue(fieldid,signature,data);
+	    }
+                      
+		else {
+			int clazzid=in.readInt();
+			
+		}	
+            
+		
+	}
 	private void readThreadGroup() throws IOException {
 		int id=in.readShort();
 		if(id!=301) error("unexpected threadgroup record id of "+id);
@@ -182,7 +334,7 @@
 			readMethods(c);
 		}
 		
-		trace("read class - name ="+c.classSig);
+		//trace("read class - name ="+c.classSig);
 		classMap.put(c.classid, c);
 	}
 	
@@ -366,7 +518,7 @@
 		int id=in.readShort();
 		if(id!=103) error("unexpected stack frame record id of "+id);
 		int count=in.readInt();
-		trace("reading "+count+" stack trace");
+		//trace("reading "+count+" stack trace");
 		for(int i=0;i<count;i++) {
 			readStackTraceEntry(t);
 		}
@@ -377,15 +529,20 @@
 		
 		int methodid=in.readInt();
 		int location=in.readInt();
+		int javathis=in.readInt();
 		int vars=in.readInt();
 		
 		JLocation loc=new JLocation();
 		loc.method=getMethod(methodid);
+		loc.linenumber=location;
 		
 		JStackFrame frame=new JStackFrame();
 		frame.location=loc;
 		t.addStackFrame(frame);
 		
+		if(javathis!=0) {
+			frame.addVariable(0, javathis);
+		}
 		if(vars>0) {
 			readLocalVariables(frame,vars);
 		}
@@ -403,9 +560,12 @@
 		if(id!=501) error("unexpected localvariable record id of "+id);
 		
 		int slot=in.readInt();
+		if(slot<1) {
+			trace("found slot for "+slot);
+		}
 		String sig=readName();
 		
-		trace("read "+slot+","+sig);
+	//	trace("read "+slot+","+sig);
 		if(sig.charAt(0)=='!') {
 			// data not available
 			frame.addVariable(slot,sig);
@@ -444,7 +604,7 @@
 		}  
 		if(sig.equals("[C")) { // char array
 			int length=in.readInt();
-			
+			int objectid=in.readInt();
 			char[] data=new char[length];
 			for(int i=0;i<data.length;i++) {
 				data[i]=(char) in.readByte();
@@ -458,6 +618,7 @@
 			
 		if(sig.equals("[I")) { // int array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			int[] data=new int[length];
 			for(int i=0;i<data.length;i++) {
 				data[i]=in.readInt();
@@ -468,6 +629,7 @@
           
 		if(sig.equals("[B")) { // byte array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			byte[] data=new byte[length];
 			for(int b=0;b<data.length;b++) {
 				data[b]=(byte) in.readShort();
@@ -479,6 +641,7 @@
            
 		if(sig.equals("[S")) { // short array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			short[] data=new short[length];
 			for(int i=0;i<data.length;i++) {
 				data[i]=in.readShort();
@@ -489,6 +652,7 @@
            
 		if(sig.equals("[J")) { // long array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			long[] data=new long[length];
 			for(int i=0;i<data.length;i++) {
 				data[i]=in.readLong();
@@ -499,6 +663,7 @@
 		
 		if(sig.equals("[F")) { // float array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			float[] data=new float[length];
 			for(int i=0;i<data.length;i++) {
 				data[i]=in.readFloat();
@@ -508,6 +673,7 @@
 		} 
 		if(sig.equals("[D")) { // double array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			double[] data=new double[length];
 			for(int i=0;i<data.length;i++) {
 				data[i]=in.readDouble();
@@ -517,6 +683,7 @@
 		}
 		if(sig.equals("[")) { // obj array
 			int length=in.readInt();
+			int objectid=in.readInt();
 			frame.addVariable(slot, length);
 			return;
 		} 
@@ -524,10 +691,22 @@
 		// finally - an object...
 		
         int objectid=in.readInt();
-    	frame.addVariable(slot, objectid);
+        int classid=in.readInt();
+        JObject obj=getObject(classid,objectid);
+    	frame.addVariable(slot, obj);
          
 		
 	}
+	private JObject getObject(int classid, int objectid) {
+		
+		JObject o=(JObject) objectMap.get(objectid);
+		if(o==null) {
+			JClass clazz=getClass(classid);
+			o=new JObject(clazz,objectid);
+			objectMap.put(objectid,o);
+		}
+		return o;
+	}
 	private void trace(String msg, byte[] data) {
 		System.out.print(msg+" : ");
 		for(int i=0;i<data.length;i++) {
@@ -862,8 +1041,7 @@
 
 		@Override
 		public List getCachedClasses() {
-			// TODO Auto-generated method stub
-			return null;
+			return new LinkedList();
 		}
 
 		@Override
@@ -892,6 +1070,7 @@
 			String classSig=null;
 			private List<JClass> interfaces=null;
 			private List<JMethod> methods=null;
+			private List<JField> fields=null;
 			@Override
 			public JavaClassLoader getClassLoader() throws CorruptDataException {
 				
@@ -908,6 +1087,7 @@
 				if(methods==null) {
 					methods=new LinkedList<JMethod>();
 				}
+				m.setParent(this);
 				methods.add(m);
 				
 			}
@@ -918,28 +1098,30 @@
 			}
 			@Override
 			public List getConstantPoolReferences() {
-				// TODO Auto-generated method stub
-				return null;
+				return new LinkedList();
+				
 			}
 			@Override
 			public List getDeclaredFields() {
-				// TODO Auto-generated method stub
-				return null;
+				
+				if(fields==null) fields=new LinkedList<JField>();
+				System.out.println("asking for fields "+fields);
+				return fields;
 			}
 			@Override
 			public List getDeclaredMethods() {
-				// TODO Auto-generated method stub
-				return null;
+				if(methods==null) methods=new LinkedList<JMethod>();
+				return methods;
 			}
 			@Override
 			public ImagePointer getID() {
 				// TODO Auto-generated method stub
-				return null;
+				return new SimpleImagePointer(classid); 
 			}
 			@Override
 			public List getInterfaces() {
 				
-				return null;
+				return new LinkedList();
 			}
 			@Override
 			public int getModifiers() throws CorruptDataException {
@@ -958,8 +1140,7 @@
 			}
 			@Override
 			public List getReferences() {
-				// TODO Auto-generated method stub
-				return null;
+				return new LinkedList();
 			}
 			@Override
 			public JavaClass getSuperclass() throws CorruptDataException {
@@ -967,8 +1148,15 @@
 			}
 			@Override
 			public boolean isArray() throws CorruptDataException {
-				// TODO Auto-generated method stub
-				return false;
+				
+				return classSig.startsWith("[");
+			}
+			public void addField(JField field) {
+				if(fields==null) {
+					fields=new LinkedList<JField>();
+				}
+				fields.add(field);
+				
 			}
 		
 	}
@@ -984,77 +1172,79 @@
 
 		public JField(JClass classid,int fid) {
 			this.clazzid=classid;
-			id=fid;
+	 		id=fid;
+			classid.addField(this);
 		}
 
 		@Override
 		public Object get(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return null;
+			JObject job=(JObject) arg0;
+			return job.getValue(id);
+			
 		}
 
 		@Override
 		public boolean getBoolean(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return false;
+			JObject job=(JObject) arg0;
+			return job.getBooleanValue(id);
 		}
 
 		@Override
 		public byte getByte(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getByteValue(id);
 		}
 
 		@Override
 		public char getChar(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getCharValue(id);
 		}
 
 		@Override
 		public double getDouble(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getDoubleValue(id);
 		}
 
 		@Override
 		public float getFloat(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getFloatValue(id);
 		}
 
 		@Override
 		public int getInt(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getIntValue(id);
 		}
 
 		@Override
 		public long getLong(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getLongValue(id);
 		}
 
 		@Override
 		public short getShort(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return 0;
+			JObject job=(JObject) arg0;
+			return job.getShortValue(id);
 		}
 
 		@Override
 		public String getString(JavaObject arg0) throws CorruptDataException,
 				MemoryAccessException {
-			// TODO Auto-generated method stub
-			return null;
+			JObject job=(JObject) arg0;
+			return job.getStringValue(id);
 		}
 
 		@Override
@@ -1090,14 +1280,13 @@
 		private ObjectMapList<Integer,Object> vars=new ObjectMapList<Integer, Object>();
 		@Override
 		public ImagePointer getBasePointer() throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return null;
+			
+			return new SimpleImagePointer(0);
 		}
 
 		@Override
 		public List getHeapRoots() {
-			// TODO Auto-generated method stub
-			return null;
+			return new LinkedList();
 		}
 
 		@Override
@@ -1109,9 +1298,9 @@
 		@Override
 		public Object getVariable(int slot) throws CorruptDataException,
 				DataUnavailable, IndexOutOfBoundsException {
-			if(vars.get(slot)==null) throw new DataUnavailable("slot "+slot+" is not available");
-			
-			return vars.get(slot);
+			Object r=vars.get(slot);
+			System.out.println("asked for variable at slot "+slot+" ("+r+")");
+			return r;
 			
 		}
 		
@@ -1128,9 +1317,14 @@
 	
 	class JLocation implements JavaLocation {
 
+		
 		private JMethod method=null;
 		String filename=null;
+		int linenumber=0;
 		
+		public JLocation() {
+			
+		}
 		@Override
 		public ImagePointer getAddress() throws CorruptDataException {
 			// TODO Auto-generated method stub
@@ -1152,8 +1346,8 @@
 
 		@Override
 		public int getLineNumber() throws DataUnavailable, CorruptDataException {
-			// TODO Auto-generated method stub
-			return 0;
+			
+			return linenumber;
 		}
 
 		@Override
@@ -1180,6 +1374,11 @@
 			
 		}
 		
+		public void setParent(JClass class1) {
+			parent=class1;
+			
+		}
+
 		private void addLocalVariableTableEntry(JLocalVariableTableEntry entry) {
 			if(localVars==null) {
 				localVars=new LinkedList<JLocalVariableTableEntry>();
@@ -1191,12 +1390,12 @@
 		@Override
 		public List getBytecodeSections() {
 		
-			return null;
+			return new LinkedList();
 		}
 
 		@Override
 		public List getCompiledSections() {
-			return null;
+			return new LinkedList();
 		}
 
 		@Override
@@ -1224,6 +1423,9 @@
 
 		@Override
 		public List getVariables() throws DataUnavailable {
+			if(localVars==null) {
+				localVars=new LinkedList<JLocalVariableTableEntry>();
+			}
 			return localVars;
 		}
 		
@@ -1260,6 +1462,153 @@
 		
 	}
 
+	class JObject implements JavaObject {
+
+		private int objid=0;
+		private long size=0;
+		private Map<Integer,Object> data=new HashMap<Integer, Object>();
+		private JClass clazz=null;
+		public JObject(JClass clazz, int objID) {
+			this.clazz=clazz;
+			this.objid=objID;
+		}
+
+		public void addValue(int fieldid, String signature, Object data) {
+			this.data.put(fieldid,data);
+			
+		}
+
+		public double getDoubleValue(int id) {
+			Double d=(Double) data.get(id);
+			return d;
+		}
+
+		public long getLongValue(int id) {
+			Long d=(Long) data.get(id);
+			return d;
+		}
+
+		public char getCharValue(int id) {
+			Character d=(Character) data.get(id);
+			return d;
+			
+		}
+
+		public boolean getBooleanValue(int id) {
+			Boolean d=(Boolean) data.get(id);
+			return d;
+		}
+
+		public byte getByteValue(int id) {
+			Byte d=(Byte) data.get(id);
+			return d;
+		}
+
+		public float getFloatValue(int id) {
+			Float d=(Float) data.get(id);
+			return d;
+		}
+
+		public int getIntValue(int id) {
+			Integer d=(Integer) data.get(id);
+			return d;		}
+
+		public short getShortValue(int id) {
+			Short d=(Short) data.get(id);
+			return d;
+		}
+
+		public String getStringValue(int id) {
+			String d=(String) data.get(id);
+			return d;
+			
+		}
+
+		public Object getValue(int id) {
+		
+			return data.get(id);
+		}
+
+		@Override
+		public void arraycopy(int srcStart, Object dst, int dstStart, int length)
+				throws CorruptDataException, MemoryAccessException {
+			// TODO Auto-generated method stub
+			
+		}
+
+		@Override
+		public int getArraySize() throws CorruptDataException {
+			
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public long getHashcode() throws DataUnavailable, CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public JavaHeap getHeap() throws CorruptDataException, DataUnavailable {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public ImagePointer getID() {
+			return new SimpleImagePointer(objid);
+		}
+
+		@Override
+		public JavaClass getJavaClass() throws CorruptDataException {
+			
+			System.out.println("asking for class "+clazz);
+			return clazz;
+		}
+
+		@Override
+		public long getPersistentHashcode() throws DataUnavailable,
+				CorruptDataException {
+			// TODO Auto-generated method stub
+			return 0;
+		}
+
+		@Override
+		public List getReferences() {
+			return new LinkedList();
+		}
+
+		@Override
+		public List getSections() {
+			
+			return new LinkedList();
+		}
+
+		@Override
+		public long getSize() throws CorruptDataException {
+			
+			return size;
+		}
+
+		@Override
+		public boolean isArray() throws CorruptDataException {
+			
+			return clazz.isArray();
+		}
+		
+		public String toString() {
+			if(clazz==null) {
+				return "<unknown>@"+objid;
+			}
+			try {
+				return clazz.getName()+"@"+objid;
+			} catch (CorruptDataException e) {
+				
+				return super.toString();
+			}
+		}
+	}
 	class VariableValue {
 		String signature=null;
 	}



Mime
View raw message