incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r782114 - in /incubator/kato/branches/experimental/PyJVMTI: init.py kato/BinDump.py kato/JField.py kato/PauseJVM.java kato/console.py pyjvmti.c pyjvmti.h
Date Fri, 05 Jun 2009 19:40:05 GMT
Author: spoole
Date: Fri Jun  5 19:40:05 2009
New Revision: 782114

URL: http://svn.apache.org/viewvc?rev=782114&view=rev
Log:
updated jvmti dump to include local vars

Modified:
    incubator/kato/branches/experimental/PyJVMTI/init.py
    incubator/kato/branches/experimental/PyJVMTI/kato/BinDump.py
    incubator/kato/branches/experimental/PyJVMTI/kato/JField.py
    incubator/kato/branches/experimental/PyJVMTI/kato/PauseJVM.java
    incubator/kato/branches/experimental/PyJVMTI/kato/console.py
    incubator/kato/branches/experimental/PyJVMTI/pyjvmti.c
    incubator/kato/branches/experimental/PyJVMTI/pyjvmti.h

Modified: incubator/kato/branches/experimental/PyJVMTI/init.py
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/init.py?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/init.py (original)
+++ incubator/kato/branches/experimental/PyJVMTI/init.py Fri Jun  5 19:40:05 2009
@@ -17,6 +17,8 @@
 #
 #
 import jvmti
+import time
+
 import kato.console as console
 from kato.JMethod import JMethod
 from kato.JClass import JClass
@@ -35,6 +37,7 @@
         if clazz.signature=="Ljava/lang/ArrayIndexOutOfBoundsException;" :
             print("OOB"*20) 
             console.save()
+            #time.sleep(30)
     return
         
     if method != 0 :

Modified: incubator/kato/branches/experimental/PyJVMTI/kato/BinDump.py
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/kato/BinDump.py?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/kato/BinDump.py (original)
+++ incubator/kato/branches/experimental/PyJVMTI/kato/BinDump.py Fri Jun  5 19:40:05 2009
@@ -13,6 +13,7 @@
  #******************************************************************************"
 import kato.Dump as Dump
 import kato.JField as JField
+import kato.JClass as JClass
 import kato.JThreadGroup as JThreadGroup
 import kato.JMethod as JMethod
 import jvmti
@@ -26,6 +27,7 @@
     tracedepth=1
     missingobjects=0
     variables_saved=0
+    objectlist=set()
     
     def open(self): 
         self.traceEntry("open")
@@ -42,6 +44,7 @@
         do clean up processing 
         '''
         self.output.close()
+        
         self.traceExit("close (vars=%d missing objects = %d)" % (self.variables_saved,self.missingobjects))
   
     def startThreadSave(self,count):
@@ -102,7 +105,13 @@
        
          
         self.traceExit("save thread %s" % thread.name); 
+     
+    def endThreadSave(self):
+        self.trace("Saving %d objects" % len(self.objectlist))
+       # self.saveObjects()
        
+            
+             
     def saveMonitors(self,count,list):
         
         self.traceEntry("saving %d monitors" % count)
@@ -137,8 +146,11 @@
             localvars=method.localVariableTable
             count=len(localvars)
             
-             
-            header=struct.pack("!iii",methodid,locationid,count)
+            
+            javathis=self.getThis(thread.threadid,depth)
+            self.objectlist.add(javathis)
+            
+            header=struct.pack("!iiii",methodid,locationid,javathis,count)
             self.output.write(header)
             
             if count > 0 :
@@ -149,6 +161,16 @@
         
         self.traceExit("saved stack traces")  
     
+    
+    def getThis(self,threadid,depth):
+        
+        self.trace("getting this from thread=%d at %d" % ( threadid , depth ))
+        try : 
+            return jvmti.getLocalObject(threadid,depth,0)
+        except jvmti.error :
+            return 0
+        
+        
     def getVariables(self,threadid,method,depth): 
         '''
         Returns a list of local variable values for the provided method  
@@ -246,7 +268,7 @@
         Saves all the local variables of slot...
           
         '''
-        self.traceEntry("saving variables")
+       # self.traceEntry("saving variables")
         
         for entry in localvars  :
         
@@ -256,6 +278,7 @@
           self.variables_saved+=1
           self.trace("saving %s variable at %d " % (signature,entry.slot))
 
+          
           try :
             
             
@@ -303,7 +326,7 @@
                  chararray=jvmti.getCharArrayElements(objvalue)
                  arraylen=len(chararray)
                  
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.writeName(signature)
                  self.output.write(header)
                  
@@ -317,7 +340,7 @@
                  objvalue=jvmti.getLocalObject(threadid,depth,entry.slot)
                  intarray=jvmti.getIntArrayElements(objvalue)
                  arraylen=len(intarray)
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.writeName(signature)
                  self.output.write(header)
                  
@@ -331,7 +354,7 @@
                  array=jvmti.getByteArrayElements(objvalue)
                  arraylen=len(array)
                  self.writeName(signature)
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.output.write(header)
                  for element in array :
                      header=struct.pack("!h",element)
@@ -342,7 +365,7 @@
                  objvalue=jvmti.getLocalObject(threadid,depth,entry.slot)
                  array=jvmti.getShortArrayElements(objvalue)
                  arraylen=len(array)
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.writeName(signature)
                  self.output.write(header)
                  for element in array :
@@ -354,7 +377,7 @@
                  objvalue=jvmti.getLocalObject(threadid,depth,entry.slot)
                  array=jvmti.getLongArrayElements(objvalue)
                  arraylen=len(array)
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.writeName(signature)
                  self.output.write(header)
                  for element in array :
@@ -367,7 +390,7 @@
                  objvalue=jvmti.getLocalObject(threadid,depth,entry.slot)
                  array=jvmti.getFloatArrayElements(objvalue)
                  arraylen=len(array)
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.writeName(signature)
                  self.output.write(header)
                  for element in array :
@@ -379,7 +402,7 @@
                  objvalue=jvmti.getLocalObject(threadid,depth,entry.slot)
                  array=jvmti.getDoubleArrayElements(objvalue)
                  arraylen=len(array)
-                 header=struct.pack("!i",arraylen)
+                 header=struct.pack("!ii",arraylen,objvalue)
                  self.writeName(signature)
                  self.output.write(header)
                  for element in array :
@@ -396,7 +419,7 @@
                     arrayLength=jvmti.getArrayLength(objvalue)
                     
                 self.trace("Array length %d" % arrayLength)
-                header=struct.pack("!i",arrayLength)
+                header=struct.pack("!ii",arrayLength,objvalue)
                 self.writeName(signature)
                 self.output.write(header)
                 
@@ -405,15 +428,29 @@
                 
             else :
                 objvalue=jvmti.getLocalObject(threadid,depth,entry.slot)
-                header=struct.pack("!i",objvalue)
+                print "local object=%d" % objvalue
+                clazzid=0
+                if objvalue!=0 :
+                    clazzid=jvmti.getObjectClass(objvalue)
+                    print "class object=%d" % clazzid
+                    self.objectlist.add(objvalue)
+                    
+                header=struct.pack("!ii",objvalue,clazzid)
                 self.writeName(signature)
                 self.output.write(header)
                 
+                    #
+                    # remember object
+                    #
+                
+                
+                
+    
           except jvmti.error :
                 self.writeName("!"+signature)
                 #self.output.write(header)
                 
-                print "err..." , jvmti.error
+                print "err..." , jvmti.error , signature
           
           self.traceExit("saving variables")  
         
@@ -436,13 +473,13 @@
         self.writeName(field.genericsignature)
         
         
-        self.trace("save field name=%s signature=%s" % (field.name,field.genericsignature))
+      #  self.trace("save field name=%s signature=%s" % (field.name,field.genericsignature))
         
     def saveClass(self,clazz):
         '''
         Save a single JClass
         '''
-        self.traceEntry("save class %s" % clazz.signature)
+       # self.traceEntry("save class %s" % clazz.signature)
         
         interfaceCount=len(clazz.interfaces)
         methodCount=len(clazz.methods)
@@ -479,18 +516,18 @@
             
             self.saveMethods(clazz)
             
-        self.traceExit("saved class")
+       # self.traceExit("saved class")
         
     def saveMethods(self,clazz):
         
-        self.traceEntry("save methods")
+        #self.traceEntry("save methods")
             
         for methodid in clazz.methods :
            m=JMethod.JMethod(methodid)
            vartable=m.localVariableTable
            tablesize=len(vartable)
            
-           self.trace("save method %s %s" % (clazz.signature, m.name));
+          # self.trace("save method %s %s" % (clazz.signature, m.name));
            
            header=struct.pack("!hiiiiii",204,methodid,m.modifiers,m.maxlocals,m.argumentsize,m.isnative,tablesize)
            self.output.write(header)
@@ -506,7 +543,7 @@
                    self. writeName(entry.signature) #sig
                    self. writeName(entry.genericsignature) # generi sig
         
-        self.traceExit("saved methods")
+        #self.traceExit("saved methods")
             
     def writeName(self,name):
         length=0
@@ -528,4 +565,177 @@
     def trace(self,msg):
         if self.reporttrace :
              print "%d %s %s" % (self.tracedepth,'.'*self.tracedepth , msg)       
-         
\ No newline at end of file
+         
+    def saveObjects(self):
+        '''
+        Save all remembered objects
+        '''
+        self.objectlist.remove(0)
+        
+        objectcount=len(self.objectlist)
+        if objectcount==0 :  return  # nothing to do
+        
+        header=struct.pack("!hi",700,objectcount)
+        self.output.write(header)
+        
+        for objectid in self.objectlist :
+            self.saveObject(objectid)
+    
+    def saveObject(self,objid):
+        
+         print "saving object %d " % objid 
+        #if(objid get object class
+         clazzid=jvmti.getObjectClass(objid)
+         print "clazz = %d " % clazzid
+         
+         clazz=JClass.JClass(clazzid)
+         
+         fields=clazz.fields
+         fieldlength=len(fields)
+         
+         header=struct.pack("!hiii",701,objid,clazzid,fieldlength)
+         self.output.write(header)
+         
+         # write object fields
+         if fieldlength>0 :
+             for field in fields :
+                 self.saveFieldValue(objid,field,clazz)
+          
+    def saveFieldValue(self,objid,fieldid,clazzid):
+        
+          field=JField.JField(clazzid,fieldid)
+          value=0
+          if field.isStatic == False :
+              value=field.value(objid)
+          
+          header=struct.pack("!hi",702,fieldid)
+          self.output.write(header)
+          
+          signature=field.signature
+          
+          self.writeName(signature)
+          
+        
+          
+          if signature=='Z' :
+                header=struct.pack("!h",value)
+                self.output.write(header)
+          elif signature=='C' :
+                header=struct.pack("!c",value)
+                self.output.write(header)
+          elif signature=='I' :
+                header=struct.pack("!i",value)
+                self.output.write(header)
+          elif signature=='B' :
+                header=struct.pack("!h",value)
+                self.output.write(header)
+          elif signature=='S' :
+                header=struct.pack("!h",value)
+                self.output.write(header)
+          elif signature=='J' :
+                header=struct.pack("!q",value)
+                self.output.write(header)
+          elif signature=='[C' :
+                 arraylen=0
+                 if value != 0 :
+                     chararray=jvmti.getCharArrayElements(value)
+                     arraylen=len(chararray)
+                     
+                 header=struct.pack("!ii",arraylen,value)
+                 self.output.write(header)
+                 for element in chararray :
+                     header=struct.pack("!c",element)
+                     self.output.write(header)
+         
+          elif signature=='[I' :
+                 arraylen=0
+                 if value != 0 :
+                     intarray=jvmti.getIntArrayElements(value)
+                     arraylen=len(intarray)
+                 header=struct.pack("!ii",arraylen,value)
+                 self.output.write(header)
+                 
+                 for element in intarray :
+                     header=struct.pack("!i",element)
+                     self.output.write(header)
+                 
+            
+          elif signature=='[B' :
+                 arraylen=0
+                 if value != 0 :
+                     array=jvmti.getByteArrayElements(value)
+                     arraylen=len(array)
+                     
+                 header=struct.pack("!ii",arraylen,value)
+                 self.output.write(header)
+                 if arraylen > 0 :
+                     for element in array :
+                         header=struct.pack("!h",element)
+                         self.output.write(header)
+                 
+                
+          elif signature=='[S' :
+                 arraylen=0
+                 if value != 0 :
+                     array=jvmti.getShortArrayElements(value)
+                     arraylen=len(array)
+                 header=struct.pack("!ii",arraylen,value)
+                 self.output.write(header)
+                 for element in array :
+                     header=struct.pack("!h",element)
+                     self.output.write(header)
+                 
+                 
+          elif signature=='[J' :
+                 arraylen=0
+                 if value != 0 :
+                     array=jvmti.getLongArrayElements(value)
+                     arraylen=len(array)
+                 header=struct.pack("!ii",arraylen,value)
+                 self.output.write(header)
+                 for element in array :
+                     header=struct.pack("!q",element)
+                     self.output.write(header)
+                 
+         
+            
+          elif signature=='[F' :
+                 arraylen=0
+                 if value != 0 :
+                     array=jvmti.getFloatArrayElements(value)
+                     arraylen=len(array)
+                 header=struct.pack("!ii",arraylen,value)
+                 self.output.write(header)
+                 for element in array :
+                     header=struct.pack("!f",element)
+                     self.output.write(header)
+                 
+            
+          elif signature=='[D' :
+                 arraylen=0
+                 if value != 0 :
+                     array=jvmti.getDoubleArrayElements(value)
+                     arraylen=len(array)
+                 header=struct.pack("!ii",arraylen,value)
+                 self.writeName(signature)
+                 self.output.write(header)
+                 for element in array :
+                     header=struct.pack("!d",element)
+                     self.output.write(header)
+                  
+                 
+          elif signature[0]=='[' :
+                arrayLength=0
+                if value != 0 :
+                    arrayLength=jvmti.getArrayLength(value)
+                header=struct.pack("!ii",arrayLength,value)
+                self.output.write(header)
+                
+          else :
+                clazzid=0
+                if value!=0 :
+                    clazzid=jvmti.getObjectClass(value)
+                header=struct.pack("!ii",value,clazzid)
+                self.output.write(header)
+                
+                
\ No newline at end of file

Modified: incubator/kato/branches/experimental/PyJVMTI/kato/JField.py
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/kato/JField.py?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/kato/JField.py (original)
+++ incubator/kato/branches/experimental/PyJVMTI/kato/JField.py Fri Jun  5 19:40:05 2009
@@ -21,6 +21,7 @@
     clazz=None
     fieldid=None
     info=None
+    fieldModifiers=None
     
     def __init__(self,cid,fid):
         '''
@@ -48,4 +49,40 @@
     def genericsignature(self):
         self.fill()
         return self.info[2]
+    
+    @property
+    def isStatic(self): 
+        if self.fieldModifiers==None :
+            self.fieldModifiers=jvmti.getFieldModifiers(self.clazz.classid,self.fieldid)
+        return self.fieldModifiers & 0x0008 == 0x0008
+     
+    def value(self,objid):
+            
+            
+            print "in field getting value for %d sig=%s from field %d" % (objid,self.signature,self.fieldid)
+            
+            if self.signature=='Z' :
+                return jvmti.getBooleanField(self.fieldid,objid)
+            
+            elif self.signature=='C' :
+                return jvmti.getCharField(self.fieldid,objid)
+            elif self.signature=='I' :
+                return jvmti.getIntField(self.fieldid,objid)
+            elif self.signature=='B' :
+                return jvmti.getByteField(self.fieldid,objid)
+            elif self.signature=='S' :
+                return jvmti.getShortField(self.fieldid,objid)
+            elif self.signature=='J' :
+                return jvmti.getLongField(self.fieldid,objid)
+            elif self.signature=='F' :
+                return jvmti.getFloatField(self.fieldid,objid)
+            elif self.signature=='D' :
+                return jvmti.getDoubleField(self.fieldid,objid)
+            
+            else :
+                try :
+                    return jvmti.getObjectField(self.fieldid,objid)
+                except jvmti.error :
+                    return 0
+        
         
\ No newline at end of file

Modified: incubator/kato/branches/experimental/PyJVMTI/kato/PauseJVM.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/kato/PauseJVM.java?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/kato/PauseJVM.java (original)
+++ incubator/kato/branches/experimental/PyJVMTI/kato/PauseJVM.java Fri Jun  5 19:40:05 2009
@@ -20,7 +20,8 @@
 public class PauseJVM {
 
 	private static int classint=100;
-	
+	public int wibble=100;
+	public String data="hello world";
 	public static final int constantint=200;
 	/**
 	 * @param args

Modified: incubator/kato/branches/experimental/PyJVMTI/kato/console.py
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/kato/console.py?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/kato/console.py (original)
+++ incubator/kato/branches/experimental/PyJVMTI/kato/console.py Fri Jun  5 19:40:05 2009
@@ -55,7 +55,7 @@
     
         return jvmti.getLocalObject(thread,depth,slot)
     
-    except TypeError as (errno):
+    except jvmti.error as (errno):
         return "don't know"
     
 def save():
@@ -115,17 +115,20 @@
     print reference_kind,class_tag,size,tag_ptr,referrer_tag,referrer_index
     
     
-def threads():
-    """
-        List all JVMTI Threads
-    """
-    print "list threads"
-    for foo in jvmti.getAllThreads() :
-        print "thread id ",foo
+def stack():
+    '''
+    List stack of current thread
+    '''
+    currentThread=jvmti.getCurrentThread();
+    listStack(currentThread)
+    
+
+def listStack(threadid):
+        print "thread id ",threadid
         print "\t--- stack ----"
-        frame_count=jvmti.getFrameCount(foo)
+        frame_count=jvmti.getFrameCount(threadid)
         depth=-1
-        for frame in jvmti.getStackTrace(foo,0,frame_count) :
+        for frame in jvmti.getStackTrace(threadid,0,frame_count) :
             depth=depth+1
             methodName=jvmti.getMethodName(frame[0])
             print  "\t" , depth,frame[0] ,methodName
@@ -138,14 +141,23 @@
                     sig=variable[3]
                     slot=variable[5]
                     
-                    value=getValue(foo,depth,sig,slot)
-                    size=getSize(foo,depth,sig,slot)
+                    value=getValue(threadid,depth,sig,slot)
+                    size=getSize(threadid,depth,sig,slot)
                     print "\t\t" ,slot,sig,name,value,"size=",size
-                   
+                javathis=jvmti.getLocalObject(threadid,depth,0)
+		print "java this ", javathis
                    
                     
-            except TypeError as (errno):
+            except jvmti.error as (errno):
                 print "\t\t error",errno 
 
     
- 
\ No newline at end of file
+def threads():
+    """
+        List all JVMTI Threads
+    """
+    print "list threads"
+    for foo in jvmti.getAllThreads() :
+        listStack(foo)
+    
+ 

Modified: incubator/kato/branches/experimental/PyJVMTI/pyjvmti.c
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/pyjvmti.c?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/pyjvmti.c (original)
+++ incubator/kato/branches/experimental/PyJVMTI/pyjvmti.c Fri Jun  5 19:40:05 2009
@@ -188,6 +188,22 @@
 			return string;
 
 
+
+#define getFieldValue(FUNC,TYPE,PTYPE,DESC)  \
+	CHECK_VALID();\
+\
+			int objectID=0; \
+			int fieldID=0; \
+\
+			PyArg_ParseTuple(args, "ii",&fieldID,&objectID);\
+			jobject object=(jobject)objectID;\
+			jfieldID field=(jfieldID)fieldID;\
+			\
+			TYPE result=0;\
+			result=(*jniptr)->FUNC(jniptr,object,field);\
+   		 return Py_BuildValue(PTYPE, result);
+
+
 #define getValue(FUNC,TYPE,PTYPE,DESC)  \
 	CHECK_VALID();\
 \
@@ -324,6 +340,53 @@
 
 }
 
+
+
+static PyObject *  jvmti_getObjectField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetObjectField,jobject,"i","get obj field")
+}
+static PyObject *  jvmti_getBooleanField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetBooleanField,jboolean,"i","get boolean field")
+}
+static PyObject *  jvmti_getByteField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetByteField,jbyte,"i","get byte field")
+}
+
+static PyObject *  jvmti_getCharField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetCharField,jchar,"i","get char field")
+}
+
+static PyObject *  jvmti_getShortField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetShortField,jshort,"i","get short field")
+}
+
+static PyObject *  jvmti_getIntField(PyObject *self, PyObject *args) {
+
+	printf("\in get int field \n");
+	getFieldValue(GetIntField,jint,"i","get int field")
+}
+
+static PyObject *  jvmti_getLongField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetLongField,jlong,"l","get long field")
+
+}
+static PyObject *  jvmti_getFloatField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetFloatField,jfloat,"f","get float field")
+
+}
+static PyObject *  jvmti_getDoubleField(PyObject *self, PyObject *args) {
+
+	getFieldValue(GetDoubleField,jlong,"f","get double field")
+
+}
+
 static PyObject *  jvmti_getIntArrayElements(PyObject *self, PyObject *args) {
 
 	getArray(Int,jint,int,"i")
@@ -621,6 +684,23 @@
 	return result;
 }
 
+
+ static PyObject *
+jvmti_getCurrentThread(PyObject *self, PyObject *args)
+{
+	CHECK_VALID();
+	jthread threadj=0;
+
+	jvmtiError err=(*jvmtiptr)->GetCurrentThread(jvmtiptr,&threadj);
+
+	CHECK_OK("get currentthread");
+
+	int thread=threadj;
+	PyObject *result=Py_BuildValue("i",thread);
+
+	return result;
+}
+
  /**
   * Returns a list of loaded class ids
   */
@@ -997,6 +1077,32 @@
 
 		return value;
 }
+
+
+
+static PyObject *
+jvmti_getFieldModifiers(PyObject *self, PyObject *args)
+{
+	CHECK_VALID();
+	int class=0;
+    int field=0;
+
+	PyArg_ParseTuple(args, "ii", &class,&field);
+
+	jclass   classid=(jclass)class;
+	jfieldID fieldid=(jfieldID)field;
+
+	printf("\nget mods=%d %d",classid,fieldid);
+
+	jint result=0;
+
+	jvmtiError err=(*jvmtiptr)->GetFieldModifiers(jvmtiptr,classid,fieldid,&result);
+	CHECK_OK(DESC);
+
+   	return Py_BuildValue("i", result);
+
+}
+
 /**
  * Get class signature and generic signature
  * returned as typle of strings
@@ -1204,7 +1310,10 @@
      {"getSuperClass",        jvmti_getSuperClass, METH_VARARGS,   "Get Superclass."},
      {"getObjectClass",       jvmti_getObjectClass, METH_VARARGS,   "Get Object Class."},
      {"getClassLoader",       jvmti_getClassLoader, METH_VARARGS,   "Get Class Loader."},
+
+
      {"getFieldName",         jvmti_getFieldName, METH_VARARGS,   "Get Field Name."},
+     {"getFieldModifiers",    jvmti_getFieldModifiers, METH_VARARGS,   "Get Field Name."},
      {"getMethodModifiers",   jvmti_getMethodModifiers, METH_VARARGS,   "Get Method Modifiers."},
      {"getMaxLocals",         jvmti_getMaxLocals, METH_VARARGS,   "Get Max Locas."},
      {"getArgumentsSize",     jvmti_getArgumentsSize, METH_VARARGS,   "Get Argumens Size."},
@@ -1219,10 +1328,22 @@
      {"getDoubleArrayElements",jvmti_getDoubleArrayElements, METH_VARARGS,   "Get Double
Array Elements"},
      {"registerExceptionFilter",jvmti_registerExceptionFilter, METH_VARARGS,   "Register
cllback for exception events"},
      {"getPhase",              jvmti_getPhase, METH_VARARGS,   "Get JVMTI Phase"},
-
+     {"getCurrentThread",      jvmti_getCurrentThread, METH_VARARGS,   "Get Current Thread
ID"},
      {"iterateOverReachableObjects",       jvmti_iterateOverReachableObjects, METH_VARARGS,
  "Iterate over reachable objects"},
 
 
+
+
+     {"getObjectField",  jvmti_getObjectField, METH_VARARGS,   "Iterate over reachable objects"},
+    {"getBooleanField",  jvmti_getBooleanField, METH_VARARGS,   "Iterate over reachable objects"},
+    {"getByteField",  jvmti_getByteField, METH_VARARGS,   "Iterate over reachable objects"},
+     {"getCharField",  jvmti_getCharField, METH_VARARGS,   "Iterate over reachable objects"},
+    {"getShortField",  jvmti_getShortField, METH_VARARGS,   "Iterate over reachable objects"},
+    {"getIntField",  jvmti_getIntField, METH_VARARGS,   "Iterate over reachable objects"},
+     {"getLongField",  jvmti_getLongField, METH_VARARGS,   "Iterate over reachable objects"},
+     {"getFloatField",  jvmti_getFloatField, METH_VARARGS,   "Iterate over reachable objects"},
+     {"getDoubleField",  jvmti_getDoubleField, METH_VARARGS,   "Iterate over reachable objects"},
+
      {NULL, NULL, 0, NULL}        /* Sentinel */
 };
 

Modified: incubator/kato/branches/experimental/PyJVMTI/pyjvmti.h
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/PyJVMTI/pyjvmti.h?rev=782114&r1=782113&r2=782114&view=diff
==============================================================================
--- incubator/kato/branches/experimental/PyJVMTI/pyjvmti.h (original)
+++ incubator/kato/branches/experimental/PyJVMTI/pyjvmti.h Fri Jun  5 19:40:05 2009
@@ -91,7 +91,18 @@
 static PyObject *jvmti_iterateOverReachableObjects(PyObject *self, PyObject *args);
 static PyObject *jvmti_getLocalValue(PyObject *self, PyObject *args);
 static PyObject *jvmti_getObjectClass(PyObject *self, PyObject *args);
-static PyObject *  jvmti_getPhase(PyObject *self, PyObject *args);
+static PyObject *jvmti_getPhase(PyObject *self, PyObject *args);
+static PyObject *jvmti_getCurrentThread(PyObject *self, PyObject *args);
+static PyObject *jvmti_getFieldModifiers(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getObjectField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getBooleanField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getByteField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getCharField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getShortField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getIntField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getLongField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getFloatField(PyObject *self, PyObject *args);
+static PyObject *  jvmti_getDoubleField(PyObject *self, PyObject *args);
 
 void runScript(char *);
 void startPython(void);



Mime
View raw message