1 /* src/native/jvmti.c - implementation of the Java Virtual Machine Tool
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
9 This file is part of CACAO.
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.
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.
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
26 Contact: cacao@cacaojvm.org
28 Author: Martin Platter
33 $Id: jvmti.h 5019 2006-06-06 21:13:41Z motse $
39 #include "native/jni.h"
42 #define JVMTI_VERSION_INTERFACE_JNI 0x00000000
43 #define JVMTI_VERSION_INTERFACE_JVMTI 0x30000000
44 #define JVMTI_VERSION_MASK_INTERFACE_TYPE 0x70000000
45 #define JVMTI_VERSION_1_0 0x30010000
46 #define JVMTI_VERSION JVMTI_VERSION_1_0
49 typedef jobject jthread;
50 typedef jobject jthreadGroup;
51 typedef jlong jlocation;
52 struct _jrawMonitorID;
53 typedef struct _jrawMonitorID *jrawMonitorID;
54 typedef struct jvmtiEnv_struct *jvmtiEnv;
57 JVMTI_ERROR_NONE = 0, /* No error has occurred. This is the error code that is
58 returned on successful completion of the function. */
59 JVMTI_ERROR_NULL_POINTER = 100, /* Pointer is unexpectedly NULL. */
60 JVMTI_ERROR_OUT_OF_MEMORY = 110, /* The function attempted to allocate memory
61 and no more memory was available for
63 JVMTI_ERROR_ACCESS_DENIED = 111, /* The desired functionality has not been
64 enabled in this virtual machine. */
65 JVMTI_ERROR_UNATTACHED_THREAD = 115, /* The thread being used to call this
66 function is not attached to the virtual
67 machine. Calls must be made from attached threads.
68 See AttachCurrentThread in the JNI invocation API. */
69 JVMTI_ERROR_INVALID_ENVIRONMENT = 116, /*
70 The JVM TI environment provided is no longer connected or is not an environment. */
71 JVMTI_ERROR_WRONG_PHASE = 112, /*
72 The desired functionality is not available in the current phase. Always returned if the virtual machine has completed running. */
73 JVMTI_ERROR_INTERNAL = 113, /*
74 An unexpected internal error has occurred. */
76 /* ****** Function Specific Required Errors ********** */
77 JVMTI_ERROR_INVALID_PRIORITY = 12, /*
79 JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13, /*
80 Thread was not suspended. */
81 JVMTI_ERROR_THREAD_SUSPENDED = 14, /*
82 Thread already suspended. */
83 JVMTI_ERROR_THREAD_NOT_ALIVE = 15, /*
84 This operation requires the thread to be alive--that is, it must be started and not yet have died. */
85 JVMTI_ERROR_CLASS_NOT_PREPARED = 22, /*
86 The class has been loaded but not yet prepared. */
87 JVMTI_ERROR_NO_MORE_FRAMES = 31, /*
88 There are no Java programming language or JNI stack frames at the specified depth. */
89 JVMTI_ERROR_OPAQUE_FRAME = 32, /*
90 Information about the frame is not available = e.g. for native frames, */
91 JVMTI_ERROR_DUPLICATE = 40, /*
93 JVMTI_ERROR_NOT_FOUND = 41, /*
94 Desired element = e.g. field or breakpoint, not found */
95 JVMTI_ERROR_NOT_MONITOR_OWNER = 51, /*
96 This thread doesn't own the raw monitor. */
97 JVMTI_ERROR_INTERRUPT = 52, /*
98 The call has been interrupted before completion. */
99 JVMTI_ERROR_UNMODIFIABLE_CLASS = 79, /*
100 The class cannot be modified. */
101 JVMTI_ERROR_NOT_AVAILABLE = 98, /*
102 The functionality is not available in this virtual machine. */
103 JVMTI_ERROR_ABSENT_INFORMATION = 101, /*
104 The requested information is not available. */
105 JVMTI_ERROR_INVALID_EVENT_TYPE = 102, /*
106 The specified event type ID is not recognized. */
107 JVMTI_ERROR_NATIVE_METHOD = 104, /*
108 The requested information is not available for native method.
109 Function Specific Agent Errors
110 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. */
111 JVMTI_ERROR_INVALID_THREAD = 10, /*
112 The passed thread is not a valid thread.*/
113 JVMTI_ERROR_INVALID_FIELDID = 25, /*
115 JVMTI_ERROR_INVALID_METHODID = 23, /*
117 JVMTI_ERROR_INVALID_LOCATION = 24, /*
119 JVMTI_ERROR_INVALID_OBJECT = 20, /*
121 JVMTI_ERROR_INVALID_CLASS = 21, /*
123 JVMTI_ERROR_TYPE_MISMATCH = 34, /*
124 The variable is not an appropriate type for the function used. */
125 JVMTI_ERROR_INVALID_SLOT = 35, /*
127 JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99, /*
128 The capability being used is false in this environment. */
129 JVMTI_ERROR_INVALID_THREAD_GROUP = 11, /*
130 Thread group invalid. */
131 JVMTI_ERROR_INVALID_MONITOR = 50, /*
132 Invalid raw monitor. */
133 JVMTI_ERROR_ILLEGAL_ARGUMENT = 103, /*
135 JVMTI_ERROR_INVALID_TYPESTATE = 65, /*
136 The state of the thread has been modified, and is now inconsistent. */
137 JVMTI_ERROR_UNSUPPORTED_VERSION = 68, /*
138 A new class file has a version number not supported by this VM. */
139 JVMTI_ERROR_INVALID_CLASS_FORMAT = 60, /*
140 A new class file is malformed = the VM would return a ClassFormatError, */
141 JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61, /*
142 The new class file definitions would lead to a circular definition = the VM would return a ClassCircularityError, */
143 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63, /*
144 A new class file would require adding a method. */
145 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64, /*
146 A new class version changes a field. */
147 JVMTI_ERROR_FAILS_VERIFICATION = 62, /*
148 The class bytes fail verification. */
149 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66, /*
150 A direct superclass is different for the new class version, or the set of directly implemented interfaces is different. */
151 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67, /*
152 A new class version does not declare a method declared in the old class version. */
153 JVMTI_ERROR_NAMES_DONT_MATCH = 69, /*
154 The class name defined in the new class file is different from the name in the old class object. */
155 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70, /*
156 A new class version has different modifiers. */
157 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71 /*
158 A method in the new class version has different modifiers than its counterpart in the old class version.*/
164 JVMTI_PHASE_ONLOAD = 1,
165 JVMTI_PHASE_PRIMORDIAL = 2,
166 JVMTI_PHASE_START = 6,
167 JVMTI_PHASE_LIVE = 4,
173 JVMTI_JLOCATION_JVMBCI = 1,
174 JVMTI_JLOCATION_MACHINEPC = 2,
175 JVMTI_JLOCATION_OTHER = 0
176 } jvmtiJlocationFormat;
179 jlocation start_location;
181 } jvmtiLineNumberEntry;
187 jthreadGroup thread_group;
188 jobject context_class_loader;
192 JVMTI_VERBOSE_OTHER = 0,
193 JVMTI_VERBOSE_GC = 1,
194 JVMTI_VERBOSE_CLASS = 2,
195 JVMTI_VERBOSE_JNI = 4
200 jint class_byte_count;
201 const unsigned char* class_bytes;
202 } jvmtiClassDefinition;
204 typedef struct JNINativeInterface jniNativeInterface;
207 const void* start_address;
209 } jvmtiAddrLocationMap;
212 typedef void (JNICALL *jvmtiEventSingleStep)
213 (jvmtiEnv *jvmti_env,
219 typedef void (JNICALL *jvmtiEventBreakpoint)
220 (jvmtiEnv *jvmti_env,
226 typedef void (JNICALL *jvmtiEventFieldAccess)
227 (jvmtiEnv *jvmti_env,
236 typedef void (JNICALL *jvmtiEventFieldModification)
237 (jvmtiEnv *jvmti_env,
248 typedef void (JNICALL *jvmtiEventFramePop)
249 (jvmtiEnv *jvmti_env,
253 jboolean was_popped_by_exception);
255 typedef void (JNICALL *jvmtiEventMethodEntry)
256 (jvmtiEnv *jvmti_env,
261 typedef void (JNICALL *jvmtiEventMethodExit)
262 (jvmtiEnv *jvmti_env,
266 jboolean was_popped_by_exception,
267 jvalue return_value);
269 typedef void (JNICALL *jvmtiEventNativeMethodBind)
270 (jvmtiEnv *jvmti_env,
275 void** new_address_ptr);
277 typedef void (JNICALL *jvmtiEventException)
278 (jvmtiEnv *jvmti_env,
284 jmethodID catch_method,
285 jlocation catch_location);
287 typedef void (JNICALL *jvmtiEventExceptionCatch)
288 (jvmtiEnv *jvmti_env,
295 typedef void (JNICALL *jvmtiEventThreadStart)
296 (jvmtiEnv *jvmti_env,
300 typedef void (JNICALL *jvmtiEventThreadEnd)
301 (jvmtiEnv *jvmti_env,
305 typedef void (JNICALL *jvmtiEventClassLoad)
306 (jvmtiEnv *jvmti_env,
311 typedef void (JNICALL *jvmtiEventClassPrepare)
312 (jvmtiEnv *jvmti_env,
317 typedef void (JNICALL *jvmtiEventClassFileLoadHook)
318 (jvmtiEnv *jvmti_env,
320 jclass class_being_redefined,
323 jobject protection_domain,
325 const unsigned char* class_data,
326 jint* new_class_data_len,
327 unsigned char** new_class_data);
329 typedef void (JNICALL *jvmtiEventVMStart)
330 (jvmtiEnv *jvmti_env,
333 typedef void (JNICALL *jvmtiEventVMInit)
334 (jvmtiEnv *jvmti_env,
338 typedef void (JNICALL *jvmtiEventVMDeath)
339 (jvmtiEnv *jvmti_env,
343 typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
344 (jvmtiEnv *jvmti_env,
347 const void* code_addr,
349 const jvmtiAddrLocationMap* map,
350 const void* compile_info);
352 typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
353 (jvmtiEnv *jvmti_env,
355 const void* code_addr);
357 typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
358 (jvmtiEnv *jvmti_env,
363 typedef void (JNICALL *jvmtiEventDataDumpRequest)
364 (jvmtiEnv *jvmti_env);
366 typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
367 (jvmtiEnv *jvmti_env,
372 typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
373 (jvmtiEnv *jvmti_env,
378 typedef void (JNICALL *jvmtiEventMonitorWait)
379 (jvmtiEnv *jvmti_env,
385 typedef void (JNICALL *jvmtiEventMonitorWaited)
386 (jvmtiEnv *jvmti_env,
392 typedef void (JNICALL *jvmtiEventVMObjectAlloc)
393 (jvmtiEnv *jvmti_env,
400 typedef void (JNICALL *jvmtiEventObjectFree)
401 (jvmtiEnv *jvmti_env,
404 typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
405 (jvmtiEnv *jvmti_env);
407 typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
408 (jvmtiEnv *jvmti_env);
410 typedef void (JNICALL *jvmtiStartFunction)
411 (jvmtiEnv* jvmti_env,
420 } jvmtiThreadGroupInfo;
427 jint notify_waiter_count;
428 jthread* notify_waiters;
432 jlocation start_location;
436 char* generic_signature;
438 } jvmtiLocalVariableEntry;
448 jvmtiFrameInfo* frame_buffer;
453 JVMTI_HEAP_OBJECT_TAGGED = 1,
454 JVMTI_HEAP_OBJECT_UNTAGGED = 2,
455 JVMTI_HEAP_OBJECT_EITHER = 3
456 } jvmtiHeapObjectFilter;
459 JVMTI_REFERENCE_CLASS = 1,
460 JVMTI_REFERENCE_FIELD = 2,
461 JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
462 JVMTI_REFERENCE_CLASS_LOADER = 4,
463 JVMTI_REFERENCE_SIGNERS = 5,
464 JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
465 JVMTI_REFERENCE_INTERFACE = 7,
466 JVMTI_REFERENCE_STATIC_FIELD = 8,
467 JVMTI_REFERENCE_CONSTANT_POOL = 9
468 } jvmtiObjectReferenceKind;
471 JVMTI_ITERATION_CONTINUE = 1,
472 JVMTI_ITERATION_IGNORE = 2,
473 JVMTI_ITERATION_ABORT = 0
474 } jvmtiIterationControl;
477 JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
478 JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
479 JVMTI_HEAP_ROOT_MONITOR = 3,
480 JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
481 JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
482 JVMTI_HEAP_ROOT_THREAD = 6,
483 JVMTI_HEAP_ROOT_OTHER = 7
486 typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
487 (jvmtiObjectReferenceKind reference_kind,
495 typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
496 (jvmtiHeapRootKind root_kind,
502 typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
503 (jvmtiHeapRootKind root_kind,
513 typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
519 typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
520 (jvmtiEnv* jvmti_env,
525 JVMTI_KIND_IN_PTR = 92,
526 JVMTI_KIND_IN_BUF = 93,
527 JVMTI_KIND_ALLOC_BUF = 94,
528 JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
530 JVMTI_KIND_OUT_BUF = 97
534 JVMTI_TYPE_JBYTE = 101,
535 JVMTI_TYPE_JCHAR = 102,
536 JVMTI_TYPE_JSHORT = 103,
537 JVMTI_TYPE_JINT = 104,
538 JVMTI_TYPE_JLONG = 105,
539 JVMTI_TYPE_JFLOAT = 106,
540 JVMTI_TYPE_JDOUBLE = 107,
541 JVMTI_TYPE_JBOOLEAN = 108,
542 JVMTI_TYPE_JOBJECT = 109,
543 JVMTI_TYPE_JTHREAD = 110,
544 JVMTI_TYPE_JCLASS = 111,
545 JVMTI_TYPE_JVALUE = 112,
546 JVMTI_TYPE_JFIELDID = 113,
547 JVMTI_TYPE_JMETHODID = 114,
548 JVMTI_TYPE_CCHAR = 115,
549 JVMTI_TYPE_CVOID = 116,
550 JVMTI_TYPE_JNIENV = 117
556 jvmtiParamTypes base_type;
561 jint extension_event_index;
563 char* short_description;
565 jvmtiParamInfo* params;
566 } jvmtiExtensionEventInfo;
568 typedef void (JNICALL *jvmtiExtensionEvent)
569 (jvmtiEnv* jvmti_env,
573 JVMTI_TIMER_USER_CPU = 30,
574 JVMTI_TIMER_TOTAL_CPU = 31,
575 JVMTI_TIMER_ELAPSED = 32
580 jboolean may_skip_forward;
581 jboolean may_skip_backward;
588 jvmtiExtensionFunction func;
590 char* short_description;
592 jvmtiParamInfo* params;
595 } jvmtiExtensionFunctionInfo;
597 typedef void* jvmtiEventReserved;
600 jvmtiEventVMInit VMInit;
601 jvmtiEventVMDeath VMDeath;
602 jvmtiEventThreadStart ThreadStart;
603 jvmtiEventThreadEnd ThreadEnd;
604 jvmtiEventClassFileLoadHook ClassFileLoadHook;
605 jvmtiEventClassLoad ClassLoad;
606 jvmtiEventClassPrepare ClassPrepare;
607 jvmtiEventVMStart VMStart;
608 jvmtiEventException Exception;
609 jvmtiEventExceptionCatch ExceptionCatch;
610 jvmtiEventSingleStep SingleStep;
611 jvmtiEventFramePop FramePop;
612 jvmtiEventBreakpoint Breakpoint;
613 jvmtiEventFieldAccess FieldAccess;
614 jvmtiEventFieldModification FieldModification;
615 jvmtiEventMethodEntry MethodEntry;
616 jvmtiEventMethodExit MethodExit;
617 jvmtiEventNativeMethodBind NativeMethodBind;
618 jvmtiEventCompiledMethodLoad CompiledMethodLoad;
619 jvmtiEventCompiledMethodUnload CompiledMethodUnload;
620 jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
621 jvmtiEventDataDumpRequest DataDumpRequest;
622 jvmtiEventReserved reserved72;
623 jvmtiEventMonitorWait MonitorWait;
624 jvmtiEventMonitorWaited MonitorWaited;
625 jvmtiEventMonitorContendedEnter MonitorContendedEnter;
626 jvmtiEventMonitorContendedEntered MonitorContendedEntered;
627 jvmtiEventReserved reserved77;
628 jvmtiEventReserved reserved78;
629 jvmtiEventReserved reserved79;
630 jvmtiEventReserved reserved80;
631 jvmtiEventGarbageCollectionStart GarbageCollectionStart;
632 jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
633 jvmtiEventObjectFree ObjectFree;
634 jvmtiEventVMObjectAlloc VMObjectAlloc;
635 } jvmtiEventCallbacks;
643 JVMTI_EVENT_START_ENUM = 50,
644 JVMTI_EVENT_VM_INIT = 50,
645 JVMTI_EVENT_VM_DEATH = 51,
646 JVMTI_EVENT_THREAD_START = 52,
647 JVMTI_EVENT_THREAD_END = 53,
648 JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
649 JVMTI_EVENT_CLASS_LOAD = 55,
650 JVMTI_EVENT_CLASS_PREPARE = 56,
651 JVMTI_EVENT_VM_START = 57,
652 JVMTI_EVENT_EXCEPTION = 58,
653 JVMTI_EVENT_EXCEPTION_CATCH = 59,
654 JVMTI_EVENT_SINGLE_STEP = 60,
655 JVMTI_EVENT_FRAME_POP = 61,
656 JVMTI_EVENT_BREAKPOINT = 62,
657 JVMTI_EVENT_FIELD_ACCESS = 63,
658 JVMTI_EVENT_FIELD_MODIFICATION = 64,
659 JVMTI_EVENT_METHOD_ENTRY = 65,
660 JVMTI_EVENT_METHOD_EXIT = 66,
661 JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
662 JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
663 JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
664 JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
665 JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
666 JVMTI_EVENT_MONITOR_WAIT = 73,
667 JVMTI_EVENT_MONITOR_WAITED = 74,
668 JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
669 JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
670 JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
671 JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
672 JVMTI_EVENT_OBJECT_FREE = 83,
673 JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
674 JVMTI_EVENT_END_ENUM = 84
679 unsigned int can_tag_objects : 1;
680 unsigned int can_generate_field_modification_events : 1;
681 unsigned int can_generate_field_access_events : 1;
682 unsigned int can_get_bytecodes : 1;
683 unsigned int can_get_synthetic_attribute : 1;
684 unsigned int can_get_owned_monitor_info : 1;
685 unsigned int can_get_current_contended_monitor : 1;
686 unsigned int can_get_monitor_info : 1;
687 unsigned int can_pop_frame : 1;
688 unsigned int can_redefine_classes : 1;
689 unsigned int can_signal_thread : 1;
690 unsigned int can_get_source_file_name : 1;
691 unsigned int can_get_line_numbers : 1;
692 unsigned int can_get_source_debug_extension : 1;
693 unsigned int can_access_local_variables : 1;
694 unsigned int can_maintain_original_method_order : 1;
695 unsigned int can_generate_single_step_events : 1;
696 unsigned int can_generate_exception_events : 1;
697 unsigned int can_generate_frame_pop_events : 1;
698 unsigned int can_generate_breakpoint_events : 1;
699 unsigned int can_suspend : 1;
700 unsigned int can_redefine_any_class : 1;
701 unsigned int can_get_current_thread_cpu_time : 1;
702 unsigned int can_get_thread_cpu_time : 1;
703 unsigned int can_generate_method_entry_events : 1;
704 unsigned int can_generate_method_exit_events : 1;
705 unsigned int can_generate_all_class_hook_events : 1;
706 unsigned int can_generate_compiled_method_load_events : 1;
707 unsigned int can_generate_monitor_events : 1;
708 unsigned int can_generate_vm_object_alloc_events : 1;
709 unsigned int can_generate_native_method_bind_events : 1;
710 unsigned int can_generate_garbage_collection_events : 1;
711 unsigned int can_generate_object_free_events : 1;
724 /* Function Interface */
725 struct jvmtiEnv_struct {
727 jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env,
729 jvmtiEvent event_type,
730 jthread event_thread,
733 jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env,
734 jint* threads_count_ptr,
735 jthread** threads_ptr);
736 jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env,
738 jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env,
740 jvmtiError (JNICALL *StopThread) (jvmtiEnv* env,
743 jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env,
745 jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env,
747 jvmtiThreadInfo* info_ptr);
748 jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env,
750 jint* owned_monitor_count_ptr,
751 jobject** owned_monitors_ptr);
752 jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env,
754 jobject* monitor_ptr);
755 jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env,
757 jvmtiStartFunction proc,
760 jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env,
761 jint* group_count_ptr,
762 jthreadGroup** groups_ptr);
763 jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env,
765 jvmtiThreadGroupInfo* info_ptr);
766 jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env,
768 jint* thread_count_ptr,
769 jthread** threads_ptr,
770 jint* group_count_ptr,
771 jthreadGroup** groups_ptr);
772 jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env,
775 jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env,
777 jint* thread_state_ptr);
779 jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env,
782 jmethodID* method_ptr,
783 jlocation* location_ptr);
784 jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env,
787 jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env,
792 jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env,
797 jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env,
802 jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env,
807 jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env,
812 jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env,
817 jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env,
822 jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env,
827 jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env,
832 jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env,
837 jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env,
839 jrawMonitorID* monitor_ptr);
840 jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env,
841 jrawMonitorID monitor);
842 jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env,
843 jrawMonitorID monitor);
844 jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env,
845 jrawMonitorID monitor);
846 jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env,
847 jrawMonitorID monitor,
849 jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env,
850 jrawMonitorID monitor);
851 jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env,
852 jrawMonitorID monitor);
853 jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env,
856 jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env,
860 jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env,
863 jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env,
866 jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env,
869 jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env,
873 jvmtiError (JNICALL *Allocate) (jvmtiEnv* env,
875 unsigned char** mem_ptr);
876 jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env,
878 jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env,
880 char** signature_ptr,
882 jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env,
885 jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env,
887 char** source_name_ptr);
888 jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env,
890 jint* modifiers_ptr);
891 jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env,
893 jint* method_count_ptr,
894 jmethodID** methods_ptr);
895 jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env,
897 jint* field_count_ptr,
898 jfieldID** fields_ptr);
899 jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env,
901 jint* interface_count_ptr,
902 jclass** interfaces_ptr);
903 jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env,
905 jboolean* is_interface_ptr);
906 jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env,
908 jboolean* is_array_class_ptr);
909 jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env,
911 jobject* classloader_ptr);
912 jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env,
914 jint* hash_code_ptr);
915 jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env,
917 jvmtiMonitorUsage* info_ptr);
918 jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env,
922 char** signature_ptr,
924 jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env,
927 jclass* declaring_class_ptr);
928 jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env,
931 jint* modifiers_ptr);
932 jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env,
935 jboolean* is_synthetic_ptr);
936 jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env,
939 char** signature_ptr,
941 jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env,
943 jclass* declaring_class_ptr);
944 jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env,
946 jint* modifiers_ptr);
948 jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env,
951 jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env,
954 jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env,
956 jint* entry_count_ptr,
957 jvmtiLineNumberEntry** table_ptr);
958 jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env,
960 jlocation* start_location_ptr,
961 jlocation* end_location_ptr);
962 jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env,
964 jint* entry_count_ptr,
965 jvmtiLocalVariableEntry** table_ptr);
968 jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env,
970 jint* bytecode_count_ptr,
971 unsigned char** bytecodes_ptr);
972 jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env,
974 jboolean* is_native_ptr);
975 jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env,
977 jboolean* is_synthetic_ptr);
978 jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env,
979 jint* class_count_ptr,
980 jclass** classes_ptr);
981 jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env,
982 jobject initiating_loader,
983 jint* class_count_ptr,
984 jclass** classes_ptr);
985 jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env,
993 jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env,
995 const jvmtiClassDefinition* class_definitions);
996 jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env,
998 jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env,
999 jvmtiCapabilities* capabilities_ptr);
1000 jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env,
1002 char** source_debug_extension_ptr);
1003 jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env,
1005 jboolean* is_obsolete_ptr);
1006 jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env,
1008 const jthread* request_list,
1009 jvmtiError* results);
1010 jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env,
1012 const jthread* request_list,
1013 jvmtiError* results);
1020 jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env,
1021 jint max_frame_count,
1022 jvmtiStackInfo** stack_info_ptr,
1023 jint* thread_count_ptr);
1024 jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env,
1026 const jthread* thread_list,
1027 jint max_frame_count,
1028 jvmtiStackInfo** stack_info_ptr);
1029 jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env,
1032 jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env,
1035 jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env,
1038 jint max_frame_count,
1039 jvmtiFrameInfo* frame_buffer,
1042 jvmtiError (JNICALL *GetTag) (jvmtiEnv* env,
1045 jvmtiError (JNICALL *SetTag) (jvmtiEnv* env,
1048 jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env);
1049 jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env,
1051 jvmtiObjectReferenceCallback object_reference_callback,
1053 jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env,
1054 jvmtiHeapRootCallback heap_root_callback,
1055 jvmtiStackReferenceCallback stack_ref_callback,
1056 jvmtiObjectReferenceCallback object_ref_callback,
1058 jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env,
1059 jvmtiHeapObjectFilter object_filter,
1060 jvmtiHeapObjectCallback heap_object_callback,
1062 jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env,
1064 jvmtiHeapObjectFilter object_filter,
1065 jvmtiHeapObjectCallback heap_object_callback,
1068 jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env,
1072 jobject** object_result_ptr,
1073 jlong** tag_result_ptr);
1079 jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env,
1080 const jniNativeInterface* function_table);
1081 jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env,
1082 jniNativeInterface** function_table);
1083 jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env,
1084 const jvmtiEventCallbacks* callbacks,
1085 jint size_of_callbacks);
1086 jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env,
1087 jvmtiEvent event_type);
1088 jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env,
1089 jint* extension_count_ptr,
1090 jvmtiExtensionFunctionInfo** extensions);
1091 jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env,
1092 jint* extension_count_ptr,
1093 jvmtiExtensionEventInfo** extensions);
1094 jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env,
1095 jint extension_event_index,
1096 jvmtiExtensionEvent callback);
1097 jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env);
1098 jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env,
1101 jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env,
1102 jvmtiJlocationFormat* format_ptr);
1103 jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env,
1105 char*** property_ptr);
1106 jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env,
1107 const char* property,
1109 jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env,
1110 const char* property,
1112 jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env,
1113 jvmtiPhase* phase_ptr);
1114 jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env,
1115 jvmtiTimerInfo* info_ptr);
1116 jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env,
1118 jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env,
1119 jvmtiTimerInfo* info_ptr);
1120 jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env,
1123 jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env,
1124 jvmtiTimerInfo* info_ptr);
1125 jvmtiError (JNICALL *GetTime) (jvmtiEnv* env,
1127 jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env,
1128 jvmtiCapabilities* capabilities_ptr);
1130 jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env,
1131 const jvmtiCapabilities* capabilities_ptr);
1132 jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env,
1133 const jvmtiCapabilities* capabilities_ptr);
1134 jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env,
1135 jint* processor_count_ptr);
1138 jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env,
1140 jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env,
1142 jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env,
1143 const char* segment);
1144 jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env,
1145 jvmtiVerboseFlag flag,
1150 jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env,
1156 #define JVMTI_THREAD_STATE_ALIVE 0x0001
1157 #define JVMTI_THREAD_STATE_TERMINATED 0x0002
1158 #define JVMTI_THREAD_STATE_RUNNABLE 0x0004
1159 #define JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER 0x0400
1160 #define JVMTI_THREAD_STATE_WAITING 0x0080
1161 #define JVMTI_THREAD_STATE_WAITING_INDEFINITELY 0x0010
1162 #define JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT 0x0020
1163 #define JVMTI_THREAD_STATE_SLEEPING 0x0040
1164 #define JVMTI_THREAD_STATE_IN_OBJECT_WAIT 0x0100
1165 #define JVMTI_THREAD_STATE_PARKED 0x0200
1166 #define JVMTI_THREAD_STATE_SUSPENDED 0x100000
1167 #define JVMTI_THREAD_STATE_INTERRUPTED 0x200000
1168 #define JVMTI_THREAD_STATE_IN_NATIVE 0x400000
1169 #define JVMTI_THREAD_STATE_VENDOR_1 0x10000000
1170 #define JVMTI_THREAD_STATE_VENDOR_2 0x20000000
1171 #define JVMTI_THREAD_STATE_VENDOR_3 0x40000000
1173 #define JVMTI_THREAD_MIN_PRIORITY 1
1174 #define JVMTI_THREAD_NORM_PRIORITY 5
1175 #define JVMTI_THREAD_MAX_PRIORITY 10
1177 #define JVMTI_CLASS_STATUS_VERIFIED 1
1178 #define JVMTI_CLASS_STATUS_PREPARED 2
1179 #define JVMTI_CLASS_STATUS_INITIALIZED 4
1180 #define JVMTI_CLASS_STATUS_ERROR 8
1181 #define JVMTI_CLASS_STATUS_ARRAY 16
1182 #define JVMTI_CLASS_STATUS_PRIMITIVE 32
1190 * These are local overrides for various environment variables in Emacs.
1191 * Please do not remove this and leave it at the end of the file, where
1192 * Emacs will automagically detect them.
1193 * ---------------------------------------------------------------------
1196 * indent-tabs-mode: t