* Updated header: Added 2006. Changed address of FSF. Changed email
[cacao.git] / src / native / jvmti / jvmti.h
1 /* src/native/jvmti.c - implementation of the Java Virtual Machine Tool 
2                         Interface functions
3
4    Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
5    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
6    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
7    J. Wenninger, Institut f. Computersprachen - TU Wien
8
9    This file is part of CACAO.
10
11    This program is free software; you can redistribute it and/or
12    modify it under the terms of the GNU General Public License as
13    published by the Free Software Foundation; either version 2, or (at
14    your option) any later version.
15
16    This program is distributed in the hope that it will be useful, but
17    WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24    02110-1301, USA.
25
26    Contact: cacao@cacaojvm.org
27
28    Author: Martin Platter
29
30    Changes:             
31
32    
33    $Id: jvmti.h 4357 2006-01-22 23:33:38Z twisti $
34
35 */
36 #ifndef JVMTI_H
37 #define JVMTI_H
38
39 #include "native/jni.h"
40 #include "native/include/java_lang_String.h"
41 #include <sys/types.h>
42
43 #define JVMTI_VERSION_1_0 0x30010000
44
45 typedef jobject jthread;
46 typedef jobject jthreadGroup;
47 typedef jlong jlocation;
48 struct _jrawMonitorID;
49 typedef struct _jrawMonitorID *jrawMonitorID;
50 typedef struct jvmtiEnv_struct jvmtiEnv;
51
52 typedef enum {
53     JVMTI_ERROR_NONE = 0, /* No error has occurred. This is the error code that is 
54                              returned on successful completion of the function. */
55     JVMTI_ERROR_NULL_POINTER = 100, /*  Pointer is unexpectedly NULL. */
56     JVMTI_ERROR_OUT_OF_MEMORY = 110, /*  The function attempted to allocate memory 
57                                          and no more memory was available for 
58                                          allocation. */
59     JVMTI_ERROR_ACCESS_DENIED = 111, /*  The desired functionality has not been 
60                                          enabled in this virtual machine. */
61     JVMTI_ERROR_UNATTACHED_THREAD = 115, /* The thread being used to call this 
62                                             function is not attached to the virtual 
63                                             machine. Calls must be made from attached threads. 
64                                             See AttachCurrentThread in the JNI invocation API. */
65     JVMTI_ERROR_INVALID_ENVIRONMENT = 116, /*  
66                                                The JVM TI environment provided is no longer connected or is not an environment. */
67     JVMTI_ERROR_WRONG_PHASE = 112, /*  
68                                        The desired functionality is not available in the current phase. Always returned if the virtual machine has completed running. */
69     JVMTI_ERROR_INTERNAL = 113, /*  
70                                     An unexpected internal error has occurred. */
71
72 /* ****** Function Specific Required Errors ********** */
73     JVMTI_ERROR_INVALID_PRIORITY = 12, /*  
74                                            Invalid priority. */
75     JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13, /*  
76                                                Thread was not suspended. */
77     JVMTI_ERROR_THREAD_SUSPENDED = 14, /*  
78                                            Thread already suspended. */
79     JVMTI_ERROR_THREAD_NOT_ALIVE = 15, /*  
80                                            This operation requires the thread to be alive--that is, it must be started and not yet have died. */
81     JVMTI_ERROR_CLASS_NOT_PREPARED = 22, /*  
82                                              The class has been loaded but not yet prepared. */
83     JVMTI_ERROR_NO_MORE_FRAMES = 31, /*  
84                                          There are no Java programming language or JNI stack frames at the specified depth. */
85     JVMTI_ERROR_OPAQUE_FRAME = 32, /*  
86                                        Information about the frame is not available = e.g. for native frames, */
87     JVMTI_ERROR_DUPLICATE = 40, /*  
88                                     Item already set. */
89     JVMTI_ERROR_NOT_FOUND = 41, /*  
90                                     Desired element = e.g. field or breakpoint, not found */
91     JVMTI_ERROR_NOT_MONITOR_OWNER = 51, /*  
92                                             This thread doesn't own the raw monitor. */
93     JVMTI_ERROR_INTERRUPT = 52, /*  
94                                     The call has been interrupted before completion. */
95     JVMTI_ERROR_UNMODIFIABLE_CLASS = 79, /*  
96                                              The class cannot be modified. */
97     JVMTI_ERROR_NOT_AVAILABLE = 98, /*  
98                                         The functionality is not available in this virtual machine. */
99     JVMTI_ERROR_ABSENT_INFORMATION = 101, /*  
100                                               The requested information is not available. */
101     JVMTI_ERROR_INVALID_EVENT_TYPE = 102, /*  
102                                               The specified event type ID is not recognized. */
103     JVMTI_ERROR_NATIVE_METHOD = 104, /*  
104                                          The requested information is not available for native method. 
105                                          Function Specific Agent Errors
106                                          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. */
107     JVMTI_ERROR_INVALID_THREAD = 10, /*  
108                                          The passed thread is not a valid thread.*/ 
109     JVMTI_ERROR_INVALID_FIELDID = 25, /*  
110                                           Invalid field. */
111     JVMTI_ERROR_INVALID_METHODID = 23, /*  
112                                            Invalid method. */
113     JVMTI_ERROR_INVALID_LOCATION = 24, /*  
114                                            Invalid location. */
115     JVMTI_ERROR_INVALID_OBJECT = 20, /*  
116                                          Invalid object. */
117     JVMTI_ERROR_INVALID_CLASS = 21, /*  
118                                         Invalid class. */
119     JVMTI_ERROR_TYPE_MISMATCH = 34, /*  
120                                         The variable is not an appropriate type for the function used. */
121     JVMTI_ERROR_INVALID_SLOT = 35, /*  
122                                        Invalid slot. */
123     JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99, /*  
124                                                   The capability being used is false in this environment. */
125     JVMTI_ERROR_INVALID_THREAD_GROUP = 11, /*  
126                                                Thread group invalid. */
127     JVMTI_ERROR_INVALID_MONITOR = 50, /*  
128                                           Invalid raw monitor. */
129     JVMTI_ERROR_ILLEGAL_ARGUMENT = 103, /*  
130                                             Illegal argument. */
131     JVMTI_ERROR_INVALID_TYPESTATE = 65, /*  
132                                             The state of the thread has been modified, and is now inconsistent. */
133     JVMTI_ERROR_UNSUPPORTED_VERSION = 68, /*  
134                                               A new class file has a version number not supported by this VM. */
135     JVMTI_ERROR_INVALID_CLASS_FORMAT = 60, /*  
136                                                A new class file is malformed = the VM would return a ClassFormatError, */
137     JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61, /*  
138                                                     The new class file definitions would lead to a circular definition = the VM would return a ClassCircularityError, */ 
139     JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63, /*  
140                                                                 A new class file would require adding a method. */
141     JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64, /*  
142                                                                   A new class version changes a field. */
143     JVMTI_ERROR_FAILS_VERIFICATION = 62, /*  
144                                              The class bytes fail verification. */
145     JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66, /*  
146                                                                      A direct superclass is different for the new class version, or the set of directly implemented interfaces is different. */
147     JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67, /*  
148                                                                   A new class version does not declare a method declared in the old class version. */
149     JVMTI_ERROR_NAMES_DONT_MATCH = 69, /*  
150                                            The class name defined in the new class file is different from the name in the old class object. */
151     JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70, /*  
152                                                                            A new class version has different modifiers. */
153     JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71 /*  
154                                                                            A method in the new class version has different modifiers than its counterpart in the old class version.*/
155
156 } jvmtiError;
157
158
159 typedef enum {
160     JVMTI_PHASE_ONLOAD = 1,
161     JVMTI_PHASE_PRIMORDIAL = 2,
162     JVMTI_PHASE_START = 6,
163     JVMTI_PHASE_LIVE = 4,
164     JVMTI_PHASE_DEAD = 8
165 } jvmtiPhase;
166
167
168 typedef enum {
169     JVMTI_JLOCATION_JVMBCI = 1,
170     JVMTI_JLOCATION_MACHINEPC = 2,
171     JVMTI_JLOCATION_OTHER = 0
172 } jvmtiJlocationFormat;
173
174 typedef struct {
175     jlocation start_location;
176     jint line_number;
177 } jvmtiLineNumberEntry;
178
179 typedef struct {
180     char* name;
181     jint priority;
182     jboolean is_daemon;
183     jthreadGroup thread_group;
184     jobject context_class_loader;
185 } jvmtiThreadInfo;
186
187 typedef enum {
188     JVMTI_VERBOSE_OTHER = 0,
189     JVMTI_VERBOSE_GC = 1,
190     JVMTI_VERBOSE_CLASS = 2,
191     JVMTI_VERBOSE_JNI = 4
192 } jvmtiVerboseFlag;
193
194 typedef struct {
195     jclass klass;
196     jint class_byte_count;
197     const unsigned char* class_bytes;
198 } jvmtiClassDefinition;
199
200 typedef struct JNINativeInterface jniNativeInterface;
201
202 typedef struct {
203     const void* start_address;
204     jlocation location;
205 } jvmtiAddrLocationMap;
206
207
208 typedef void (JNICALL *jvmtiEventSingleStep) 
209     (jvmtiEnv *jvmti_env,
210      JNIEnv* jni_env,
211      jthread thread,
212      jmethodID method,
213      jlocation location);
214
215 typedef void (JNICALL *jvmtiEventBreakpoint)
216     (jvmtiEnv *jvmti_env,
217      JNIEnv* jni_env,
218      jthread thread,
219      jmethodID method,
220      jlocation location);
221
222 typedef void (JNICALL *jvmtiEventFieldAccess)
223     (jvmtiEnv *jvmti_env,
224      JNIEnv* jni_env,
225      jthread thread,
226      jmethodID method,
227      jlocation location,
228      jclass field_klass,
229      jobject object,
230      jfieldID field);
231
232 typedef void (JNICALL *jvmtiEventFieldModification)
233     (jvmtiEnv *jvmti_env,
234      JNIEnv* jni_env,
235      jthread thread,
236      jmethodID method,
237      jlocation location,
238      jclass field_klass,
239      jobject object,
240      jfieldID field,
241      char signature_type,
242      jvalue new_value);
243
244 typedef void (JNICALL *jvmtiEventFramePop)
245     (jvmtiEnv *jvmti_env,
246      JNIEnv* jni_env,
247      jthread thread,
248      jmethodID method,
249      jboolean was_popped_by_exception);
250
251 typedef void (JNICALL *jvmtiEventMethodEntry)
252     (jvmtiEnv *jvmti_env,
253      JNIEnv* jni_env,
254      jthread thread,
255      jmethodID method);
256
257 typedef void (JNICALL *jvmtiEventMethodExit)
258     (jvmtiEnv *jvmti_env,
259      JNIEnv* jni_env,
260      jthread thread,
261      jmethodID method,
262      jboolean was_popped_by_exception,
263      jvalue return_value);
264
265 typedef void (JNICALL *jvmtiEventNativeMethodBind)
266     (jvmtiEnv *jvmti_env,
267      JNIEnv* jni_env,
268      jthread thread,
269      jmethodID method,
270      void* address,
271      void** new_address_ptr);
272
273 typedef void (JNICALL *jvmtiEventException)
274     (jvmtiEnv *jvmti_env,
275      JNIEnv* jni_env,
276      jthread thread,
277      jmethodID method,
278      jlocation location,
279      jobject exception,
280      jmethodID catch_method,
281      jlocation catch_location);
282
283 typedef void (JNICALL *jvmtiEventExceptionCatch)
284     (jvmtiEnv *jvmti_env,
285      JNIEnv* jni_env,
286      jthread thread,
287      jmethodID method,
288      jlocation location,
289      jobject exception);
290
291 typedef void (JNICALL *jvmtiEventThreadStart)
292     (jvmtiEnv *jvmti_env,
293      JNIEnv* jni_env,
294      jthread thread);
295
296 typedef void (JNICALL *jvmtiEventThreadEnd)
297     (jvmtiEnv *jvmti_env,
298      JNIEnv* jni_env,
299      jthread thread);
300
301 typedef void (JNICALL *jvmtiEventClassLoad)
302     (jvmtiEnv *jvmti_env,
303      JNIEnv* jni_env,
304      jthread thread,
305      jclass klass);
306
307 typedef void (JNICALL *jvmtiEventClassPrepare)
308     (jvmtiEnv *jvmti_env,
309      JNIEnv* jni_env,
310      jthread thread,
311      jclass klass);
312
313 typedef void (JNICALL *jvmtiEventClassFileLoadHook)
314     (jvmtiEnv *jvmti_env,
315      JNIEnv* jni_env,
316      jclass class_being_redefined,
317      jobject loader,
318      const char* name,
319      jobject protection_domain,
320      jint class_data_len,
321      const unsigned char* class_data,
322      jint* new_class_data_len,
323      unsigned char** new_class_data);
324
325 typedef void (JNICALL *jvmtiEventVMStart)
326     (jvmtiEnv *jvmti_env,
327      JNIEnv* jni_env);
328
329 typedef void (JNICALL *jvmtiEventVMInit)
330     (jvmtiEnv *jvmti_env, 
331      JNIEnv* jni_env,
332      jthread thread);
333
334 typedef void (JNICALL *jvmtiEventVMDeath)
335     (jvmtiEnv *jvmti_env,
336      JNIEnv* jni_env);
337
338
339 typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
340     (jvmtiEnv *jvmti_env,
341      jmethodID method,
342      jint code_size,
343      const void* code_addr,
344      jint map_length,
345      const jvmtiAddrLocationMap* map,
346      const void* compile_info);
347
348 typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
349     (jvmtiEnv *jvmti_env,
350      jmethodID method,
351      const void* code_addr);
352
353 typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
354     (jvmtiEnv *jvmti_env,
355      const char* name,
356      const void* address,
357      jint length);
358
359 typedef void (JNICALL *jvmtiEventDataDumpRequest)
360     (jvmtiEnv *jvmti_env);
361
362 typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
363     (jvmtiEnv *jvmti_env,
364      JNIEnv* jni_env,
365      jthread thread,
366      jobject object);
367
368 typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
369     (jvmtiEnv *jvmti_env,
370      JNIEnv* jni_env,
371      jthread thread,
372      jobject object);
373
374 typedef void (JNICALL *jvmtiEventMonitorWait)
375     (jvmtiEnv *jvmti_env,
376      JNIEnv* jni_env,
377      jthread thread,
378      jobject object,
379      jlong timeout);
380
381 typedef void (JNICALL *jvmtiEventMonitorWaited)
382     (jvmtiEnv *jvmti_env,
383      JNIEnv* jni_env,
384      jthread thread,
385      jobject object,
386      jboolean timed_out);
387
388 typedef void (JNICALL *jvmtiEventVMObjectAlloc)
389     (jvmtiEnv *jvmti_env,
390      JNIEnv* jni_env,
391      jthread thread,
392      jobject object,
393      jclass object_klass,
394      jlong size);
395
396 typedef void (JNICALL *jvmtiEventObjectFree)
397     (jvmtiEnv *jvmti_env,
398      jlong tag);
399
400 typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
401     (jvmtiEnv *jvmti_env);
402
403 typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
404     (jvmtiEnv *jvmti_env);
405
406 typedef void (JNICALL *jvmtiStartFunction)
407     (jvmtiEnv* jvmti_env, 
408      JNIEnv* jni_env, 
409      void* arg);
410
411 typedef struct {
412     jthreadGroup parent;
413     char* name;
414     jint max_priority;
415     jboolean is_daemon;
416 } jvmtiThreadGroupInfo;
417
418 typedef struct {
419     jthread owner;
420     jint entry_count;
421     jint waiter_count;
422     jthread* waiters;
423     jint notify_waiter_count;
424     jthread* notify_waiters;
425 } jvmtiMonitorUsage;
426
427 typedef struct {
428     jlocation start_location;
429     jint length;
430     char* name;
431     char* signature;
432     char* generic_signature;
433     jint slot;
434 } jvmtiLocalVariableEntry;
435
436 typedef struct {
437     jmethodID method;
438     jlocation location;
439 } jvmtiFrameInfo;
440
441 typedef struct {
442     jthread thread;
443     jint state;
444     jvmtiFrameInfo* frame_buffer;
445     jint frame_count;
446 } jvmtiStackInfo;
447
448 typedef enum {
449     JVMTI_HEAP_OBJECT_TAGGED = 1,
450     JVMTI_HEAP_OBJECT_UNTAGGED = 2,
451     JVMTI_HEAP_OBJECT_EITHER = 3
452 } jvmtiHeapObjectFilter;
453
454 typedef enum {
455     JVMTI_REFERENCE_CLASS = 1,
456     JVMTI_REFERENCE_FIELD = 2,
457     JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
458     JVMTI_REFERENCE_CLASS_LOADER = 4,
459     JVMTI_REFERENCE_SIGNERS = 5,
460     JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
461     JVMTI_REFERENCE_INTERFACE = 7,
462     JVMTI_REFERENCE_STATIC_FIELD = 8,
463     JVMTI_REFERENCE_CONSTANT_POOL = 9
464 } jvmtiObjectReferenceKind;
465
466 typedef enum {
467     JVMTI_ITERATION_CONTINUE = 1,
468     JVMTI_ITERATION_IGNORE = 2,
469     JVMTI_ITERATION_ABORT = 0
470 } jvmtiIterationControl;
471
472 typedef enum {
473     JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
474     JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
475     JVMTI_HEAP_ROOT_MONITOR = 3,
476     JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
477     JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
478     JVMTI_HEAP_ROOT_THREAD = 6,
479     JVMTI_HEAP_ROOT_OTHER = 7
480 } jvmtiHeapRootKind;
481
482 typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
483     (jvmtiObjectReferenceKind reference_kind, 
484      jlong class_tag, 
485      jlong size, 
486      jlong* tag_ptr, 
487      jlong referrer_tag, 
488      jint referrer_index, 
489      void* user_data);
490
491 typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
492     (jvmtiHeapRootKind root_kind, 
493      jlong class_tag, 
494      jlong size, 
495      jlong* tag_ptr, 
496      void* user_data);
497
498 typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
499     (jvmtiHeapRootKind root_kind, 
500      jlong class_tag, 
501      jlong size, 
502      jlong* tag_ptr, 
503      jlong thread_tag, 
504      jint depth, 
505      jmethodID method, 
506      jint slot, 
507      void* user_data);
508
509 typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
510     (jlong class_tag, 
511      jlong size, 
512      jlong* tag_ptr, 
513      void* user_data);
514
515 typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
516     (jvmtiEnv* jvmti_env, 
517       ...);
518
519 typedef enum {
520     JVMTI_KIND_IN = 91,
521     JVMTI_KIND_IN_PTR = 92,
522     JVMTI_KIND_IN_BUF = 93,
523     JVMTI_KIND_ALLOC_BUF = 94,
524     JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
525     JVMTI_KIND_OUT = 96,
526     JVMTI_KIND_OUT_BUF = 97
527 } jvmtiParamKind;
528
529 typedef enum {
530     JVMTI_TYPE_JBYTE = 101,
531     JVMTI_TYPE_JCHAR = 102,
532     JVMTI_TYPE_JSHORT = 103,
533     JVMTI_TYPE_JINT = 104,
534     JVMTI_TYPE_JLONG = 105,
535     JVMTI_TYPE_JFLOAT = 106,
536     JVMTI_TYPE_JDOUBLE = 107,
537     JVMTI_TYPE_JBOOLEAN = 108,
538     JVMTI_TYPE_JOBJECT = 109,
539     JVMTI_TYPE_JTHREAD = 110,
540     JVMTI_TYPE_JCLASS = 111,
541     JVMTI_TYPE_JVALUE = 112,
542     JVMTI_TYPE_JFIELDID = 113,
543     JVMTI_TYPE_JMETHODID = 114,
544     JVMTI_TYPE_CCHAR = 115,   
545     JVMTI_TYPE_CVOID = 116,
546     JVMTI_TYPE_JNIENV = 117
547 } jvmtiParamTypes;
548
549 typedef struct {
550     char* name;
551     jvmtiParamKind kind;
552     jvmtiParamTypes base_type;
553     jboolean null_ok;
554 } jvmtiParamInfo;
555
556 typedef struct {
557     jint extension_event_index;
558     char* id;
559     char* short_description;
560     jint param_count;
561     jvmtiParamInfo* params;
562 } jvmtiExtensionEventInfo;
563
564 typedef void (JNICALL *jvmtiExtensionEvent)
565     (jvmtiEnv* jvmti_env, 
566       ...);
567
568 typedef enum {
569     JVMTI_TIMER_USER_CPU = 30,
570     JVMTI_TIMER_TOTAL_CPU = 31,
571     JVMTI_TIMER_ELAPSED = 32
572 } jvmtiTimerKind;
573
574 typedef struct {
575     jlong max_value;
576     jboolean may_skip_forward;
577     jboolean may_skip_backward;
578     jvmtiTimerKind kind;
579     jlong reserved1;
580     jlong reserved2;
581 } jvmtiTimerInfo;
582
583 typedef struct {
584     jvmtiExtensionFunction func;
585     char* id;
586     char* short_description;
587     jint param_count;
588     jvmtiParamInfo* params;
589     jint error_count;
590     jvmtiError* errors;
591 } jvmtiExtensionFunctionInfo;
592
593 typedef void* jvmtiEventReserved;
594
595 typedef struct {
596     jvmtiEventVMInit VMInit;
597     jvmtiEventVMDeath VMDeath;
598     jvmtiEventThreadStart ThreadStart;
599     jvmtiEventThreadEnd ThreadEnd;
600     jvmtiEventClassFileLoadHook ClassFileLoadHook;
601     jvmtiEventClassLoad ClassLoad;
602     jvmtiEventClassPrepare ClassPrepare;
603     jvmtiEventVMStart VMStart;
604     jvmtiEventException Exception;
605     jvmtiEventExceptionCatch ExceptionCatch;
606     jvmtiEventSingleStep SingleStep;
607     jvmtiEventFramePop FramePop;
608     jvmtiEventBreakpoint Breakpoint;
609     jvmtiEventFieldAccess FieldAccess;
610     jvmtiEventFieldModification FieldModification;
611     jvmtiEventMethodEntry MethodEntry;
612     jvmtiEventMethodExit MethodExit;
613     jvmtiEventNativeMethodBind NativeMethodBind;
614     jvmtiEventCompiledMethodLoad CompiledMethodLoad;
615     jvmtiEventCompiledMethodUnload CompiledMethodUnload;
616     jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
617     jvmtiEventDataDumpRequest DataDumpRequest;
618     jvmtiEventReserved reserved72;
619     jvmtiEventMonitorWait MonitorWait;
620     jvmtiEventMonitorWaited MonitorWaited;
621     jvmtiEventMonitorContendedEnter MonitorContendedEnter;
622     jvmtiEventMonitorContendedEntered MonitorContendedEntered;
623     jvmtiEventReserved reserved77;
624     jvmtiEventReserved reserved78;
625     jvmtiEventReserved reserved79;
626     jvmtiEventReserved reserved80;
627     jvmtiEventGarbageCollectionStart GarbageCollectionStart;
628     jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
629     jvmtiEventObjectFree ObjectFree;
630     jvmtiEventVMObjectAlloc VMObjectAlloc;
631 } jvmtiEventCallbacks;
632
633 typedef enum {
634     JVMTI_ENABLE = 1,
635     JVMTI_DISABLE = 0
636 } jvmtiEventMode;
637
638 typedef enum {
639     JVMTI_EVENT_START_ENUM = 50,
640     JVMTI_EVENT_VM_INIT = 50,
641     JVMTI_EVENT_VM_DEATH = 51,
642     JVMTI_EVENT_THREAD_START = 52,
643     JVMTI_EVENT_THREAD_END = 53,
644     JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
645     JVMTI_EVENT_CLASS_LOAD = 55,
646     JVMTI_EVENT_CLASS_PREPARE = 56,
647     JVMTI_EVENT_VM_START = 57,
648     JVMTI_EVENT_EXCEPTION = 58,
649     JVMTI_EVENT_EXCEPTION_CATCH = 59,
650     JVMTI_EVENT_SINGLE_STEP = 60,
651     JVMTI_EVENT_FRAME_POP = 61,
652     JVMTI_EVENT_BREAKPOINT = 62,
653     JVMTI_EVENT_FIELD_ACCESS = 63,
654     JVMTI_EVENT_FIELD_MODIFICATION = 64,
655     JVMTI_EVENT_METHOD_ENTRY = 65,
656     JVMTI_EVENT_METHOD_EXIT = 66,
657     JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
658     JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
659     JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
660     JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
661     JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
662     JVMTI_EVENT_MONITOR_WAIT = 73,
663     JVMTI_EVENT_MONITOR_WAITED = 74,
664     JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
665     JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
666     JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
667     JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
668     JVMTI_EVENT_OBJECT_FREE = 83,
669     JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
670     JVMTI_EVENT_END_ENUM = 84
671 } jvmtiEvent;
672
673
674 typedef struct {
675     unsigned int can_tag_objects : 1;
676     unsigned int can_generate_field_modification_events : 1;
677     unsigned int can_generate_field_access_events : 1;
678     unsigned int can_get_bytecodes : 1;
679     unsigned int can_get_synthetic_attribute : 1;
680     unsigned int can_get_owned_monitor_info : 1;
681     unsigned int can_get_current_contended_monitor : 1;
682     unsigned int can_get_monitor_info : 1;
683     unsigned int can_pop_frame : 1;
684     unsigned int can_redefine_classes : 1;
685     unsigned int can_signal_thread : 1;
686     unsigned int can_get_source_file_name : 1;
687     unsigned int can_get_line_numbers : 1;
688     unsigned int can_get_source_debug_extension : 1;
689     unsigned int can_access_local_variables : 1;
690     unsigned int can_maintain_original_method_order : 1;
691     unsigned int can_generate_single_step_events : 1;
692     unsigned int can_generate_exception_events : 1;
693     unsigned int can_generate_frame_pop_events : 1;
694     unsigned int can_generate_breakpoint_events : 1;
695     unsigned int can_suspend : 1;
696     unsigned int can_redefine_any_class : 1;
697     unsigned int can_get_current_thread_cpu_time : 1;
698     unsigned int can_get_thread_cpu_time : 1;
699     unsigned int can_generate_method_entry_events : 1;
700     unsigned int can_generate_method_exit_events : 1;
701     unsigned int can_generate_all_class_hook_events : 1;
702     unsigned int can_generate_compiled_method_load_events : 1;
703     unsigned int can_generate_monitor_events : 1;
704     unsigned int can_generate_vm_object_alloc_events : 1;
705     unsigned int can_generate_native_method_bind_events : 1;
706     unsigned int can_generate_garbage_collection_events : 1;
707     unsigned int can_generate_object_free_events : 1;
708     unsigned int : 15;
709     unsigned int : 16;
710     unsigned int : 16;
711     unsigned int : 16;
712     unsigned int : 16;
713     unsigned int : 16;
714 } jvmtiCapabilities;
715
716
717
718
719
720 /* Function Interface */
721 struct jvmtiEnv_struct {    
722     void *reserved1;
723     jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env, 
724                                                     jvmtiEventMode mode, 
725                                                     jvmtiEvent event_type, 
726                                                     jthread event_thread, 
727                                                     ...);
728     void *reserved3;
729     jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env, 
730                                          jint* threads_count_ptr, 
731                                          jthread** threads_ptr);
732     jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env, 
733                                          jthread thread);
734     jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env, 
735                                         jthread thread);
736     jvmtiError (JNICALL *StopThread) (jvmtiEnv* env, 
737                                       jthread thread, 
738                                       jobject exception);
739     jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env, 
740                                            jthread thread);
741     jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env, 
742                                          jthread thread, 
743                                          jvmtiThreadInfo* info_ptr);
744     jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env, 
745                                                jthread thread, 
746                                                jint* owned_monitor_count_ptr, 
747                                                jobject** owned_monitors_ptr);
748     jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env, 
749                                                       jthread thread, 
750                                                       jobject* monitor_ptr);
751     jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env, 
752                                           jthread thread, 
753                                           jvmtiStartFunction proc, 
754                                           const void* arg, 
755                                           jint priority);
756     jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env, 
757                                               jint* group_count_ptr, 
758                                               jthreadGroup** groups_ptr);
759     jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env, 
760                                               jthreadGroup group, 
761                                               jvmtiThreadGroupInfo* info_ptr);
762     jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env, 
763                                                   jthreadGroup group, 
764                                                   jint* thread_count_ptr, 
765                                                   jthread** threads_ptr, 
766                                                   jint* group_count_ptr, 
767                                                   jthreadGroup** groups_ptr);
768     jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env, 
769                                          jthread thread, 
770                                          jint* count_ptr);
771     jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env, 
772                                           jthread thread, 
773                                           jint* thread_state_ptr);
774     void *reserved18;
775     jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env, 
776                                             jthread thread, 
777                                             jint depth, 
778                                             jmethodID* method_ptr, 
779                                             jlocation* location_ptr);
780     jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env, 
781                                           jthread thread, 
782                                           jint depth);
783     jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env, 
784                                           jthread thread, 
785                                           jint depth, 
786                                           jint slot, 
787                                           jobject* value_ptr);
788     jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env, 
789                                        jthread thread, 
790                                        jint depth, 
791                                        jint slot, 
792                                        jint* value_ptr);
793     jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env, 
794                                         jthread thread, 
795                                         jint depth, 
796                                         jint slot, 
797                                         jlong* value_ptr);
798     jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env, 
799                                          jthread thread, 
800                                          jint depth, 
801                                          jint slot, 
802                                          jfloat* value_ptr);
803     jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env, 
804                                           jthread thread, 
805                                           jint depth, 
806                                           jint slot, 
807                                           jdouble* value_ptr);
808     jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env, 
809                                           jthread thread, 
810                                           jint depth, 
811                                           jint slot, 
812                                           jobject value);
813     jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env, 
814                                        jthread thread, 
815                                        jint depth, 
816                                        jint slot, 
817                                        jint value);
818     jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env, 
819                                         jthread thread, 
820                                         jint depth, 
821                                         jint slot, 
822                                         jlong value);
823     jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env, 
824                                          jthread thread, 
825                                          jint depth, 
826                                          jint slot, 
827                                          jfloat value);
828     jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env, 
829                                           jthread thread, 
830                                           jint depth, 
831                                           jint slot, 
832                                           jdouble value);
833     jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env, 
834                                             const char* name, 
835                                             jrawMonitorID* monitor_ptr);
836     jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env, 
837                                              jrawMonitorID monitor);
838     jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env, 
839                                            jrawMonitorID monitor);
840     jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env, 
841                                           jrawMonitorID monitor);
842     jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env, 
843                                           jrawMonitorID monitor, 
844                                           jlong millis);
845     jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env, 
846                                             jrawMonitorID monitor);
847     jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env, 
848                                                jrawMonitorID monitor);
849     jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env, 
850                                          jmethodID method, 
851                                          jlocation location);
852     jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env, 
853                                            jmethodID method, 
854                                            jlocation location);
855     void *reserved40;
856     jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env, 
857                                                jclass klass, 
858                                                jfieldID field);
859     jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env, 
860                                                  jclass klass, 
861                                                  jfieldID field);
862     jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env, 
863                                                      jclass klass, 
864                                                      jfieldID field);
865     jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env, 
866                                                        jclass klass, 
867                                                        jfieldID field);
868     void *reserved45;
869     jvmtiError (JNICALL *Allocate) (jvmtiEnv* env, 
870                                     jlong size, 
871                                     unsigned char** mem_ptr);
872     jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env, 
873                                       unsigned char* mem);
874     jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env, 
875                                              jclass klass, 
876                                              char** signature_ptr, 
877                                              char** generic_ptr);
878     jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env, 
879                                           jclass klass, 
880                                           jint* status_ptr);
881     jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env, 
882                                              jclass klass, 
883                                              char** source_name_ptr);
884     jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env, 
885                                              jclass klass, 
886                                              jint* modifiers_ptr);
887     jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env, 
888                                            jclass klass, 
889                                            jint* method_count_ptr, 
890                                            jmethodID** methods_ptr);
891     jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env, 
892                                           jclass klass, 
893                                           jint* field_count_ptr, 
894                                           jfieldID** fields_ptr);
895     jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env, 
896                                                     jclass klass, 
897                                                     jint* interface_count_ptr, 
898                                                     jclass** interfaces_ptr);
899     jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env, 
900                                        jclass klass, 
901                                        jboolean* is_interface_ptr);
902     jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env, 
903                                         jclass klass, 
904                                         jboolean* is_array_class_ptr);
905     jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env, 
906                                           jclass klass, 
907                                           jobject* classloader_ptr);
908     jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env, 
909                                              jobject object, 
910                                              jint* hash_code_ptr);
911     jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env, 
912                                                  jobject object, 
913                                                  jvmtiMonitorUsage* info_ptr);
914     jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env, 
915                                         jclass klass, 
916                                         jfieldID field, 
917                                         char** name_ptr, 
918                                         char** signature_ptr, 
919                                         char** generic_ptr);
920     jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env, 
921                                                   jclass klass, 
922                                                   jfieldID field, 
923                                                   jclass* declaring_class_ptr);
924     jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env, 
925                                              jclass klass, 
926                                              jfieldID field, 
927                                              jint* modifiers_ptr);
928     jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env, 
929                                             jclass klass, 
930                                             jfieldID field, 
931                                             jboolean* is_synthetic_ptr);
932     jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env, 
933                                          jmethodID method, 
934                                          char** name_ptr, 
935                                          char** signature_ptr, 
936                                          char** generic_ptr);
937     jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env, 
938                                                    jmethodID method, 
939                                                    jclass* declaring_class_ptr);
940     jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env, 
941                                               jmethodID method, 
942                                               jint* modifiers_ptr);
943     void *reserved67;
944     jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env, 
945                                         jmethodID method, 
946                                         jint* max_ptr);
947     jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env, 
948                                             jmethodID method, 
949                                             jint* size_ptr);
950     jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env, 
951                                               jmethodID method, 
952                                               jint* entry_count_ptr, 
953                                               jvmtiLineNumberEntry** table_ptr);
954     jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env, 
955                                              jmethodID method, 
956                                              jlocation* start_location_ptr, 
957                                              jlocation* end_location_ptr);
958     jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env, 
959                                                  jmethodID method, 
960                                                  jint* entry_count_ptr, 
961                                                  jvmtiLocalVariableEntry** table_ptr);
962     void *reserved73;
963     void *reserved74;
964     jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env, 
965                                         jmethodID method, 
966                                         jint* bytecode_count_ptr, 
967                                         unsigned char** bytecodes_ptr);
968     jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env, 
969                                           jmethodID method, 
970                                           jboolean* is_native_ptr);
971     jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env, 
972                                              jmethodID method, 
973                                              jboolean* is_synthetic_ptr);
974     jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env, 
975                                             jint* class_count_ptr, 
976                                             jclass** classes_ptr);
977     jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env, 
978                                                  jobject initiating_loader, 
979                                                  jint* class_count_ptr, 
980                                                  jclass** classes_ptr);
981     jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env, 
982                                     jthread thread);
983     void *reserved81;
984     void *reserved82;
985     void *reserved83;
986     void *reserved84;
987     void *reserved85;
988     void *reserved86;
989     jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env, 
990                                            jint class_count, 
991                                            const jvmtiClassDefinition* class_definitions);
992     jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env, 
993                                             jint* version_ptr);
994     jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env, 
995                                            jvmtiCapabilities* capabilities_ptr);
996     jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env, 
997                                                    jclass klass, 
998                                                    char** source_debug_extension_ptr);
999     jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env, 
1000                                             jmethodID method, 
1001                                             jboolean* is_obsolete_ptr);
1002     jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env, 
1003                                              jint request_count, 
1004                                              const jthread* request_list, 
1005                                              jvmtiError* results);
1006     jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env, 
1007                                             jint request_count, 
1008                                             const jthread* request_list, 
1009                                             jvmtiError* results);
1010     void *reserved94;
1011     void *reserved95;
1012     void *reserved96;
1013     void *reserved97;
1014     void *reserved98;
1015     void *reserved99;
1016     jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env, 
1017                                              jint max_frame_count, 
1018                                              jvmtiStackInfo** stack_info_ptr, 
1019                                              jint* thread_count_ptr);
1020     jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env, 
1021                                                     jint thread_count, 
1022                                                     const jthread* thread_list, 
1023                                                     jint max_frame_count, 
1024                                                     jvmtiStackInfo** stack_info_ptr);
1025     jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env, 
1026                                                  jthread thread, 
1027                                                  void** data_ptr);
1028     jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env, 
1029                                                  jthread thread, 
1030                                                  const void* data);
1031     jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env, 
1032                                          jthread thread, 
1033                                          jint start_depth, 
1034                                          jint max_frame_count, 
1035                                          jvmtiFrameInfo* frame_buffer, 
1036                                          jint* count_ptr);
1037     void *reserved105;
1038     jvmtiError (JNICALL *GetTag) (jvmtiEnv* env, 
1039                                   jobject object, 
1040                                   jlong* tag_ptr);
1041     jvmtiError (JNICALL *SetTag) (jvmtiEnv* env, 
1042                                   jobject object, 
1043                                   jlong tag);
1044     jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env);
1045     jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env, 
1046                                                                  jobject object, 
1047                                                                  jvmtiObjectReferenceCallback object_reference_callback, 
1048                                                                  void* user_data);
1049     jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env, 
1050                                                        jvmtiHeapRootCallback heap_root_callback, 
1051                                                        jvmtiStackReferenceCallback stack_ref_callback, 
1052                                                        jvmtiObjectReferenceCallback object_ref_callback, 
1053                                                        void* user_data);
1054     jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env, 
1055                                            jvmtiHeapObjectFilter object_filter, 
1056                                            jvmtiHeapObjectCallback heap_object_callback, 
1057                                            void* user_data);
1058     jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env, 
1059                                                        jclass klass, 
1060                                                        jvmtiHeapObjectFilter object_filter, 
1061                                                        jvmtiHeapObjectCallback heap_object_callback, 
1062                                                        void* user_data);
1063     void *reserved113;
1064     jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env, 
1065                                               jint tag_count, 
1066                                               const jlong* tags, 
1067                                               jint* count_ptr, 
1068                                               jobject** object_result_ptr, 
1069                                               jlong** tag_result_ptr);
1070     void *reserved115;
1071     void *reserved116;
1072     void *reserved117;
1073     void *reserved118;
1074     void *reserved119;
1075     jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env, 
1076                                                const jniNativeInterface* function_table);
1077     jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env, 
1078                                                jniNativeInterface** function_table);
1079     jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env, 
1080                                              const jvmtiEventCallbacks* callbacks, 
1081                                              jint size_of_callbacks);
1082     jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env, 
1083                                           jvmtiEvent event_type);
1084     jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env, 
1085                                                  jint* extension_count_ptr, 
1086                                                  jvmtiExtensionFunctionInfo** extensions);
1087     jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env, 
1088                                               jint* extension_count_ptr, 
1089                                               jvmtiExtensionEventInfo** extensions);
1090     jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env, 
1091                                                      jint extension_event_index, 
1092                                                      jvmtiExtensionEvent callback);
1093     jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env);
1094     jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env, 
1095                                         jvmtiError error, 
1096                                         char** name_ptr);
1097     jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env, 
1098                                               jvmtiJlocationFormat* format_ptr);
1099     jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env, 
1100                                                jint* count_ptr, 
1101                                                char*** property_ptr);
1102     jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env, 
1103                                              const char* property, 
1104                                              char** value_ptr);
1105     jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env, 
1106                                              const char* property, 
1107                                              const char* value);
1108     jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env, 
1109                                     jvmtiPhase* phase_ptr);
1110     jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env, 
1111                                                         jvmtiTimerInfo* info_ptr);
1112     jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env, 
1113                                                    jlong* nanos_ptr);
1114     jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env, 
1115                                                  jvmtiTimerInfo* info_ptr);
1116     jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env, 
1117                                             jthread thread, 
1118                                             jlong* nanos_ptr);
1119     jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env, 
1120                                         jvmtiTimerInfo* info_ptr);
1121     jvmtiError (JNICALL *GetTime) (jvmtiEnv* env, 
1122                                    jlong* nanos_ptr);
1123     jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env, 
1124                                                     jvmtiCapabilities* capabilities_ptr);
1125     void *reserved141;
1126     jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env, 
1127                                            const jvmtiCapabilities* capabilities_ptr);
1128     jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env, 
1129                                                   const jvmtiCapabilities* capabilities_ptr);
1130     jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env, 
1131                                                   jint* processor_count_ptr);
1132     void *reserved145;
1133     void *reserved146;
1134     jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env, 
1135                                                       void** data_ptr);
1136     jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env, 
1137                                                       const void* data);
1138     jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env, 
1139                                                            const char* segment);
1140     jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env, 
1141                                           jvmtiVerboseFlag flag, 
1142                                           jboolean value);
1143     void *reserved151;
1144     void *reserved152;
1145     void *reserved153;
1146     jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env, 
1147                                          jobject object, 
1148                                          jlong* size_ptr);
1149 }; 
1150
1151
1152 #define JVMTI_THREAD_STATE_ALIVE 0x0001
1153 #define JVMTI_THREAD_STATE_TERMINATED  0x0002   
1154 #define JVMTI_THREAD_STATE_RUNNABLE  0x0004   
1155 #define JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER  0x0400
1156 #define JVMTI_THREAD_STATE_WAITING  0x0080
1157 #define JVMTI_THREAD_STATE_WAITING_INDEFINITELY  0x0010
1158 #define JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT  0x0020
1159 #define JVMTI_THREAD_STATE_SLEEPING  0x0040
1160 #define JVMTI_THREAD_STATE_IN_OBJECT_WAIT  0x0100
1161 #define JVMTI_THREAD_STATE_PARKED  0x0200
1162 #define JVMTI_THREAD_STATE_SUSPENDED  0x100000
1163 #define JVMTI_THREAD_STATE_INTERRUPTED  0x200000
1164 #define JVMTI_THREAD_STATE_IN_NATIVE  0x400000
1165 #define JVMTI_THREAD_STATE_VENDOR_1  0x10000000
1166 #define JVMTI_THREAD_STATE_VENDOR_2  0x20000000
1167 #define JVMTI_THREAD_STATE_VENDOR_3  0x40000000
1168
1169 #define JVMTI_THREAD_MIN_PRIORITY  1   
1170 #define JVMTI_THREAD_NORM_PRIORITY  5
1171 #define JVMTI_THREAD_MAX_PRIORITY  10
1172
1173 #define JVMTI_CLASS_STATUS_VERIFIED  1   
1174 #define JVMTI_CLASS_STATUS_PREPARED  2   
1175 #define JVMTI_CLASS_STATUS_INITIALIZED  4
1176 #define JVMTI_CLASS_STATUS_ERROR  8   
1177 #define JVMTI_CLASS_STATUS_ARRAY  16  
1178 #define JVMTI_CLASS_STATUS_PRIMITIVE  32 
1179
1180 /* cacao specific */
1181
1182 typedef struct {
1183         jvmtiEnv *jvmti_env;
1184         jthread thread;
1185         jmethodID method;
1186         jlocation location;
1187         jclass klass;
1188         jobject object;
1189         jfieldID field;
1190         char signature_type;
1191         jvalue value;
1192         jboolean b;
1193         void* address;
1194         void** new_address_ptr;
1195         jmethodID catch_method;
1196         jlocation catch_location;
1197         char* name;
1198         jobject protection_domain;
1199         jint jint1;
1200         jint jint2;
1201         unsigned char* class_data;
1202         jint* new_class_data_len;
1203         unsigned char** new_class_data;
1204         jvmtiAddrLocationMap* map;
1205         void* compile_info;
1206         jlong jlong;
1207 } genericEventData;
1208
1209 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
1210 struct _jrawMonitorID {
1211         java_lang_String *name;
1212 };
1213 #endif
1214
1215 jvmtiEnv* new_jvmtienv();
1216 void set_jvmti_phase(jvmtiPhase p);
1217 pid_t debuggee;
1218 jvmtiEnv* remotedbgjvmtienv;
1219 jvmtiEventCallbacks jvmti_jdwp_EventCallbacks;
1220 void agentload(char* opt_arg);
1221 void agentunload();
1222 #endif
1223
1224
1225
1226
1227 /*
1228  * These are local overrides for various environment variables in Emacs.
1229  * Please do not remove this and leave it at the end of the file, where
1230  * Emacs will automagically detect them.
1231  * ---------------------------------------------------------------------
1232  * Local variables:
1233  * mode: c
1234  * indent-tabs-mode: t
1235  * c-basic-offset: 4
1236  * tab-width: 4
1237  * End:
1238  */