initial support for jvmti
authormotse <none@none>
Tue, 19 Jul 2005 10:03:00 +0000 (10:03 +0000)
committermotse <none@none>
Tue, 19 Jul 2005 10:03:00 +0000 (10:03 +0000)
src/cacao/cacao.c
src/native/Makefile.am
src/native/jni.c
src/native/jni.h
src/native/jvmti/jvmti.c [new file with mode: 0644]
src/native/jvmti/jvmti.h [new file with mode: 0644]
src/threads/native/threads.h

index ebc42b1a29b08bf2d64a0107d7557ff85f4d78c7..defde39229d208817c9fcc3a4cee67440c0452a0 100644 (file)
@@ -37,7 +37,7 @@
      - Calling the class loader
      - Running the main method
 
-   $Id: cacao.c 2950 2005-07-09 13:37:29Z twisti $
+   $Id: cacao.c 3062 2005-07-19 10:03:00Z motse $
 
 */
 
@@ -65,6 +65,7 @@
 #include "vm/classcache.h"
 #include "vm/jit/asmpart.h"
 #include "vm/jit/jit.h"
+#include "native/jvmti.h"
 
 #ifdef TYPEINFO_DEBUG_TEST
 #include "vm/jit/verify/typeinfo.h"
@@ -947,6 +948,7 @@ int main(int argc, char **argv)
 
        JNI_CreateJavaVM(&jvm, &env, &vm_args);
 
+       set_jvmti_phase(JVMTI_PHASE_START);
 
        /* initialize the garbage collector */
 
index d9fa49ca69d7dc40f1e5ef4198defb7cf09a5cea..8133e526b2e052f831d3f4fe18d07ae81c258913 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## Changes:
 ##
-## $Id: Makefile.am 2860 2005-06-28 18:37:28Z twisti $
+## $Id: Makefile.am 3062 2005-07-19 10:03:00Z motse $
 
 ## Process this file with automake to produce Makefile.in
 
@@ -53,6 +53,8 @@ noinst_LTLIBRARIES = libnative.la
 libnative_la_SOURCES = \
        jni.c \
        jni.h \
+       jvmti.c\
+       jvmti.h \
        native.c \
        native.h \
        nativecalls.inc
index dc1d2350c788883dd0c5e787736d280517d71dc6..1c90e8a973ce645fe32106289888e49b517a858f 100644 (file)
@@ -31,7 +31,7 @@
             Martin Platter
             Christian Thalinger
 
-   $Id: jni.c 3034 2005-07-13 12:10:14Z twisti $
+   $Id: jni.c 3062 2005-07-19 10:03:00Z motse $
 
 */
 
@@ -43,6 +43,7 @@
 #include "mm/boehm.h"
 #include "mm/memory.h"
 #include "native/jni.h"
+#include "native/jvmti.h"
 #include "native/native.h"
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_Byte.h"
@@ -94,7 +95,7 @@ extern struct JNINativeInterface JNI_JNIEnvTable;
 /* pointers to VM and the environment needed by GetJavaVM and GetEnv */
 
 static JavaVM ptr_jvm = (JavaVM) &JNI_JavaVMTable;
-static void* ptr_env = (void*) &JNI_JNIEnvTable;
+void* ptr_env = (void*) &JNI_JNIEnvTable;
 
 
 #define PTR_TO_ITEM(ptr)   ((u8)(size_t)(ptr))
@@ -4014,18 +4015,23 @@ jint GetEnv(JavaVM *vm, void **env, jint version)
        }
 #endif
 
-       if ((version != JNI_VERSION_1_1) && (version != JNI_VERSION_1_2) &&
-               (version != JNI_VERSION_1_4)) {
-               *env = NULL;
-               return JNI_EVERSION;
+       if ((version == JNI_VERSION_1_1) || (version == JNI_VERSION_1_2) ||
+               (version == JNI_VERSION_1_4)) {
+               *env = &ptr_env;
+               return JNI_OK;
        }
 
-       *env = &ptr_env;
-
-       return JNI_OK;
+       if (version == JVMTI_VERSION_1_0) {
+               *env = (void*)new_jvmtienv();
+               if (env != NULL) return JNI_OK;
+       }
+       
+       *env = NULL;
+       return JNI_EVERSION;
 }
 
 
+
 jint AttachCurrentThreadAsDaemon(JavaVM *vm, void **par1, void *par2)
 {
        STATS(jniinvokation();)
index ae4b974535aab2abbaf015b0eff60b14d1d812f4..0fcb67aece06cecbe4d69162b83c60982aa5dc1f 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: jni.h 3016 2005-07-12 21:47:29Z twisti $
+   $Id: jni.h 3062 2005-07-19 10:03:00Z motse $
 
 */
 
@@ -611,6 +611,9 @@ jobject *jni_method_invokeNativeHelper(JNIEnv *env,struct methodinfo *mi,jobject
 
 void jni_init ();
 
+extern void* ptr_env;
+extern struct JNINativeInterface JNI_JNIEnvTable;
+
 #endif /* _JNI_H */
 
 
diff --git a/src/native/jvmti/jvmti.c b/src/native/jvmti/jvmti.c
new file mode 100644 (file)
index 0000000..154a8fc
--- /dev/null
@@ -0,0 +1,3387 @@
+/* src/native/jvmti.c - implementation of the Java Virtual Machine Tool 
+                        Interface functions
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   Institut f. Computersprachen - TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Author: Martin Platter
+
+   Changes:             
+
+   
+   $Id: jvmti.c 3062 2005-07-19 10:03:00Z motse $
+
+*/
+
+
+#include "native/jni.h"
+#include "native/jvmti.h"
+#include "vm/global.h"
+#include "vm/loader.h"
+#include "vm/builtin.h"
+#include "vm/jit/asmpart.h"
+#include "mm/boehm.h"
+#include "toolbox/logging.h"
+#include "vm/options.h"
+#include "cacao/cacao.h"
+#include "vm/stringlocal.h"
+#include "mm/memory.h"
+#include "threads/native/threads.h"
+#include "vm/exceptions.h"
+
+#include <string.h>
+#include <linux/unistd.h>
+#include <sys/time.h>
+
+static jvmtiPhase phase; 
+
+typedef struct {
+    jvmtiEnv env;
+    jvmtiEventCallbacks callbacks;
+    jobject *events;   /* hashtable for enabled/disabled jvmtiEvents */
+    jvmtiCapabilities capabilities;
+    void *EnvironmentLocalStorage;
+} environment;
+
+
+/* jmethodID and jclass caching */
+static jclass ihmclass = NULL;
+static jmethodID ihmmid = NULL;
+
+jvmtiEnv JVMTI_EnvTable;
+jvmtiCapabilities JVMTI_Capabilities;
+
+#define CHECK_PHASE_START  if (!(0 
+#define CHECK_PHASE(chkphase) || (phase == chkphase)
+#define CHECK_PHASE_END  )) return JVMTI_ERROR_WRONG_PHASE
+
+
+/* SetEventNotificationMode ****************************************************
+
+   Control the generation of events
+
+*******************************************************************************/
+
+jvmtiError
+SetEventNotificationMode (jvmtiEnv * env, jvmtiEventMode mode,
+                         jvmtiEvent event_type, jthread event_thread, ...)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+    
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");    
+    
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetAllThreads ***************************************************************
+
+   Get all live threads
+
+*******************************************************************************/
+
+jvmtiError
+GetAllThreads (jvmtiEnv * env, jint * threads_count_ptr,
+              jthread ** threads_ptr)
+{
+    int i = 0; 
+    threadobject* thread;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if ((threads_count_ptr == NULL) || (threads_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    thread = mainthreadobj;
+    do {
+        i++;
+        thread = thread->info.prev;
+    } while (thread != mainthreadobj);
+    
+    *threads_count_ptr = i;
+
+    *threads_ptr = (jthread*) heap_allocate(sizeof(jthread) * i,true,NULL);
+    i=0;
+    do {
+        memcpy(*threads_ptr[i],thread,sizeof(jthread));
+        thread = thread->info.prev;
+        i++;
+    } while (thread != mainthreadobj);
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* SuspendThread ***************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SuspendThread (jvmtiEnv * env, jthread thread)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+ResumeThread (jvmtiEnv * env, jthread thread)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+StopThread (jvmtiEnv * env, jthread thread, jobject exception)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+InterruptThread (jvmtiEnv * env, jthread thread)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetThreadInfo ***************************************************************
+
+   Get thread information. The fields of the jvmtiThreadInfo structure are 
+   filled in with details of the specified thread.
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadInfo (jvmtiEnv * env, jthread thread, jvmtiThreadInfo * info_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetOwnedMonitorInfo *********************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetOwnedMonitorInfo (jvmtiEnv * env, jthread thread,
+                    jint * owned_monitor_count_ptr,
+                    jobject ** owned_monitors_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetCurrentContendedMonitor (jvmtiEnv * env, jthread thread,
+                           jobject * monitor_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RunAgentThread (jvmtiEnv * env, jthread thread, jvmtiStartFunction proc,
+               const void *arg, jint priority)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetTopThreadGroups (jvmtiEnv * env, jint * group_count_ptr,
+                   jthreadGroup ** groups_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadGroupInfo (jvmtiEnv * env, jthreadGroup group,
+                   jvmtiThreadGroupInfo * info_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadGroupChildren (jvmtiEnv * env, jthreadGroup group,
+                       jint * thread_count_ptr, jthread ** threads_ptr,
+                       jint * group_count_ptr, jthreadGroup ** groups_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetFrameCount (jvmtiEnv * env, jthread thread, jint * count_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetThreadState **************************************************************
+
+   Get the state of a thread. 
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadState (jvmtiEnv * env, jthread thread, jint * thread_state_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetFrameLocation (jvmtiEnv * env, jthread thread, jint depth,
+                 jmethodID * method_ptr, jlocation * location_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+NotifyFramePop (jvmtiEnv * env, jthread thread, jint depth)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetLocalObject (jvmtiEnv * env,
+               jthread thread, jint depth, jint slot, jobject * value_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetLocalInt (jvmtiEnv * env,
+            jthread thread, jint depth, jint slot, jint * value_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetLocalLong (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+             jlong * value_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetLocalFloat (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+              jfloat * value_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetLocalDouble (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+               jdouble * value_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetLocalObject (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+               jobject value)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetLocalInt (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+            jint value)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetLocalLong (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+             jlong value)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetLocalFloat (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+              jfloat value)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetLocalDouble (jvmtiEnv * env, jthread thread, jint depth, jint slot,
+               jdouble value)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+CreateRawMonitor (jvmtiEnv * env, const char *name,
+                 jrawMonitorID * monitor_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+DestroyRawMonitor (jvmtiEnv * env, jrawMonitorID monitor)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RawMonitorEnter (jvmtiEnv * env, jrawMonitorID monitor)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RawMonitorExit (jvmtiEnv * env, jrawMonitorID monitor)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RawMonitorWait (jvmtiEnv * env, jrawMonitorID monitor, jlong millis)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RawMonitorNotify (jvmtiEnv * env, jrawMonitorID monitor)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RawMonitorNotifyAll (jvmtiEnv * env, jrawMonitorID monitor)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetBreakpoint (jvmtiEnv * env, jmethodID method, jlocation location)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+ClearBreakpoint (jvmtiEnv * env, jmethodID method, jlocation location)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetFieldAccessWatch (jvmtiEnv * env, jclass klass, jfieldID field)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+ClearFieldAccessWatch (jvmtiEnv * env, jclass klass, jfieldID field)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetFieldModificationWatch (jvmtiEnv * env, jclass klass, jfieldID field)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+ClearFieldModificationWatch (jvmtiEnv * env, jclass klass, jfieldID field)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* Allocate ********************************************************************
+
+   Allocate an area of memory through the JVM TI allocator. The allocated 
+   memory should be freed with Deallocate
+
+*******************************************************************************/
+
+jvmtiError
+Allocate (jvmtiEnv * env, jlong size, unsigned char **mem_ptr)
+{
+    
+    if (mem_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+    if (size < 0) return JVMTI_ERROR_ILLEGAL_ARGUMENT;
+
+    *mem_ptr = heap_allocate(sizeof(size),true,NULL);
+    if (*mem_ptr == NULL) 
+        return JVMTI_ERROR_OUT_OF_MEMORY;
+    else
+        return JVMTI_ERROR_NONE;
+    
+}
+
+
+/* Deallocate ******************************************************************
+
+   Deallocate mem using the JVM TI allocator.
+
+*******************************************************************************/
+
+jvmtiError
+Deallocate (jvmtiEnv * env, unsigned char *mem)
+{
+    /* let Boehm GC do the job */
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetClassSignature ************************************************************
+
+   For the class indicated by klass, return the JNI type signature and the 
+   generic signature of the class.
+
+*******************************************************************************/
+
+jvmtiError
+GetClassSignature (jvmtiEnv * env, jclass klass, char **signature_ptr,
+                  char **generic_ptr)
+{
+    int nsize,psize;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+       
+    if ((generic_ptr== NULL)||(signature_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    nsize=((classinfo*)klass)->name->blength;
+    psize=((classinfo*)klass)->packagename->blength;
+
+    *signature_ptr = (char*) 
+        heap_allocate(sizeof(char)* nsize+psize+4,true,NULL);
+
+    *signature_ptr[0]='L';
+    memcpy(&(*signature_ptr[1]),((classinfo*)klass)->packagename->text, psize);
+    *signature_ptr[psize+2]='/';
+    memcpy(&(*signature_ptr[psize+3]),((classinfo*)klass)->name->text, nsize);
+    *signature_ptr[nsize+psize+3]=';';
+    *signature_ptr[nsize+psize+4]='\0';
+
+    *generic_ptr = NULL;
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetClassStatus (jvmtiEnv * env, jclass klass, jint * status_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetSourceFileName **********************************************************
+
+   For the class indicated by klass, return the source file name.
+
+*******************************************************************************/
+
+jvmtiError
+GetSourceFileName (jvmtiEnv * env, jclass klass, char **source_name_ptr)
+{
+    int size; 
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((klass == NULL)||(source_name_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+    
+    size = (((classinfo*)klass)->sourcefile->blength);
+
+    *source_name_ptr = (char*) heap_allocate(sizeof(char)* size,true,NULL);
+    
+    memcpy(*source_name_ptr,((classinfo*)klass)->sourcefile->text, size);
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetClassModifiers (jvmtiEnv * env, jclass klass, jint * modifiers_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetClassMethods *************************************************************
+
+   For the class indicated by klass, return a count of methods and a list of 
+   method IDs
+
+*******************************************************************************/
+
+jvmtiError
+GetClassMethods (jvmtiEnv * env, jclass klass, jint * method_count_ptr,
+                jmethodID ** methods_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((klass == NULL)||(methods_ptr == NULL)||(method_count_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    *method_count_ptr = (jint)((classinfo*)klass)->methodscount;
+    *methods_ptr = (jmethodID*) 
+        heap_allocate(sizeof(jmethodID) * (*method_count_ptr),true,NULL);
+    
+    memcpy (*methods_ptr, ((classinfo*)klass)->methods, 
+            sizeof(jmethodID) * (*method_count_ptr));
+    
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetClassFields *************************************************************
+
+   For the class indicated by klass, return a count of fields and a list of 
+   field IDs.
+
+*******************************************************************************/
+
+jvmtiError
+GetClassFields (jvmtiEnv * env, jclass klass, jint * field_count_ptr,
+               jfieldID ** fields_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((klass == NULL)||(fields_ptr == NULL)||(field_count_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    *field_count_ptr = (jint)((classinfo*)klass)->fieldscount;
+    *fields_ptr = (jfieldID*) 
+        heap_allocate(sizeof(jfieldID) * (*field_count_ptr),true,NULL);
+    
+    memcpy (*fields_ptr, ((classinfo*)klass)->fields, 
+            sizeof(jfieldID) * (*field_count_ptr));
+    
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetImplementedInterfaces (jvmtiEnv * env, jclass klass,
+                         jint * interface_count_ptr,
+                         jclass ** interfaces_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* IsInterface ****************************************************************
+
+   Determines whether a class object reference represents an interface.
+
+*******************************************************************************/
+
+jvmtiError
+IsInterface (jvmtiEnv * env, jclass klass, jboolean * is_interface_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((klass == NULL)||(is_interface_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+    
+    *is_interface_ptr = (((classinfo*)klass)->flags & ACC_INTERFACE);
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* IsArrayClass ***************************************************************
+
+   Determines whether a class object reference represents an array.
+
+*******************************************************************************/
+
+jvmtiError
+IsArrayClass (jvmtiEnv * env, jclass klass, jboolean * is_array_class_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if (is_array_class_ptr == NULL) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    *is_array_class_ptr = ((classinfo*)klass)->name->text[0] == '[';
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetClassLoader *************************************************************
+
+   For the class indicated by klass, return via classloader_ptr a reference to 
+   the class loader for the class.
+
+*******************************************************************************/
+
+jvmtiError
+GetClassLoader (jvmtiEnv * env, jclass klass, jobject * classloader_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((klass == NULL)||(classloader_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    *classloader_ptr = (jobject)((classinfo*)klass)->classloader;
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetObjectHashCode (jvmtiEnv * env, jobject object, jint * hash_code_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetObjectMonitorUsage (jvmtiEnv * env, jobject object,
+                      jvmtiMonitorUsage * info_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetFieldName ***************************************************************
+
+   For the field indicated by klass and field, return the field name and 
+   signature.
+
+*******************************************************************************/
+
+jvmtiError
+GetFieldName (jvmtiEnv * env, jclass klass, jfieldID field,
+             char **name_ptr, char **signature_ptr, char **generic_ptr)
+{
+    int size; 
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((field == NULL)||(name_ptr == NULL)||(signature_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+    
+    size = (((fieldinfo*)field)->name->blength);
+    *name_ptr = (char*) heap_allocate(sizeof(char)* size,true,NULL);    
+    memcpy(*name_ptr,((fieldinfo*)field)->name->text, size);
+
+    size = (((fieldinfo*)field)->descriptor->blength);
+    *signature_ptr = (char*) heap_allocate(sizeof(char)* size,true,NULL);    
+    memcpy(*signature_ptr,((fieldinfo*)field)->descriptor->text, size);
+
+    *generic_ptr = NULL;
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetFieldDeclaringClass *****************************************************
+
+   For the field indicated by klass and field return the class that defined it 
+   The declaring class will either be klass, a superclass, or an implemented 
+   interface.
+
+*******************************************************************************/
+
+jvmtiError
+GetFieldDeclaringClass (jvmtiEnv * env, jclass klass, jfieldID field,
+                       jclass * declaring_class_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    /* todo: find declaring class  */
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetFieldModifiers (jvmtiEnv * env, jclass klass, jfieldID field,
+                  jint * modifiers_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+IsFieldSynthetic (jvmtiEnv * env, jclass klass, jfieldID field,
+                 jboolean * is_synthetic_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetMethodName ***************************************************************
+
+   For the method indicated by method, return the method name via name_ptr and 
+   method signature via signature_ptr.
+
+*******************************************************************************/
+
+jvmtiError
+GetMethodName (jvmtiEnv * env, jmethodID method, char **name_ptr,
+              char **signature_ptr, char **generic_ptr)
+{
+    methodinfo* m = (methodinfo*)method;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if ((method == NULL) || (name_ptr == NULL) || (signature_ptr == NULL)
+        || (generic_ptr == NULL)) return JVMTI_ERROR_NULL_POINTER;
+
+    *name_ptr = (char*)heap_allocate(m->name->blength,true,NULL);
+    memcpy(*name_ptr, m->name->text, m->name->blength);
+
+    *signature_ptr = (char*)heap_allocate(m->descriptor->blength,true,NULL);
+    memcpy(*signature_ptr, m->descriptor->text, m->descriptor->blength);
+    
+    /* there is no generic signature attribute */
+    *generic_ptr = NULL;
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetMethodDeclaringClass *****************************************************
+
+  For the method indicated by method, return the class that defined it.
+
+*******************************************************************************/
+
+jvmtiError
+GetMethodDeclaringClass (jvmtiEnv * env, jmethodID method,
+                        jclass * declaring_class_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+     
+    if ((method == NULL) || (declaring_class_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+    
+    *declaring_class_ptr = (jclass)((methodinfo*)method)->class;
+    
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetMethodModifiers **********************************************************
+
+   For the method indicated by method, return the access flags.
+
+*******************************************************************************/
+
+jvmtiError
+GetMethodModifiers (jvmtiEnv * env, jmethodID method, jint * modifiers_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((method == NULL) || (modifiers_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    *modifiers_ptr = (jint) (((methodinfo*)method)->flags);
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetMaxLocals ****************************************************************
+
+   For the method indicated by method, return the number of local variable slots 
+   used by the method, including the local variables used to pass parameters to 
+   the method on its invocation.
+
+*******************************************************************************/
+
+jvmtiError
+GetMaxLocals (jvmtiEnv * env, jmethodID method, jint * max_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((method == NULL)||(max_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;    
+    
+    if (((methodinfo*)method)->flags & ACC_NATIVE)  
+        return JVMTI_ERROR_NATIVE_METHOD;
+   
+    *max_ptr = (jint) ((methodinfo*)method)->maxlocals;
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+
+/* GetArgumentsSize ************************************************************
+
+   Return the number of local variable slots used by the method's arguments.
+
+*******************************************************************************/
+
+jvmtiError
+GetArgumentsSize (jvmtiEnv * env, jmethodID method, jint * size_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if ((method == NULL)||(size_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;    
+    
+    if (((methodinfo*)method)->flags & ACC_NATIVE)  
+        return JVMTI_ERROR_NATIVE_METHOD;
+
+    *size_ptr = (jint)((methodinfo*)method)->paramcount;
+    return JVMTI_ERROR_NONE;
+}
+
+
+
+/* GetLineNumberTable ***********************************************************
+
+   For the method indicated by method, return a table of source line number 
+   entries.
+
+*******************************************************************************/
+
+jvmtiError
+GetLineNumberTable (jvmtiEnv * env, jmethodID method,
+                   jint * entry_count_ptr, jvmtiLineNumberEntry ** table_ptr)
+{
+    int i;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+   
+    if ((method == NULL) || (entry_count_ptr == NULL) || (table_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;    
+    if (((methodinfo*)method)->flags & ACC_NATIVE)  
+        return JVMTI_ERROR_NATIVE_METHOD;
+    if (((methodinfo*)method)->linenumbers == NULL) 
+        return JVMTI_ERROR_ABSENT_INFORMATION;
+
+    *entry_count_ptr= (jint)((methodinfo*)method)->linenumbercount;
+    *table_ptr = (jvmtiLineNumberEntry*) heap_allocate(
+        sizeof(jvmtiLineNumberEntry) * (*entry_count_ptr),true,NULL);
+
+
+    for (i=0; i < *entry_count_ptr; i++) {
+        (*table_ptr[i]).start_location = 
+            (jlocation) method->linenumbers[i].start_pc;
+        (*table_ptr[i]).line_number = 
+            (jint) ((methodinfo*)method)->linenumbers[i].line_number;
+    }
+    
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetMethodLocation ***********************************************************
+
+   For the method indicated by method, return the beginning and ending addresses 
+   through start_location_ptr and end_location_ptr. In cacao this points to 
+   entry point in machine code and length of machine code
+
+*******************************************************************************/
+
+jvmtiError
+GetMethodLocation (jvmtiEnv * env, jmethodID method,
+                  jlocation * start_location_ptr,
+                  jlocation * end_location_ptr)
+{
+    methodinfo* m = (methodinfo*)method;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if ((method == NULL) || (start_location_ptr == NULL) || 
+        (end_location_ptr == NULL)) return JVMTI_ERROR_NULL_POINTER;
+    
+    *start_location_ptr = (jlocation)m->mcode;
+    *end_location_ptr = (jlocation)(m->mcode)+m->mcodelength;
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetLocalVariableTable *******************************************************
+
+   Return local variable information.
+
+*******************************************************************************/
+
+jvmtiError
+GetLocalVariableTable (jvmtiEnv * env, jmethodID method,
+                      jint * entry_count_ptr,
+                      jvmtiLocalVariableEntry ** table_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetBytecode *****************************************************************
+
+   For the method indicated by method, return the byte codes that implement the 
+   method.
+
+*******************************************************************************/
+
+jvmtiError
+GetBytecodes (jvmtiEnv * env, jmethodID method,
+             jint * bytecode_count_ptr, unsigned char **bytecodes_ptr)
+{
+    methodinfo* m = (methodinfo*)method;;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((method == NULL) || (bytecode_count_ptr == NULL) || 
+        (bytecodes_ptr == NULL)) return JVMTI_ERROR_NULL_POINTER;
+
+    *bytecode_count_ptr = m->jcodelength;
+    *bytecodes_ptr = (unsigned char*)heap_allocate(m->jcodelength,true,NULL);
+    memcpy(*bytecodes_ptr, m->jcode, m->jcodelength);
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* IsMethodNative **************************************************************
+
+   For the method indicated by method, return a value indicating whether the 
+   method is a native function
+
+*******************************************************************************/
+
+jvmtiError
+IsMethodNative (jvmtiEnv * env, jmethodID method, jboolean * is_native_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+    
+    if ((method == NULL)||(is_native_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;    
+
+    if (((methodinfo*)method)->flags & ACC_NATIVE) 
+        *is_native_ptr = JNI_TRUE;
+    else
+        *is_native_ptr = JNI_FALSE;
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* IsMethodSynthetic ***********************************************************
+
+   return a value indicating whether the method is synthetic. Synthetic methods 
+   are generated by the compiler but not present in the original source code.
+
+*******************************************************************************/
+
+jvmtiError
+IsMethodSynthetic (jvmtiEnv * env, jmethodID method,
+                  jboolean * is_synthetic_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetLoadedClasses ************************************************************
+
+   Return an array of all classes loaded in the virtual machine.
+
+*******************************************************************************/
+
+jvmtiError
+GetLoadedClasses (jvmtiEnv * env, jint * class_count_ptr,
+                 jclass ** classes_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if (class_count_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+    if (classes_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetClassLoaderClasses *******************************************************
+
+   Returns an array of those classes for which this class loader has been 
+   recorded as an initiating loader.
+
+*******************************************************************************/
+
+jvmtiError
+GetClassLoaderClasses (jvmtiEnv * env, jobject initiating_loader,
+                      jint * class_count_ptr, jclass ** classes_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if (class_count_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+    if (classes_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+        
+    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+PopFrame (jvmtiEnv * env, jthread thread)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+RedefineClasses (jvmtiEnv * env, jint class_count,
+                const jvmtiClassDefinition * class_definitions)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetVersionNumber ***********************************************************
+
+   Return the JVM TI version identifier.   
+
+*******************************************************************************/
+
+jvmtiError
+GetVersionNumber (jvmtiEnv * env, jint * version_ptr)
+{
+    if (version_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    *version_ptr = JVMTI_VERSION_1_0;
+    
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetCapabilities ************************************************************
+
+   Returns via capabilities_ptr the optional JVM TI features which this 
+   environment currently possesses.
+
+*******************************************************************************/
+
+jvmtiError
+GetCapabilities (jvmtiEnv * env, jvmtiCapabilities * capabilities_ptr)
+{
+    if (capabilities_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    memcpy(capabilities_ptr, &(((environment*) env)->capabilities), sizeof(JVMTI_Capabilities));
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetSourceDebugExtension (jvmtiEnv * env, jclass klass,
+                        char **source_debug_extension_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* IsMethodObsolete ************************************************************
+
+   Determine if a method ID refers to an obsolete method version. 
+
+*******************************************************************************/
+
+jvmtiError
+IsMethodObsolete (jvmtiEnv * env, jmethodID method,
+                 jboolean * is_obsolete_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SuspendThreadList (jvmtiEnv * env, jint request_count,
+                  const jthread * request_list, jvmtiError * results)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+ResumeThreadList (jvmtiEnv * env, jint request_count,
+                 const jthread * request_list, jvmtiError * results)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetAllStackTraces (jvmtiEnv * env, jint max_frame_count,
+                  jvmtiStackInfo ** stack_info_ptr, jint * thread_count_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadListStackTraces (jvmtiEnv * env, jint thread_count,
+                         const jthread * thread_list,
+                         jint max_frame_count,
+                         jvmtiStackInfo ** stack_info_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadLocalStorage (jvmtiEnv * env, jthread thread, void **data_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetThreadLocalStorage (jvmtiEnv * env, jthread thread, const void *data)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetStackTrace (jvmtiEnv * env, jthread thread, jint start_depth,
+              jint max_frame_count, jvmtiFrameInfo * frame_buffer,
+              jint * count_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetTag (jvmtiEnv * env, jobject object, jlong * tag_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+SetTag (jvmtiEnv * env, jobject object, jlong tag)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+ForceGarbageCollection (jvmtiEnv * env)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+IterateOverObjectsReachableFromObject (jvmtiEnv * env, jobject object,
+                                      jvmtiObjectReferenceCallback
+                                      object_reference_callback,
+                                      void *user_data)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+IterateOverReachableObjects (jvmtiEnv * env, jvmtiHeapRootCallback
+                            heap_root_callback,
+                            jvmtiStackReferenceCallback
+                            stack_ref_callback,
+                            jvmtiObjectReferenceCallback
+                            object_ref_callback, void *user_data)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+IterateOverHeap (jvmtiEnv * env, jvmtiHeapObjectFilter object_filter,
+                jvmtiHeapObjectCallback heap_object_callback,
+                void *user_data)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+IterateOverInstancesOfClass (jvmtiEnv * env, jclass klass,
+                            jvmtiHeapObjectFilter object_filter,
+                            jvmtiHeapObjectCallback
+                            heap_object_callback, void *user_data)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetObjectsWithTags (jvmtiEnv * env, jint tag_count, const jlong * tags,
+                   jint * count_ptr, jobject ** object_result_ptr,
+                   jlong ** tag_result_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* SetJNIFunctionTable **********************************************************
+
+   Set the JNI function table in all current and future JNI environments
+
+*******************************************************************************/
+
+jvmtiError
+SetJNIFunctionTable (jvmtiEnv * env,
+                    const jniNativeInterface * function_table)
+{ 
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;;
+    
+    if (function_table == NULL) return JVMTI_ERROR_NULL_POINTER;
+    ptr_env = (void*)heap_allocate(sizeof(jniNativeInterface),true,NULL);
+    memcpy(ptr_env, function_table, sizeof(jniNativeInterface));
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetJNIFunctionTable *********************************************************
+
+   Get the JNI function table. The JNI function table is copied into allocated 
+   memory.
+
+*******************************************************************************/
+
+jvmtiError
+GetJNIFunctionTable (jvmtiEnv * env, jniNativeInterface ** function_table)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if (function_table == NULL) return JVMTI_ERROR_NULL_POINTER;
+    *function_table = (jniNativeInterface*)
+        heap_allocate(sizeof(jniNativeInterface),true,NULL);
+    memcpy(*function_table, ptr_env, sizeof(jniNativeInterface));
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* SetEventCallbacks **********************************************************
+
+   Set the functions to be called for each event. The callbacks are specified 
+   by supplying a replacement function table.
+
+*******************************************************************************/
+
+jvmtiError
+SetEventCallbacks (jvmtiEnv * env,
+                  const jvmtiEventCallbacks * callbacks,
+                  jint size_of_callbacks)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if (size_of_callbacks < 0) return JVMTI_ERROR_ILLEGAL_ARGUMENT;
+    
+    if (callbacks == NULL) { /* remove the existing callbacks */
+        memset(&(((environment* )env)->callbacks), 0, sizeof(jvmtiEventCallbacks));
+    }
+
+    memcpy (&(((environment* )env)->callbacks),callbacks,size_of_callbacks);
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GenerateEvents (jvmtiEnv * env, jvmtiEvent event_type)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetExtensionFunctions ******************************************************
+
+   Returns the set of extension functions.
+
+*******************************************************************************/
+
+jvmtiError
+GetExtensionFunctions (jvmtiEnv * env, jint * extension_count_ptr,
+                      jvmtiExtensionFunctionInfo ** extensions)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((extension_count_ptr== NULL)||(extensions == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    /* cacao has no extended functions yet */
+    *extension_count_ptr = 0;
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetExtensionEvents *********************************************************
+
+   Returns the set of extension events.
+
+*******************************************************************************/
+
+jvmtiError
+GetExtensionEvents (jvmtiEnv * env, jint * extension_count_ptr,
+                   jvmtiExtensionEventInfo ** extensions)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((extension_count_ptr== NULL)||(extensions == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    /* cacao has no extended events yet */
+    *extension_count_ptr = 0;
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* SetExtensionEventCallback **************************************************
+
+   Sets the callback function for an extension event and enables the event.
+
+*******************************************************************************/
+
+jvmtiError
+SetExtensionEventCallback (jvmtiEnv * env, jint extension_event_index,
+                          jvmtiExtensionEvent callback)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    /* cacao has no extended events yet */
+    return JVMTI_ERROR_ILLEGAL_ARGUMENT;
+}
+
+
+/* DisposeEnvironment **********************************************************
+
+   Shutdown a JVM TI connection created with JNI GetEnv.
+
+*******************************************************************************/
+
+jvmtiError
+DisposeEnvironment (jvmtiEnv * env)
+{
+    ((environment* )env)->events = NULL;
+    ((environment* )env)->EnvironmentLocalStorage = NULL;
+    /* let Boehm GC do the rest */
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetErrorName ***************************************************************
+
+   Return the symbolic name for an error code.
+
+*******************************************************************************/
+
+#define COPY_RESPONSE(name_ptr,str) *name_ptr = (char*) heap_allocate(sizeof(str),true,NULL); \
+                                    memcpy(*name_ptr, &str, sizeof(str)); \
+                                    break
+
+jvmtiError
+GetErrorName (jvmtiEnv * env, jvmtiError error, char **name_ptr)
+{
+    if (name_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    switch (error) {
+    case JVMTI_ERROR_NONE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NONE");
+    case JVMTI_ERROR_NULL_POINTER : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NULL_POINTER"); 
+    case JVMTI_ERROR_OUT_OF_MEMORY : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_OUT_OF_MEMORY");
+    case JVMTI_ERROR_ACCESS_DENIED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_ACCESS_DENIED");
+    case JVMTI_ERROR_UNATTACHED_THREAD : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNATTACHED_THREAD");
+    case JVMTI_ERROR_INVALID_ENVIRONMENT : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_ENVIRONMENT"); 
+    case JVMTI_ERROR_WRONG_PHASE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_WRONG_PHASE");
+    case JVMTI_ERROR_INTERNAL : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INTERNAL");
+    case JVMTI_ERROR_INVALID_PRIORITY : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_PRIORITY");
+    case JVMTI_ERROR_THREAD_NOT_SUSPENDED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_THREAD_NOT_SUSPENDED");
+    case JVMTI_ERROR_THREAD_SUSPENDED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_THREAD_SUSPENDED");
+    case JVMTI_ERROR_THREAD_NOT_ALIVE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_THREAD_NOT_ALIVE");
+    case JVMTI_ERROR_CLASS_NOT_PREPARED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_CLASS_NOT_PREPARED");
+    case JVMTI_ERROR_NO_MORE_FRAMES : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NO_MORE_FRAMES");
+    case JVMTI_ERROR_OPAQUE_FRAME : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_OPAQUE_FRAME");
+    case JVMTI_ERROR_DUPLICATE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_DUPLICATE");
+    case JVMTI_ERROR_NOT_FOUND : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NOT_FOUND");
+    case JVMTI_ERROR_NOT_MONITOR_OWNER : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NOT_MONITOR_OWNER");
+    case JVMTI_ERROR_INTERRUPT : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INTERRUPT");
+    case JVMTI_ERROR_UNMODIFIABLE_CLASS : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNMODIFIABLE_CLASS");
+    case JVMTI_ERROR_NOT_AVAILABLE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NOT_AVAILABLE");
+    case JVMTI_ERROR_ABSENT_INFORMATION : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_ABSENT_INFORMATION");
+    case JVMTI_ERROR_INVALID_EVENT_TYPE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_EVENT_TYPE");
+    case JVMTI_ERROR_NATIVE_METHOD : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NATIVE_METHOD");
+    case JVMTI_ERROR_INVALID_THREAD : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_THREAD");
+    case JVMTI_ERROR_INVALID_FIELDID : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_FIELDID");
+    case JVMTI_ERROR_INVALID_METHODID : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_METHODID");
+    case JVMTI_ERROR_INVALID_LOCATION : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_LOCATION");
+    case JVMTI_ERROR_INVALID_OBJECT : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_OBJECT");
+    case JVMTI_ERROR_INVALID_CLASS : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_CLASS");
+    case JVMTI_ERROR_TYPE_MISMATCH : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_TYPE_MISMATCH");
+    case JVMTI_ERROR_INVALID_SLOT : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_SLOT");
+    case JVMTI_ERROR_MUST_POSSESS_CAPABILITY : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_MUST_POSSESS_CAPABILITY");
+    case JVMTI_ERROR_INVALID_THREAD_GROUP : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_THREAD_GROUP");
+    case JVMTI_ERROR_INVALID_MONITOR : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_MONITOR");
+    case JVMTI_ERROR_ILLEGAL_ARGUMENT : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_ILLEGAL_ARGUMENT");
+    case JVMTI_ERROR_INVALID_TYPESTATE : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_TYPESTATE");
+    case JVMTI_ERROR_UNSUPPORTED_VERSION : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_VERSION");
+    case JVMTI_ERROR_INVALID_CLASS_FORMAT : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_INVALID_CLASS_FORMAT");
+    case JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION");
+    case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED");
+    case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED");
+    case JVMTI_ERROR_FAILS_VERIFICATION : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_FAILS_VERIFICATION");
+    case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED");
+    case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED");
+    case JVMTI_ERROR_NAMES_DONT_MATCH : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_NAMES_DONT_MATCH");
+    case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED");
+    case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED : 
+        COPY_RESPONSE (name_ptr, "JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED");
+    default:
+        return JVMTI_ERROR_ILLEGAL_ARGUMENT;
+    }
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetJLocationFormat **********************************************************
+
+   This function describes the representation of jlocation used in this VM.
+
+*******************************************************************************/
+
+jvmtiError
+GetJLocationFormat (jvmtiEnv * env, jvmtiJlocationFormat * format_ptr)
+{
+    *format_ptr = JVMTI_JLOCATION_MACHINEPC;
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetSystemProperties ********************************************************
+
+   The list of VM system property keys which may be used with GetSystemProperty 
+   is returned.
+
+*******************************************************************************/
+
+jvmtiError
+GetSystemProperties (jvmtiEnv * env, jint * count_ptr, char ***property_ptr)
+{
+    jmethodID mid;
+    jmethodID moremid;
+    classinfo *sysclass, *propclass, *enumclass;
+    java_objectheader *sysprop, *keys, *obj;
+    char* ch;
+    int i;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if ((count_ptr == NULL) || (property_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    sysclass = load_class_from_sysloader(
+        utf_new_char_classname ("java/lang/System"));
+
+    if (!sysclass) throw_main_exception_exit();
+
+    mid = class_resolvemethod(sysclass, 
+                              utf_new_char("getProperties"),
+                              utf_new_char("()Ljava/util/Properties;"));
+    if (!mid) throw_main_exception_exit();
+
+
+    sysprop = asm_calljavafunction(mid, sysclass, NULL, NULL, NULL);
+    if (!sysprop) throw_main_exception_exit();
+
+    propclass = sysprop->vftbl->class;
+
+    mid = class_resolvemethod(propclass, 
+                              utf_new_char("size"),
+                              utf_new_char("()I"));
+    if (!mid) throw_main_exception_exit();
+
+    *count_ptr = 
+        JNI_JNIEnvTable.CallIntMethod(NULL, sysprop, mid);
+    *property_ptr = heap_allocate(sizeof(char*) * (*count_ptr) ,true,NULL);
+
+    mid = class_resolvemethod(propclass, 
+                              utf_new_char("keys"),
+                              utf_new_char("()Ljava/util/Enumeration;"));
+    if (!mid) throw_main_exception_exit();
+
+    keys = JNI_JNIEnvTable.CallObjectMethod(NULL, sysprop, mid);
+    enumclass = keys->vftbl->class;
+        
+    moremid = class_resolvemethod(enumclass, 
+                                  utf_new_char("hasMoreElements"),
+                                  utf_new_char("()Z"));
+    if (!moremid) throw_main_exception_exit();
+
+    mid = class_resolvemethod(propclass, 
+                              utf_new_char("nextElement"),
+                              utf_new_char("()Ljava/lang/Object;"));
+    if (!mid) throw_main_exception_exit();
+
+    i = 0;
+    while (JNI_JNIEnvTable.CallBooleanMethod(NULL,keys,(jmethodID)moremid)) {
+        obj = JNI_JNIEnvTable.CallObjectMethod(NULL, keys, mid);
+        ch = javastring_tochar(obj);
+        *property_ptr[i] = heap_allocate(sizeof(char*) * strlen (ch),true,NULL);
+        memcpy(*property_ptr[i], ch, strlen (ch));
+        MFREE(ch,char,strlen(ch)+1);
+        i++;
+    }
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* GetSystemProperty **********************************************************
+
+   Return a VM system property value given the property key.
+
+*******************************************************************************/
+
+jvmtiError
+GetSystemProperty (jvmtiEnv * env, const char *property, char **value_ptr)
+{
+    jmethodID mid;
+    classinfo *sysclass, *propclass;
+    java_objectheader *sysprop, *obj;
+    char* ch;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+
+    if ((value_ptr == NULL) || (property == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    sysclass = load_class_from_sysloader(utf_new_char("java/lang/System"));
+    if (!sysclass) throw_main_exception_exit();
+
+    mid = class_resolvemethod(sysclass, 
+                              utf_new_char("getProperties"),
+                              utf_new_char("()Ljava/util/Properties;"));
+    if (!mid) throw_main_exception_exit();
+
+    sysprop = JNI_JNIEnvTable.CallStaticObjectMethod(NULL, (jclass)sysclass, mid);
+
+    propclass = sysprop->vftbl->class;
+
+    mid = class_resolvemethod(propclass, 
+                              utf_new_char("getProperty"),
+                              utf_new_char("(Ljava/lang/String;)Ljava/lang/String;"));
+    if (!mid) throw_main_exception_exit();
+
+    obj = (java_objectheader*)JNI_JNIEnvTable.CallObjectMethod(
+        NULL, sysprop, mid, javastring_new_char(property));
+    if (!obj) return JVMTI_ERROR_NOT_AVAILABLE;
+
+    ch = javastring_tochar(obj);
+    *value_ptr = heap_allocate(sizeof(char*) * strlen (ch),true,NULL);
+    memcpy(*value_ptr, ch, strlen (ch));
+    MFREE(ch,char,strlen(ch)+1);       
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* SetSystemProperty **********************************************************
+
+   Set a VM system property value.
+
+*******************************************************************************/
+
+jvmtiError
+SetSystemProperty (jvmtiEnv * env, const char *property, const char *value)
+{
+    jmethodID mid;
+    classinfo *sysclass, *propclass;
+    java_objectheader *sysprop;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE_END;
+        
+    if (property == NULL) return JVMTI_ERROR_NULL_POINTER;
+    if (value == NULL) return JVMTI_ERROR_NOT_AVAILABLE;
+
+    sysclass = load_class_from_sysloader(utf_new_char("java/lang/System"));
+    if (!sysclass) throw_main_exception_exit();
+
+    mid = class_resolvemethod(sysclass, 
+                              utf_new_char("getProperties"),
+                              utf_new_char("()Ljava/util/Properties;"));
+    if (!mid) throw_main_exception_exit();
+
+    sysprop = JNI_JNIEnvTable.CallStaticObjectMethod(NULL, (jclass)sysclass, mid);
+
+    propclass = sysprop->vftbl->class;
+
+    mid = class_resolvemethod(propclass, 
+                              utf_new_char("setProperty"),
+                              utf_new_char("(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;"));
+    if (!mid) throw_main_exception_exit();
+
+    JNI_JNIEnvTable.CallObjectMethod(
+        NULL, sysprop, mid, javastring_new_char(property),javastring_new_char(value));
+    
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetPhase ********************************************************************
+
+   Return the current phase of VM execution
+
+*******************************************************************************/
+
+jvmtiError
+GetPhase (jvmtiEnv * env, jvmtiPhase * phase_ptr)
+{
+    if (phase_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+    
+    *phase_ptr = phase;
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetCurrentThreadCpuTimerInfo (jvmtiEnv * env, jvmtiTimerInfo * info_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetCurrentThreadCpuTime (jvmtiEnv * env, jlong * nanos_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadCpuTimerInfo (jvmtiEnv * env, jvmtiTimerInfo * info_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetThreadCpuTime (jvmtiEnv * env, jthread thread, jlong * nanos_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetTimerInfo (jvmtiEnv * env, jvmtiTimerInfo * info_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetTime ********************************************************************
+
+   Return the current value of the system timer, in nanoseconds
+
+*******************************************************************************/
+
+jvmtiError
+GetTime (jvmtiEnv * env, jlong * nanos_ptr)
+{
+    /* Note: this implementation copied directly from Japhar's, by Chris Toshok. */
+    struct timeval tp;
+    
+    if (nanos_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    if (gettimeofday (&tp, NULL) == -1)
+        JNI_JNIEnvTable.FatalError (NULL, "gettimeofday call failed.");
+    
+    *nanos_ptr = (jlong) tp.tv_sec;
+    *nanos_ptr *= 1000;
+    *nanos_ptr += (tp.tv_usec / 1000);
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetPotentialCapabilities ***************************************************
+
+   Returns the JVM TI features that can potentially be possessed by this 
+   environment at this time.
+
+*******************************************************************************/
+
+jvmtiError
+GetPotentialCapabilities (jvmtiEnv * env,
+                         jvmtiCapabilities * capabilities_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if (capabilities_ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    memcpy(capabilities_ptr, &JVMTI_Capabilities, sizeof(JVMTI_Capabilities));
+
+    return JVMTI_ERROR_NONE;
+}
+
+
+jvmtiError static capabilityerror() 
+{
+    return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
+}
+
+#define CHECK_POTENTIAL_AVAILABLE(CAN)      \
+        if ((capabilities_ptr->CAN == 1) && \
+           (JVMTI_Capabilities.CAN == 0))   \
+           return JVMTI_ERROR_NOT_AVAILABLE; 
+
+
+/* AddCapabilities ************************************************************
+
+   Set new capabilities by adding the capabilities pointed to by 
+   capabilities_ptr. All previous capabilities are retained.
+
+*******************************************************************************/
+
+jvmtiError
+AddCapabilities (jvmtiEnv * env, const jvmtiCapabilities * capabilities_ptr)
+{
+    environment* cacao_env;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((env == NULL) || (capabilities_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+    
+    cacao_env = (environment*)env;
+
+    CHECK_POTENTIAL_AVAILABLE(can_tag_objects)
+    else {
+        cacao_env->capabilities.can_tag_objects = 1;
+        env->GetTag = &GetTag;
+        env->SetTag = &SetTag;
+        env->IterateOverObjectsReachableFromObject = 
+            &IterateOverObjectsReachableFromObject;
+        env->IterateOverReachableObjects =
+            &IterateOverReachableObjects;
+        env->IterateOverHeap = &IterateOverHeap;
+        env->IterateOverInstancesOfClass = &IterateOverInstancesOfClass;
+        env->GetObjectsWithTags = &GetObjectsWithTags;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_field_modification_events)
+    else {
+        cacao_env->capabilities.can_generate_field_modification_events = 1;
+        env->SetFieldModificationWatch = &SetFieldModificationWatch;
+        env->SetEventNotificationMode = &SetEventNotificationMode;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_field_access_events)
+    else {
+        cacao_env->capabilities.can_generate_field_access_events = 1;
+        env->SetFieldAccessWatch = &SetFieldAccessWatch;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_bytecodes)
+    else {
+        cacao_env->capabilities.can_get_bytecodes  = 1;
+        env->GetBytecodes = &GetBytecodes;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_synthetic_attribute)
+    else {
+        cacao_env->capabilities.can_get_synthetic_attribute  = 1;
+        env->IsFieldSynthetic = &IsFieldSynthetic;
+        env->IsMethodSynthetic = &IsMethodSynthetic;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_owned_monitor_info)
+    else {
+        cacao_env->capabilities.can_get_owned_monitor_info  = 1;
+        env->GetOwnedMonitorInfo = &GetOwnedMonitorInfo;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_current_contended_monitor)
+    else {
+        cacao_env->capabilities.can_get_current_contended_monitor  = 1;
+        env->GetCurrentContendedMonitor = &GetCurrentContendedMonitor;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_monitor_info)
+    else {
+        cacao_env->capabilities.can_get_monitor_info  = 1;
+        env->GetObjectMonitorUsage  = &GetObjectMonitorUsage;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_pop_frame)
+    else {
+        cacao_env->capabilities.can_pop_frame  = 1;
+        env->PopFrame  = &PopFrame;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_redefine_classes)
+    else {
+        cacao_env->capabilities.can_redefine_classes  = 1;
+        env->RedefineClasses = &RedefineClasses;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_signal_thread)
+    else {
+        cacao_env->capabilities.can_signal_thread  = 1;
+        env->StopThread = &StopThread;
+        env->InterruptThread = &InterruptThread;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_source_file_name)
+    else {
+        cacao_env->capabilities.can_get_source_file_name  = 1;
+        env->GetSourceFileName = &GetSourceFileName;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_line_numbers)
+    else {
+        cacao_env->capabilities.can_get_line_numbers  = 1;
+        env->GetLineNumberTable = &GetLineNumberTable;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_source_debug_extension)
+    else {
+        cacao_env->capabilities.can_get_source_debug_extension  = 1;
+        env->GetSourceDebugExtension = &GetSourceDebugExtension;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_access_local_variables)
+    else {
+        cacao_env->capabilities.can_access_local_variables  = 1;
+        env->GetLocalObject = &GetLocalObject;
+        env->GetLocalInt = &GetLocalInt;
+        env->GetLocalLong = &GetLocalLong;
+        env->GetLocalFloat = &GetLocalFloat;
+        env->GetLocalDouble = &GetLocalDouble;
+        env->SetLocalObject = &SetLocalObject;
+        env->SetLocalInt = &SetLocalInt;
+        env->SetLocalLong = &SetLocalLong;
+        env->SetLocalFloat = &SetLocalFloat;
+        env->SetLocalDouble = &SetLocalDouble;
+        env->GetLocalVariableTable = &GetLocalVariableTable;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_maintain_original_method_order)
+    else {
+        cacao_env->capabilities.can_maintain_original_method_order  = 1;
+        env->GetClassMethods  = &GetClassMethods;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_single_step_events)
+    else {
+        cacao_env->capabilities.can_generate_single_step_events  = 1;
+        env->SetEventNotificationMode = &SetEventNotificationMode;
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_exception_events)
+    else {
+        cacao_env->capabilities.can_generate_exception_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_frame_pop_events)
+    else {
+        cacao_env->capabilities.can_generate_frame_pop_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_breakpoint_events)
+    else {
+        cacao_env->capabilities.can_generate_breakpoint_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_suspend)
+    else {
+        cacao_env->capabilities.can_suspend  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_redefine_any_class)
+    else {
+        cacao_env->capabilities.can_redefine_any_class  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_current_thread_cpu_time)
+    else {
+        cacao_env->capabilities.can_get_current_thread_cpu_time  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_get_thread_cpu_time)
+    else {
+        cacao_env->capabilities.can_get_thread_cpu_time  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_method_entry_events)
+    else {
+        cacao_env->capabilities.can_generate_method_entry_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_method_exit_events)
+    else {
+        cacao_env->capabilities.can_generate_method_exit_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_all_class_hook_events)
+    else {
+        cacao_env->capabilities.can_generate_all_class_hook_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_compiled_method_load_events)
+    else {
+        cacao_env->capabilities.can_generate_compiled_method_load_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_monitor_events)
+    else {
+        cacao_env->capabilities.can_generate_monitor_events= 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_vm_object_alloc_events)
+    else {
+        cacao_env->capabilities.can_generate_vm_object_alloc_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_native_method_bind_events)
+    else {
+        cacao_env->capabilities.can_generate_native_method_bind_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_garbage_collection_events)
+    else {
+        cacao_env->capabilities.can_generate_garbage_collection_events  = 1;
+        /* env->  = &; */
+    }
+
+    CHECK_POTENTIAL_AVAILABLE(can_generate_object_free_events)
+    else {
+        cacao_env->capabilities.can_generate_object_free_events  = 1;
+        /* env->  = &; */
+    }
+    
+    return JVMTI_ERROR_NONE;    
+}
+
+/* RelinquishCapabilities *****************************************************
+
+   Relinquish the capabilities pointed to by capabilities_ptr.
+
+*******************************************************************************/
+
+jvmtiError
+RelinquishCapabilities (jvmtiEnv * env,
+                       const jvmtiCapabilities * capabilities_ptr)
+{
+    environment* cacao_env;
+    
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    if ((env == NULL) || (capabilities_ptr == NULL)) 
+        return JVMTI_ERROR_NULL_POINTER;
+
+    cacao_env = (environment*)env;
+    
+    if (capabilities_ptr->can_tag_objects == 1) {
+        cacao_env->capabilities.can_tag_objects = 0;
+        env->GetTag = &capabilityerror;
+        env->SetTag = &capabilityerror;
+        env->IterateOverObjectsReachableFromObject = &capabilityerror;
+        env->IterateOverReachableObjects = &capabilityerror;          
+        env->IterateOverHeap = &capabilityerror;
+        env->IterateOverInstancesOfClass = &capabilityerror;
+        env->GetObjectsWithTags = &capabilityerror;  
+    }
+
+/*    todo if ((capabilities_ptr->  == 1) {
+        cacao_env->capabilities.  = 0;
+        env->SetFieldModificationWatch = &capabilityerror;
+        }*/
+
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* *****************************************************************************
+
+   
+
+*******************************************************************************/
+
+jvmtiError
+GetAvailableProcessors (jvmtiEnv * env, jint * processor_count_ptr)
+{
+      CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+  log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetEnvironmentLocalStorage **************************************************
+
+   Called by the agent to get the value of the JVM TI environment-local storage.
+
+*******************************************************************************/
+
+jvmtiError
+GetEnvironmentLocalStorage (jvmtiEnv * env, void **data_ptr)
+{
+    if ((env == NULL) || (data_ptr == NULL)) return JVMTI_ERROR_NULL_POINTER;
+
+    *data_ptr = ((environment*)env)->EnvironmentLocalStorage;
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* SetEnvironmentLocalStorage **************************************************
+
+   The VM stores a pointer value associated with each environment. Agents can 
+   allocate memory in which they store environment specific information.
+
+*******************************************************************************/
+
+jvmtiError
+SetEnvironmentLocalStorage (jvmtiEnv * env, const void *data)
+{
+    if (env == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    ((environment*)env)->EnvironmentLocalStorage = data;
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* AddToBootstrapClassLoaderSearch ********************************************
+
+   After the bootstrap class loader unsuccessfully searches for a class, the 
+   specified platform-dependent search path segment will be searched as well.
+
+*******************************************************************************/
+
+jvmtiError
+AddToBootstrapClassLoaderSearch (jvmtiEnv * env, const char *segment)
+{
+    char* tmp_bcp;
+    int ln;
+
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_ONLOAD)
+    CHECK_PHASE_END;
+
+    if (segment == NULL) return JVMTI_ERROR_NULL_POINTER;
+
+    ln = strlen(bootclasspath) + strlen(":") + strlen(segment);
+    tmp_bcp = MNEW(char, ln);
+    strcat(tmp_bcp, bootclasspath);
+    strcat(tmp_bcp, ":");
+    strcat(tmp_bcp, segment);
+    MFREE(bootclasspath,char,ln);
+    bootclasspath = tmp_bcp;
+
+    return JVMTI_ERROR_NONE;
+}
+
+/* SetVerboseFlag *************************************************************
+
+   Control verbose output. This is the output which typically is sent to stderr
+
+*******************************************************************************/
+
+jvmtiError
+SetVerboseFlag (jvmtiEnv * env, jvmtiVerboseFlag flag, jboolean value)
+{
+    switch (flag) {
+    case JVMTI_VERBOSE_OTHER: 
+        runverbose = value;
+        break;
+    case JVMTI_VERBOSE_GC: 
+        opt_verbosegc = value;
+        break;
+    case JVMTI_VERBOSE_CLASS: 
+        loadverbose = value;
+        break;
+    case JVMTI_VERBOSE_JNI: 
+        break;
+    default:
+        return JVMTI_ERROR_ILLEGAL_ARGUMENT;            
+    }
+    return JVMTI_ERROR_NONE;
+}
+
+/* GetObjectSize **************************************************************
+
+   For the object indicated by object, return the size of the object. This size 
+   is an implementation-specific approximation of the amount of storage consumed 
+   by this object.
+
+*******************************************************************************/
+
+jvmtiError
+GetObjectSize (jvmtiEnv * env, jobject object, jlong * size_ptr)
+{
+    CHECK_PHASE_START
+    CHECK_PHASE(JVMTI_PHASE_START)
+    CHECK_PHASE(JVMTI_PHASE_LIVE)
+    CHECK_PHASE_END;
+        
+    log_text ("JVMTI-Call: IMPLEMENT ME!!!");
+    return JVMTI_ERROR_NONE;
+}
+
+
+/* *****************************************************************************
+
+   Environment variables
+
+*******************************************************************************/
+
+jvmtiCapabilities JVMTI_Capabilities = {
+  0,                           /* can_tag_objects */
+  0,                           /* can_generate_field_modification_events */
+  0,                           /* can_generate_field_access_events */
+  1,                           /* can_get_bytecodes */
+  0,                           /* can_get_synthetic_attribute */
+  0,                           /* can_get_owned_monitor_info */
+  0,                           /* can_get_current_contended_monitor */
+  0,                           /* can_get_monitor_info */
+  0,                           /* can_pop_frame */
+  0,                           /* can_redefine_classes */
+  0,                           /* can_signal_thread */
+  1,                           /* can_get_source_file_name */
+  1,                           /* can_get_line_numbers */
+  0,                           /* can_get_source_debug_extension */
+  0,                           /* can_access_local_variables */
+  0,                           /* can_maintain_original_method_order */
+  0,                           /* can_generate_single_step_events */
+  0,                           /* can_generate_exception_events */
+  0,                           /* can_generate_frame_pop_events */
+  0,                           /* can_generate_breakpoint_events */
+  0,                           /* can_suspend */
+  0,                           /* can_redefine_any_class */
+  0,                           /* can_get_current_thread_cpu_time */
+  0,                           /* can_get_thread_cpu_time */
+  0,                           /* can_generate_method_entry_events */
+  0,                           /* can_generate_method_exit_events */
+  0,                           /* can_generate_all_class_hook_events */
+  0,                           /* can_generate_compiled_method_load_events */
+  0,                           /* can_generate_monitor_events */
+  0,                           /* can_generate_vm_object_alloc_events */
+  0,                           /* can_generate_native_method_bind_events */
+  0,                           /* can_generate_garbage_collection_events */
+  0,                           /* can_generate_object_free_events */
+};
+
+jvmtiEnv JVMTI_EnvTable = {
+    NULL,
+    &SetEventNotificationMode,
+    NULL,
+    &GetAllThreads,
+    &SuspendThread,
+    &ResumeThread,
+    &StopThread,
+    &InterruptThread,
+    &GetThreadInfo,
+    &GetOwnedMonitorInfo,
+    &GetCurrentContendedMonitor,
+    &RunAgentThread,
+    &GetTopThreadGroups,
+    &GetThreadGroupInfo,
+    &GetThreadGroupChildren,
+    &GetFrameCount,
+    &GetThreadState,
+    NULL,
+    &GetFrameLocation,
+    &NotifyFramePop,
+    &GetLocalObject,
+    &GetLocalInt,
+    &GetLocalLong,
+    &GetLocalFloat,
+    &GetLocalDouble,
+    &SetLocalObject,
+    &SetLocalInt,
+    &SetLocalLong,
+    &SetLocalFloat,
+    &SetLocalDouble,
+    &CreateRawMonitor,
+    &DestroyRawMonitor,
+    &RawMonitorEnter,
+    &RawMonitorExit,
+    &RawMonitorWait,
+    &RawMonitorNotify,
+    &RawMonitorNotifyAll,
+    &SetBreakpoint,
+    &ClearBreakpoint,
+    NULL,
+    &SetFieldAccessWatch,
+    &ClearFieldAccessWatch,
+    &SetFieldModificationWatch,
+    &ClearFieldModificationWatch,
+    NULL,
+    &Allocate,
+    &Deallocate,
+    &GetClassSignature,
+    &GetClassStatus,
+    &GetSourceFileName,
+    &GetClassModifiers,
+    &GetClassMethods,
+    &GetClassFields,
+    &GetImplementedInterfaces,
+    &IsInterface,
+    &IsArrayClass,
+    &GetClassLoader, 
+    &GetObjectHashCode, 
+    &GetObjectMonitorUsage, 
+    &GetFieldName, 
+    &GetFieldDeclaringClass, 
+    &GetFieldModifiers, 
+    &IsFieldSynthetic, 
+    &GetMethodName, 
+    &GetMethodDeclaringClass, 
+    &GetMethodModifiers, 
+    NULL,
+    &GetMaxLocals, 
+    &GetArgumentsSize, 
+    &GetLineNumberTable, 
+    &GetMethodLocation, 
+    &GetLocalVariableTable, 
+    NULL,
+    NULL,
+    &GetBytecodes, 
+    &IsMethodNative, 
+    &IsMethodSynthetic, 
+    &GetLoadedClasses, 
+    &GetClassLoaderClasses, 
+    &PopFrame, 
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    &RedefineClasses, 
+    &GetVersionNumber, 
+    &GetCapabilities, 
+    &GetSourceDebugExtension, 
+    &IsMethodObsolete, 
+    &SuspendThreadList, 
+    &ResumeThreadList, 
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    &GetAllStackTraces, 
+    &GetThreadListStackTraces, 
+    &GetThreadLocalStorage, 
+    &SetThreadLocalStorage, 
+    &GetStackTrace, 
+    NULL,
+    &GetTag, 
+    &SetTag, 
+    &ForceGarbageCollection,
+    &IterateOverObjectsReachableFromObject, 
+    &IterateOverReachableObjects, 
+    &IterateOverHeap, 
+    &IterateOverInstancesOfClass, 
+    NULL,
+    &GetObjectsWithTags, 
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    &SetJNIFunctionTable, 
+    &GetJNIFunctionTable, 
+    &SetEventCallbacks, 
+    &GenerateEvents, 
+    &GetExtensionFunctions, 
+    &GetExtensionEvents, 
+    &SetExtensionEventCallback, 
+    &DisposeEnvironment,
+    &GetErrorName, 
+    &GetJLocationFormat, 
+    &GetSystemProperties, 
+    &GetSystemProperty, 
+    &SetSystemProperty, 
+    &GetPhase, 
+    &GetCurrentThreadCpuTimerInfo, 
+    &GetCurrentThreadCpuTime, 
+    &GetThreadCpuTimerInfo, 
+    &GetThreadCpuTime, 
+    &GetTimerInfo, 
+    &GetTime, 
+    &GetPotentialCapabilities, 
+    NULL,
+    &AddCapabilities,
+    &RelinquishCapabilities,
+    &GetAvailableProcessors,
+    NULL,
+    NULL,
+    &GetEnvironmentLocalStorage,
+    &SetEnvironmentLocalStorage,
+    &AddToBootstrapClassLoaderSearch,
+    &SetVerboseFlag,
+    NULL,
+    NULL,
+    NULL,
+    &GetObjectSize
+};
+
+void jvmti_init() {
+    ihmclass = load_class_from_sysloader(
+        utf_new_char_classname ("java/util/IdentityHashMap"));
+    if (ihmclass == NULL) {
+        log_text("JVMTI-Init: unable to find java.util.IdentityHashMap");
+    }
+    
+    ihmmid = class_resolvemethod(ihmclass, 
+                            utf_new_char("<init>"), 
+                            utf_new_char("()V"));
+    if (ihmmid == NULL) {
+        log_text("JVMTI-Init: unable to find constructor in java.util.IdentityHashMap");
+    }
+}
+
+void set_jvmti_phase(jvmtiPhase p) {
+    phase = p;
+    switch (p) {
+    case JVMTI_PHASE_ONLOAD:
+        /* todo */
+        break;
+    case JVMTI_PHASE_PRIMORDIAL:
+        /* todo */
+        break;
+    case JVMTI_PHASE_START: 
+        /* todo: send VM Start Event*/
+        break;
+    case JVMTI_PHASE_LIVE: 
+        /* todo: send VMInit Event */
+        break;
+    case JVMTI_PHASE_DEAD:
+        /* todo: send VMDeath Event */
+        break;
+    }
+}
+
+jvmtiEnv* new_jvmtienv() {
+    environment* env;
+    java_objectheader *o;
+
+    env = heap_allocate(sizeof(environment),true,NULL);
+    memcpy(&(env->env),&JVMTI_EnvTable,sizeof(jvmtiEnv));
+    env->events = (jobject*)builtin_new(ihmclass);
+    asm_calljavafunction(ihmmid, o, NULL, NULL, NULL);
+    /* To possess a capability, the agent must add the capability.*/
+    memset(&(env->capabilities), 1, sizeof(jvmtiCapabilities));
+    RelinquishCapabilities(&(env->env),&(env->capabilities));
+    env->EnvironmentLocalStorage = NULL;
+    return &(env->env);
+}
diff --git a/src/native/jvmti/jvmti.h b/src/native/jvmti/jvmti.h
new file mode 100644 (file)
index 0000000..4d9ac59
--- /dev/null
@@ -0,0 +1,1120 @@
+#ifndef JVMTI_H
+#define JVMTI_H
+
+#include "native/jni.h"
+
+#define JVMTI_VERSION_1_0 0x30010000
+
+typedef jobject jthread;
+typedef jobject jthreadGroup;
+typedef jlong jlocation;
+struct _jrawMonitorID;
+typedef struct _jrawMonitorID *jrawMonitorID;
+typedef struct jvmtiEnv_struct jvmtiEnv;
+
+typedef enum {
+    JVMTI_ERROR_NONE = 0, /* No error has occurred. This is the error code that is 
+                             returned on successful completion of the function. */
+    JVMTI_ERROR_NULL_POINTER = 100, /*  Pointer is unexpectedly NULL. */
+    JVMTI_ERROR_OUT_OF_MEMORY = 110, /*  The function attempted to allocate memory 
+                                         and no more memory was available for 
+                                         allocation. */
+    JVMTI_ERROR_ACCESS_DENIED = 111, /*  The desired functionality has not been 
+                                         enabled in this virtual machine. */
+    JVMTI_ERROR_UNATTACHED_THREAD = 115, /* The thread being used to call this 
+                                            function is not attached to the virtual 
+                                            machine. Calls must be made from attached threads. 
+                                            See AttachCurrentThread in the JNI invocation API. */
+    JVMTI_ERROR_INVALID_ENVIRONMENT = 116, /*  
+                                               The JVM TI environment provided is no longer connected or is not an environment. */
+    JVMTI_ERROR_WRONG_PHASE = 112, /*  
+                                       The desired functionality is not available in the current phase. Always returned if the virtual machine has completed running. */
+    JVMTI_ERROR_INTERNAL = 113, /*  
+                                    An unexpected internal error has occurred. */
+
+/* ****** Function Specific Required Errors ********** */
+    JVMTI_ERROR_INVALID_PRIORITY = 12, /*  
+                                           Invalid priority. */
+    JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13, /*  
+                                               Thread was not suspended. */
+    JVMTI_ERROR_THREAD_SUSPENDED = 14, /*  
+                                           Thread already suspended. */
+    JVMTI_ERROR_THREAD_NOT_ALIVE = 15, /*  
+                                           This operation requires the thread to be alive--that is, it must be started and not yet have died. */
+    JVMTI_ERROR_CLASS_NOT_PREPARED = 22, /*  
+                                             The class has been loaded but not yet prepared. */
+    JVMTI_ERROR_NO_MORE_FRAMES = 31, /*  
+                                         There are no Java programming language or JNI stack frames at the specified depth. */
+    JVMTI_ERROR_OPAQUE_FRAME = 32, /*  
+                                       Information about the frame is not available = e.g. for native frames, */
+    JVMTI_ERROR_DUPLICATE = 40, /*  
+                                    Item already set. */
+    JVMTI_ERROR_NOT_FOUND = 41, /*  
+                                    Desired element = e.g. field or breakpoint, not found */
+    JVMTI_ERROR_NOT_MONITOR_OWNER = 51, /*  
+                                            This thread doesn't own the raw monitor. */
+    JVMTI_ERROR_INTERRUPT = 52, /*  
+                                    The call has been interrupted before completion. */
+    JVMTI_ERROR_UNMODIFIABLE_CLASS = 79, /*  
+                                             The class cannot be modified. */
+    JVMTI_ERROR_NOT_AVAILABLE = 98, /*  
+                                        The functionality is not available in this virtual machine. */
+    JVMTI_ERROR_ABSENT_INFORMATION = 101, /*  
+                                              The requested information is not available. */
+    JVMTI_ERROR_INVALID_EVENT_TYPE = 102, /*  
+                                              The specified event type ID is not recognized. */
+    JVMTI_ERROR_NATIVE_METHOD = 104, /*  
+                                         The requested information is not available for native method. 
+                                         Function Specific Agent Errors
+                                         The following errors are returned by some JVM TI functions. They are returned in the event of invalid parameters passed by the agent or usage in an invalid context. An implementation is not required to detect these errors. */
+    JVMTI_ERROR_INVALID_THREAD = 10, /*  
+                                         The passed thread is not a valid thread.*/ 
+    JVMTI_ERROR_INVALID_FIELDID = 25, /*  
+                                          Invalid field. */
+    JVMTI_ERROR_INVALID_METHODID = 23, /*  
+                                           Invalid method. */
+    JVMTI_ERROR_INVALID_LOCATION = 24, /*  
+                                           Invalid location. */
+    JVMTI_ERROR_INVALID_OBJECT = 20, /*  
+                                         Invalid object. */
+    JVMTI_ERROR_INVALID_CLASS = 21, /*  
+                                        Invalid class. */
+    JVMTI_ERROR_TYPE_MISMATCH = 34, /*  
+                                        The variable is not an appropriate type for the function used. */
+    JVMTI_ERROR_INVALID_SLOT = 35, /*  
+                                       Invalid slot. */
+    JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99, /*  
+                                                  The capability being used is false in this environment. */
+    JVMTI_ERROR_INVALID_THREAD_GROUP = 11, /*  
+                                               Thread group invalid. */
+    JVMTI_ERROR_INVALID_MONITOR = 50, /*  
+                                          Invalid raw monitor. */
+    JVMTI_ERROR_ILLEGAL_ARGUMENT = 103, /*  
+                                            Illegal argument. */
+    JVMTI_ERROR_INVALID_TYPESTATE = 65, /*  
+                                            The state of the thread has been modified, and is now inconsistent. */
+    JVMTI_ERROR_UNSUPPORTED_VERSION = 68, /*  
+                                              A new class file has a version number not supported by this VM. */
+    JVMTI_ERROR_INVALID_CLASS_FORMAT = 60, /*  
+                                               A new class file is malformed = the VM would return a ClassFormatError, */
+    JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61, /*  
+                                                    The new class file definitions would lead to a circular definition = the VM would return a ClassCircularityError, */ 
+    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63, /*  
+                                                                A new class file would require adding a method. */
+    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64, /*  
+                                                                  A new class version changes a field. */
+    JVMTI_ERROR_FAILS_VERIFICATION = 62, /*  
+                                             The class bytes fail verification. */
+    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66, /*  
+                                                                     A direct superclass is different for the new class version, or the set of directly implemented interfaces is different. */
+    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67, /*  
+                                                                  A new class version does not declare a method declared in the old class version. */
+    JVMTI_ERROR_NAMES_DONT_MATCH = 69, /*  
+                                           The class name defined in the new class file is different from the name in the old class object. */
+    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70, /*  
+                                                                           A new class version has different modifiers. */
+    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71 /*  
+                                                                           A method in the new class version has different modifiers than its counterpart in the old class version.*/
+
+} jvmtiError;
+
+
+typedef enum {
+    JVMTI_PHASE_ONLOAD = 1,
+    JVMTI_PHASE_PRIMORDIAL = 2,
+    JVMTI_PHASE_START = 6,
+    JVMTI_PHASE_LIVE = 4,
+    JVMTI_PHASE_DEAD = 8
+} jvmtiPhase;
+
+
+typedef enum {
+    JVMTI_JLOCATION_JVMBCI = 1,
+    JVMTI_JLOCATION_MACHINEPC = 2,
+    JVMTI_JLOCATION_OTHER = 0
+} jvmtiJlocationFormat;
+
+typedef struct {
+    jlocation start_location;
+    jint line_number;
+} jvmtiLineNumberEntry;
+
+typedef struct {
+    char* name;
+    jint priority;
+    jboolean is_daemon;
+    jthreadGroup thread_group;
+    jobject context_class_loader;
+} jvmtiThreadInfo;
+
+typedef enum {
+    JVMTI_VERBOSE_OTHER = 0,
+    JVMTI_VERBOSE_GC = 1,
+    JVMTI_VERBOSE_CLASS = 2,
+    JVMTI_VERBOSE_JNI = 4
+} jvmtiVerboseFlag;
+
+typedef struct {
+    jclass klass;
+    jint class_byte_count;
+    const unsigned char* class_bytes;
+} jvmtiClassDefinition;
+
+typedef struct JNINativeInterface jniNativeInterface;
+
+typedef struct {
+    const void* start_address;
+    jlocation location;
+} jvmtiAddrLocationMap;
+
+
+typedef void (JNICALL *jvmtiEventSingleStep) 
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jlocation location);
+
+typedef void (JNICALL *jvmtiEventBreakpoint)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jlocation location);
+
+typedef void (JNICALL *jvmtiEventFieldAccess)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jlocation location,
+     jclass field_klass,
+     jobject object,
+     jfieldID field);
+
+typedef void (JNICALL *jvmtiEventFieldModification)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jlocation location,
+     jclass field_klass,
+     jobject object,
+     jfieldID field,
+     char signature_type,
+     jvalue new_value);
+
+typedef void (JNICALL *jvmtiEventFramePop)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jboolean was_popped_by_exception);
+
+typedef void (JNICALL *jvmtiEventMethodEntry)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method);
+
+typedef void (JNICALL *jvmtiEventMethodExit)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jboolean was_popped_by_exception,
+     jvalue return_value);
+
+typedef void (JNICALL *jvmtiEventNativeMethodBind)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     void* address,
+     void** new_address_ptr);
+
+typedef void (JNICALL *jvmtiEventException)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jlocation location,
+     jobject exception,
+     jmethodID catch_method,
+     jlocation catch_location);
+
+typedef void (JNICALL *jvmtiEventExceptionCatch)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jmethodID method,
+     jlocation location,
+     jobject exception);
+
+typedef void (JNICALL *jvmtiEventThreadStart)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread);
+
+typedef void (JNICALL *jvmtiEventThreadEnd)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread);
+
+typedef void (JNICALL *jvmtiEventClassLoad)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jclass klass);
+
+typedef void (JNICALL *jvmtiEventClassPrepare)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jclass klass);
+
+typedef void (JNICALL *jvmtiEventClassFileLoadHook)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jclass class_being_redefined,
+     jobject loader,
+     const char* name,
+     jobject protection_domain,
+     jint class_data_len,
+     const unsigned char* class_data,
+     jint* new_class_data_len,
+     unsigned char** new_class_data);
+
+typedef void (JNICALL *jvmtiEventVMStart)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env);
+
+typedef void (JNICALL *jvmtiEventVMInit)
+    (jvmtiEnv *jvmti_env, 
+     JNIEnv* jni_env,
+     jthread thread);
+
+typedef void (JNICALL *jvmtiEventVMDeath)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env);
+
+
+typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
+    (jvmtiEnv *jvmti_env,
+     jmethodID method,
+     jint code_size,
+     const void* code_addr,
+     jint map_length,
+     const jvmtiAddrLocationMap* map,
+     const void* compile_info);
+
+typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
+    (jvmtiEnv *jvmti_env,
+     jmethodID method,
+     const void* code_addr);
+
+typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
+    (jvmtiEnv *jvmti_env,
+     const char* name,
+     const void* address,
+     jint length);
+
+typedef void (JNICALL *jvmtiEventDataDumpRequest)
+    (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jobject object);
+
+typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jobject object);
+
+typedef void (JNICALL *jvmtiEventMonitorWait)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jobject object,
+     jlong timeout);
+
+typedef void (JNICALL *jvmtiEventMonitorWaited)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jobject object,
+     jboolean timed_out);
+
+typedef void (JNICALL *jvmtiEventVMObjectAlloc)
+    (jvmtiEnv *jvmti_env,
+     JNIEnv* jni_env,
+     jthread thread,
+     jobject object,
+     jclass object_klass,
+     jlong size);
+
+typedef void (JNICALL *jvmtiEventObjectFree)
+    (jvmtiEnv *jvmti_env,
+     jlong tag);
+
+typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
+    (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
+    (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiStartFunction)
+    (jvmtiEnv* jvmti_env, 
+     JNIEnv* jni_env, 
+     void* arg);
+
+typedef struct {
+    jthreadGroup parent;
+    char* name;
+    jint max_priority;
+    jboolean is_daemon;
+} jvmtiThreadGroupInfo;
+
+typedef struct {
+    jthread owner;
+    jint entry_count;
+    jint waiter_count;
+    jthread* waiters;
+    jint notify_waiter_count;
+    jthread* notify_waiters;
+} jvmtiMonitorUsage;
+
+typedef struct {
+    jlocation start_location;
+    jint length;
+    char* name;
+    char* signature;
+    char* generic_signature;
+    jint slot;
+} jvmtiLocalVariableEntry;
+
+typedef struct {
+    jmethodID method;
+    jlocation location;
+} jvmtiFrameInfo;
+
+typedef struct {
+    jthread thread;
+    jint state;
+    jvmtiFrameInfo* frame_buffer;
+    jint frame_count;
+} jvmtiStackInfo;
+
+typedef enum {
+    JVMTI_HEAP_OBJECT_TAGGED = 1,
+    JVMTI_HEAP_OBJECT_UNTAGGED = 2,
+    JVMTI_HEAP_OBJECT_EITHER = 3
+} jvmtiHeapObjectFilter;
+
+typedef enum {
+    JVMTI_REFERENCE_CLASS = 1,
+    JVMTI_REFERENCE_FIELD = 2,
+    JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
+    JVMTI_REFERENCE_CLASS_LOADER = 4,
+    JVMTI_REFERENCE_SIGNERS = 5,
+    JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
+    JVMTI_REFERENCE_INTERFACE = 7,
+    JVMTI_REFERENCE_STATIC_FIELD = 8,
+    JVMTI_REFERENCE_CONSTANT_POOL = 9
+} jvmtiObjectReferenceKind;
+
+typedef enum {
+    JVMTI_ITERATION_CONTINUE = 1,
+    JVMTI_ITERATION_IGNORE = 2,
+    JVMTI_ITERATION_ABORT = 0
+} jvmtiIterationControl;
+
+typedef enum {
+    JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
+    JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
+    JVMTI_HEAP_ROOT_MONITOR = 3,
+    JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
+    JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
+    JVMTI_HEAP_ROOT_THREAD = 6,
+    JVMTI_HEAP_ROOT_OTHER = 7
+} jvmtiHeapRootKind;
+
+typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
+    (jvmtiObjectReferenceKind reference_kind, 
+     jlong class_tag, 
+     jlong size, 
+     jlong* tag_ptr, 
+     jlong referrer_tag, 
+     jint referrer_index, 
+     void* user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
+    (jvmtiHeapRootKind root_kind, 
+     jlong class_tag, 
+     jlong size, 
+     jlong* tag_ptr, 
+     void* user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
+    (jvmtiHeapRootKind root_kind, 
+     jlong class_tag, 
+     jlong size, 
+     jlong* tag_ptr, 
+     jlong thread_tag, 
+     jint depth, 
+     jmethodID method, 
+     jint slot, 
+     void* user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
+    (jlong class_tag, 
+     jlong size, 
+     jlong* tag_ptr, 
+     void* user_data);
+
+typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
+    (jvmtiEnv* jvmti_env, 
+      ...);
+
+typedef enum {
+    JVMTI_KIND_IN = 91,
+    JVMTI_KIND_IN_PTR = 92,
+    JVMTI_KIND_IN_BUF = 93,
+    JVMTI_KIND_ALLOC_BUF = 94,
+    JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
+    JVMTI_KIND_OUT = 96,
+    JVMTI_KIND_OUT_BUF = 97
+} jvmtiParamKind;
+
+typedef enum {
+    JVMTI_TYPE_JBYTE = 101,
+    JVMTI_TYPE_JCHAR = 102,
+    JVMTI_TYPE_JSHORT = 103,
+    JVMTI_TYPE_JINT = 104,
+    JVMTI_TYPE_JLONG = 105,
+    JVMTI_TYPE_JFLOAT = 106,
+    JVMTI_TYPE_JDOUBLE = 107,
+    JVMTI_TYPE_JBOOLEAN = 108,
+    JVMTI_TYPE_JOBJECT = 109,
+    JVMTI_TYPE_JTHREAD = 110,
+    JVMTI_TYPE_JCLASS = 111,
+    JVMTI_TYPE_JVALUE = 112,
+    JVMTI_TYPE_JFIELDID = 113,
+    JVMTI_TYPE_JMETHODID = 114,
+    JVMTI_TYPE_CCHAR = 115,   
+    JVMTI_TYPE_CVOID = 116,
+    JVMTI_TYPE_JNIENV = 117
+} jvmtiParamTypes;
+
+typedef struct {
+    char* name;
+    jvmtiParamKind kind;
+    jvmtiParamTypes base_type;
+    jboolean null_ok;
+} jvmtiParamInfo;
+
+typedef struct {
+    jint extension_event_index;
+    char* id;
+    char* short_description;
+    jint param_count;
+    jvmtiParamInfo* params;
+} jvmtiExtensionEventInfo;
+
+typedef void (JNICALL *jvmtiExtensionEvent)
+    (jvmtiEnv* jvmti_env, 
+      ...);
+
+typedef enum {
+    JVMTI_TIMER_USER_CPU = 30,
+    JVMTI_TIMER_TOTAL_CPU = 31,
+    JVMTI_TIMER_ELAPSED = 32
+} jvmtiTimerKind;
+
+typedef struct {
+    jlong max_value;
+    jboolean may_skip_forward;
+    jboolean may_skip_backward;
+    jvmtiTimerKind kind;
+    jlong reserved1;
+    jlong reserved2;
+} jvmtiTimerInfo;
+
+typedef struct {
+    jvmtiExtensionFunction func;
+    char* id;
+    char* short_description;
+    jint param_count;
+    jvmtiParamInfo* params;
+    jint error_count;
+    jvmtiError* errors;
+} jvmtiExtensionFunctionInfo;
+
+typedef void* jvmtiEventReserved;
+
+typedef struct {
+    jvmtiEventVMInit VMInit;
+    jvmtiEventVMDeath VMDeath;
+    jvmtiEventThreadStart ThreadStart;
+    jvmtiEventThreadEnd ThreadEnd;
+    jvmtiEventClassFileLoadHook ClassFileLoadHook;
+    jvmtiEventClassLoad ClassLoad;
+    jvmtiEventClassPrepare ClassPrepare;
+    jvmtiEventVMStart VMStart;
+    jvmtiEventException Exception;
+    jvmtiEventExceptionCatch ExceptionCatch;
+    jvmtiEventSingleStep SingleStep;
+    jvmtiEventFramePop FramePop;
+    jvmtiEventBreakpoint Breakpoint;
+    jvmtiEventFieldAccess FieldAccess;
+    jvmtiEventFieldModification FieldModification;
+    jvmtiEventMethodEntry MethodEntry;
+    jvmtiEventMethodExit MethodExit;
+    jvmtiEventNativeMethodBind NativeMethodBind;
+    jvmtiEventCompiledMethodLoad CompiledMethodLoad;
+    jvmtiEventCompiledMethodUnload CompiledMethodUnload;
+    jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
+    jvmtiEventDataDumpRequest DataDumpRequest;
+    jvmtiEventReserved reserved72;
+    jvmtiEventMonitorWait MonitorWait;
+    jvmtiEventMonitorWaited MonitorWaited;
+    jvmtiEventMonitorContendedEnter MonitorContendedEnter;
+    jvmtiEventMonitorContendedEntered MonitorContendedEntered;
+    jvmtiEventReserved reserved77;
+    jvmtiEventReserved reserved78;
+    jvmtiEventReserved reserved79;
+    jvmtiEventReserved reserved80;
+    jvmtiEventGarbageCollectionStart GarbageCollectionStart;
+    jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
+    jvmtiEventObjectFree ObjectFree;
+    jvmtiEventVMObjectAlloc VMObjectAlloc;
+} jvmtiEventCallbacks;
+
+typedef enum {
+    JVMTI_ENABLE = 1,
+    JVMTI_DISABLE = 0
+} jvmtiEventMode;
+
+typedef enum {
+    JVMTI_MIN_EVENT_TYPE_VAL = 50,
+    JVMTI_EVENT_VM_INIT = 50,
+    JVMTI_EVENT_VM_DEATH = 51,
+    JVMTI_EVENT_THREAD_START = 52,
+    JVMTI_EVENT_THREAD_END = 53,
+    JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
+    JVMTI_EVENT_CLASS_LOAD = 55,
+    JVMTI_EVENT_CLASS_PREPARE = 56,
+    JVMTI_EVENT_VM_START = 57,
+    JVMTI_EVENT_EXCEPTION = 58,
+    JVMTI_EVENT_EXCEPTION_CATCH = 59,
+    JVMTI_EVENT_SINGLE_STEP = 60,
+    JVMTI_EVENT_FRAME_POP = 61,
+    JVMTI_EVENT_BREAKPOINT = 62,
+    JVMTI_EVENT_FIELD_ACCESS = 63,
+    JVMTI_EVENT_FIELD_MODIFICATION = 64,
+    JVMTI_EVENT_METHOD_ENTRY = 65,
+    JVMTI_EVENT_METHOD_EXIT = 66,
+    JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
+    JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
+    JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
+    JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
+    JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
+    JVMTI_EVENT_MONITOR_WAIT = 73,
+    JVMTI_EVENT_MONITOR_WAITED = 74,
+    JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
+    JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
+    JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
+    JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
+    JVMTI_EVENT_OBJECT_FREE = 83,
+    JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
+    JVMTI_MAX_EVENT_TYPE_VAL = 84
+} jvmtiEvent;
+
+
+typedef struct {
+    unsigned int can_tag_objects : 1;
+    unsigned int can_generate_field_modification_events : 1;
+    unsigned int can_generate_field_access_events : 1;
+    unsigned int can_get_bytecodes : 1;
+    unsigned int can_get_synthetic_attribute : 1;
+    unsigned int can_get_owned_monitor_info : 1;
+    unsigned int can_get_current_contended_monitor : 1;
+    unsigned int can_get_monitor_info : 1;
+    unsigned int can_pop_frame : 1;
+    unsigned int can_redefine_classes : 1;
+    unsigned int can_signal_thread : 1;
+    unsigned int can_get_source_file_name : 1;
+    unsigned int can_get_line_numbers : 1;
+    unsigned int can_get_source_debug_extension : 1;
+    unsigned int can_access_local_variables : 1;
+    unsigned int can_maintain_original_method_order : 1;
+    unsigned int can_generate_single_step_events : 1;
+    unsigned int can_generate_exception_events : 1;
+    unsigned int can_generate_frame_pop_events : 1;
+    unsigned int can_generate_breakpoint_events : 1;
+    unsigned int can_suspend : 1;
+    unsigned int can_redefine_any_class : 1;
+    unsigned int can_get_current_thread_cpu_time : 1;
+    unsigned int can_get_thread_cpu_time : 1;
+    unsigned int can_generate_method_entry_events : 1;
+    unsigned int can_generate_method_exit_events : 1;
+    unsigned int can_generate_all_class_hook_events : 1;
+    unsigned int can_generate_compiled_method_load_events : 1;
+    unsigned int can_generate_monitor_events : 1;
+    unsigned int can_generate_vm_object_alloc_events : 1;
+    unsigned int can_generate_native_method_bind_events : 1;
+    unsigned int can_generate_garbage_collection_events : 1;
+    unsigned int can_generate_object_free_events : 1;
+    unsigned int : 15;
+    unsigned int : 16;
+    unsigned int : 16;
+    unsigned int : 16;
+    unsigned int : 16;
+    unsigned int : 16;
+} jvmtiCapabilities;
+
+
+
+
+
+/* Function Interface */
+struct jvmtiEnv_struct {    
+    void *reserved1;
+    jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env, 
+                                                    jvmtiEventMode mode, 
+                                                    jvmtiEvent event_type, 
+                                                    jthread event_thread, 
+                                                    ...);
+    void *reserved3;
+    jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env, 
+                                         jint* threads_count_ptr, 
+                                         jthread** threads_ptr);
+    jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env, 
+                                         jthread thread);
+    jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env, 
+                                        jthread thread);
+    jvmtiError (JNICALL *StopThread) (jvmtiEnv* env, 
+                                      jthread thread, 
+                                      jobject exception);
+    jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env, 
+                                           jthread thread);
+    jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env, 
+                                         jthread thread, 
+                                         jvmtiThreadInfo* info_ptr);
+    jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env, 
+                                               jthread thread, 
+                                               jint* owned_monitor_count_ptr, 
+                                               jobject** owned_monitors_ptr);
+    jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env, 
+                                                      jthread thread, 
+                                                      jobject* monitor_ptr);
+    jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jvmtiStartFunction proc, 
+                                          const void* arg, 
+                                          jint priority);
+    jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env, 
+                                              jint* group_count_ptr, 
+                                              jthreadGroup** groups_ptr);
+    jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env, 
+                                              jthreadGroup group, 
+                                              jvmtiThreadGroupInfo* info_ptr);
+    jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env, 
+                                                  jthreadGroup group, 
+                                                  jint* thread_count_ptr, 
+                                                  jthread** threads_ptr, 
+                                                  jint* group_count_ptr, 
+                                                  jthreadGroup** groups_ptr);
+    jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env, 
+                                         jthread thread, 
+                                         jint* count_ptr);
+    jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jint* thread_state_ptr);
+    void *reserved18;
+    jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env, 
+                                            jthread thread, 
+                                            jint depth, 
+                                            jmethodID* method_ptr, 
+                                            jlocation* location_ptr);
+    jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jint depth);
+    jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jint depth, 
+                                          jint slot, 
+                                          jobject* value_ptr);
+    jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env, 
+                                       jthread thread, 
+                                       jint depth, 
+                                       jint slot, 
+                                       jint* value_ptr);
+    jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env, 
+                                        jthread thread, 
+                                        jint depth, 
+                                        jint slot, 
+                                        jlong* value_ptr);
+    jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env, 
+                                         jthread thread, 
+                                         jint depth, 
+                                         jint slot, 
+                                         jfloat* value_ptr);
+    jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jint depth, 
+                                          jint slot, 
+                                          jdouble* value_ptr);
+    jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jint depth, 
+                                          jint slot, 
+                                          jobject value);
+    jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env, 
+                                       jthread thread, 
+                                       jint depth, 
+                                       jint slot, 
+                                       jint value);
+    jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env, 
+                                        jthread thread, 
+                                        jint depth, 
+                                        jint slot, 
+                                        jlong value);
+    jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env, 
+                                         jthread thread, 
+                                         jint depth, 
+                                         jint slot, 
+                                         jfloat value);
+    jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env, 
+                                          jthread thread, 
+                                          jint depth, 
+                                          jint slot, 
+                                          jdouble value);
+    jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env, 
+                                            const char* name, 
+                                            jrawMonitorID* monitor_ptr);
+    jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env, 
+                                             jrawMonitorID monitor);
+    jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env, 
+                                           jrawMonitorID monitor);
+    jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env, 
+                                          jrawMonitorID monitor);
+    jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env, 
+                                          jrawMonitorID monitor, 
+                                          jlong millis);
+    jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env, 
+                                            jrawMonitorID monitor);
+    jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env, 
+                                               jrawMonitorID monitor);
+    jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env, 
+                                         jmethodID method, 
+                                         jlocation location);
+    jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env, 
+                                           jmethodID method, 
+                                           jlocation location);
+    void *reserved40;
+    jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env, 
+                                               jclass klass, 
+                                               jfieldID field);
+    jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env, 
+                                                 jclass klass, 
+                                                 jfieldID field);
+    jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env, 
+                                                     jclass klass, 
+                                                     jfieldID field);
+    jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env, 
+                                                       jclass klass, 
+                                                       jfieldID field);
+    void *reserved45;
+    jvmtiError (JNICALL *Allocate) (jvmtiEnv* env, 
+                                    jlong size, 
+                                    unsigned char** mem_ptr);
+    jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env, 
+                                      unsigned char* mem);
+    jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env, 
+                                             jclass klass, 
+                                             char** signature_ptr, 
+                                             char** generic_ptr);
+    jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env, 
+                                          jclass klass, 
+                                          jint* status_ptr);
+    jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env, 
+                                             jclass klass, 
+                                             char** source_name_ptr);
+    jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env, 
+                                             jclass klass, 
+                                             jint* modifiers_ptr);
+    jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env, 
+                                           jclass klass, 
+                                           jint* method_count_ptr, 
+                                           jmethodID** methods_ptr);
+    jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env, 
+                                          jclass klass, 
+                                          jint* field_count_ptr, 
+                                          jfieldID** fields_ptr);
+    jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env, 
+                                                    jclass klass, 
+                                                    jint* interface_count_ptr, 
+                                                    jclass** interfaces_ptr);
+    jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env, 
+                                       jclass klass, 
+                                       jboolean* is_interface_ptr);
+    jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env, 
+                                        jclass klass, 
+                                        jboolean* is_array_class_ptr);
+    jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env, 
+                                          jclass klass, 
+                                          jobject* classloader_ptr);
+    jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env, 
+                                             jobject object, 
+                                             jint* hash_code_ptr);
+    jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env, 
+                                                 jobject object, 
+                                                 jvmtiMonitorUsage* info_ptr);
+    jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env, 
+                                        jclass klass, 
+                                        jfieldID field, 
+                                        char** name_ptr, 
+                                        char** signature_ptr, 
+                                        char** generic_ptr);
+    jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env, 
+                                                  jclass klass, 
+                                                  jfieldID field, 
+                                                  jclass* declaring_class_ptr);
+    jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env, 
+                                             jclass klass, 
+                                             jfieldID field, 
+                                             jint* modifiers_ptr);
+    jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env, 
+                                            jclass klass, 
+                                            jfieldID field, 
+                                            jboolean* is_synthetic_ptr);
+    jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env, 
+                                         jmethodID method, 
+                                         char** name_ptr, 
+                                         char** signature_ptr, 
+                                         char** generic_ptr);
+    jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env, 
+                                                   jmethodID method, 
+                                                   jclass* declaring_class_ptr);
+    jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env, 
+                                              jmethodID method, 
+                                              jint* modifiers_ptr);
+    void *reserved67;
+    jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env, 
+                                        jmethodID method, 
+                                        jint* max_ptr);
+    jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env, 
+                                            jmethodID method, 
+                                            jint* size_ptr);
+    jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env, 
+                                              jmethodID method, 
+                                              jint* entry_count_ptr, 
+                                              jvmtiLineNumberEntry** table_ptr);
+    jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env, 
+                                             jmethodID method, 
+                                             jlocation* start_location_ptr, 
+                                             jlocation* end_location_ptr);
+    jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env, 
+                                                 jmethodID method, 
+                                                 jint* entry_count_ptr, 
+                                                 jvmtiLocalVariableEntry** table_ptr);
+    void *reserved73;
+    void *reserved74;
+    jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env, 
+                                        jmethodID method, 
+                                        jint* bytecode_count_ptr, 
+                                        unsigned char** bytecodes_ptr);
+    jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env, 
+                                          jmethodID method, 
+                                          jboolean* is_native_ptr);
+    jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env, 
+                                             jmethodID method, 
+                                             jboolean* is_synthetic_ptr);
+    jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env, 
+                                            jint* class_count_ptr, 
+                                            jclass** classes_ptr);
+    jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env, 
+                                                 jobject initiating_loader, 
+                                                 jint* class_count_ptr, 
+                                                 jclass** classes_ptr);
+    jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env, 
+                                    jthread thread);
+    void *reserved81;
+    void *reserved82;
+    void *reserved83;
+    void *reserved84;
+    void *reserved85;
+    void *reserved86;
+    jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env, 
+                                           jint class_count, 
+                                           const jvmtiClassDefinition* class_definitions);
+    jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env, 
+                                            jint* version_ptr);
+    jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env, 
+                                           jvmtiCapabilities* capabilities_ptr);
+    jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env, 
+                                                   jclass klass, 
+                                                   char** source_debug_extension_ptr);
+    jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env, 
+                                            jmethodID method, 
+                                            jboolean* is_obsolete_ptr);
+    jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env, 
+                                             jint request_count, 
+                                             const jthread* request_list, 
+                                             jvmtiError* results);
+    jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env, 
+                                            jint request_count, 
+                                            const jthread* request_list, 
+                                            jvmtiError* results);
+    void *reserved94;
+    void *reserved95;
+    void *reserved96;
+    void *reserved97;
+    void *reserved98;
+    void *reserved99;
+    jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env, 
+                                             jint max_frame_count, 
+                                             jvmtiStackInfo** stack_info_ptr, 
+                                             jint* thread_count_ptr);
+    jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env, 
+                                                    jint thread_count, 
+                                                    const jthread* thread_list, 
+                                                    jint max_frame_count, 
+                                                    jvmtiStackInfo** stack_info_ptr);
+    jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env, 
+                                                 jthread thread, 
+                                                 void** data_ptr);
+    jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env, 
+                                                 jthread thread, 
+                                                 const void* data);
+    jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env, 
+                                         jthread thread, 
+                                         jint start_depth, 
+                                         jint max_frame_count, 
+                                         jvmtiFrameInfo* frame_buffer, 
+                                         jint* count_ptr);
+    void *reserved105;
+    jvmtiError (JNICALL *GetTag) (jvmtiEnv* env, 
+                                  jobject object, 
+                                  jlong* tag_ptr);
+    jvmtiError (JNICALL *SetTag) (jvmtiEnv* env, 
+                                  jobject object, 
+                                  jlong tag);
+    jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env);
+    jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env, 
+                                                                 jobject object, 
+                                                                 jvmtiObjectReferenceCallback object_reference_callback, 
+                                                                 void* user_data);
+    jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env, 
+                                                       jvmtiHeapRootCallback heap_root_callback, 
+                                                       jvmtiStackReferenceCallback stack_ref_callback, 
+                                                       jvmtiObjectReferenceCallback object_ref_callback, 
+                                                       void* user_data);
+    jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env, 
+                                           jvmtiHeapObjectFilter object_filter, 
+                                           jvmtiHeapObjectCallback heap_object_callback, 
+                                           void* user_data);
+    jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env, 
+                                                       jclass klass, 
+                                                       jvmtiHeapObjectFilter object_filter, 
+                                                       jvmtiHeapObjectCallback heap_object_callback, 
+                                                       void* user_data);
+    void *reserved113;
+    jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env, 
+                                              jint tag_count, 
+                                              const jlong* tags, 
+                                              jint* count_ptr, 
+                                              jobject** object_result_ptr, 
+                                              jlong** tag_result_ptr);
+    void *reserved115;
+    void *reserved116;
+    void *reserved117;
+    void *reserved118;
+    void *reserved119;
+    jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env, 
+                                               const jniNativeInterface* function_table);
+    jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env, 
+                                               jniNativeInterface** function_table);
+    jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env, 
+                                             const jvmtiEventCallbacks* callbacks, 
+                                             jint size_of_callbacks);
+    jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env, 
+                                          jvmtiEvent event_type);
+    jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env, 
+                                                 jint* extension_count_ptr, 
+                                                 jvmtiExtensionFunctionInfo** extensions);
+    jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env, 
+                                              jint* extension_count_ptr, 
+                                              jvmtiExtensionEventInfo** extensions);
+    jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env, 
+                                                     jint extension_event_index, 
+                                                     jvmtiExtensionEvent callback);
+    jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env);
+    jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env, 
+                                        jvmtiError error, 
+                                        char** name_ptr);
+    jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env, 
+                                              jvmtiJlocationFormat* format_ptr);
+    jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env, 
+                                               jint* count_ptr, 
+                                               char*** property_ptr);
+    jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env, 
+                                             const char* property, 
+                                             char** value_ptr);
+    jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env, 
+                                             const char* property, 
+                                             const char* value);
+    jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env, 
+                                    jvmtiPhase* phase_ptr);
+    jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env, 
+                                                        jvmtiTimerInfo* info_ptr);
+    jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env, 
+                                                   jlong* nanos_ptr);
+    jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env, 
+                                                 jvmtiTimerInfo* info_ptr);
+    jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env, 
+                                            jthread thread, 
+                                            jlong* nanos_ptr);
+    jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env, 
+                                        jvmtiTimerInfo* info_ptr);
+    jvmtiError (JNICALL *GetTime) (jvmtiEnv* env, 
+                                   jlong* nanos_ptr);
+    jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env, 
+                                                    jvmtiCapabilities* capabilities_ptr);
+    void *reserved141;
+    jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env, 
+                                           const jvmtiCapabilities* capabilities_ptr);
+    jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env, 
+                                                  const jvmtiCapabilities* capabilities_ptr);
+    jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env, 
+                                                  jint* processor_count_ptr);
+    void *reserved145;
+    void *reserved146;
+    jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env, 
+                                                      void** data_ptr);
+    jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env, 
+                                                      const void* data);
+    jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env, 
+                                                           const char* segment);
+    jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env, 
+                                          jvmtiVerboseFlag flag, 
+                                          jboolean value);
+    void *reserved151;
+    void *reserved152;
+    void *reserved153;
+    jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env, 
+                                         jobject object, 
+                                         jlong* size_ptr);
+}; 
+
+/* cacao specific */
+jvmtiEnv* new_jvmtienv();
+void set_jvmti_phase(jvmtiPhase p);
+
+#endif
+
+
index f212f5ea1841e368f19ba8175a43ff51408e26bd..275c1f85f460c90359629b314d61f85b4dd9865f 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: threads.h 2899 2005-07-04 20:41:28Z twisti $
+   $Id: threads.h 3062 2005-07-19 10:03:00Z motse $
 
 */
 
@@ -205,6 +205,8 @@ void thread_registercritical(threadcritnode *);
 u1 *thread_checkcritical(u1*);
 
 extern volatile int stopworldwhere;
+extern threadobject *mainthreadobj;
+
 
 void cast_stopworld();
 void cast_startworld();