1 /* src/native/jvmti.c - implementation of the Java Virtual Machine Tool
4 Copyright (C) 1996-2005, 2006, 2008
5 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
7 This file is part of CACAO.
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2, or (at
12 your option) any later version.
14 This program is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
32 #include "native/jni.hpp"
35 #define JVMTI_VERSION_INTERFACE_JNI 0x00000000
36 #define JVMTI_VERSION_INTERFACE_JVMTI 0x30000000
37 #define JVMTI_VERSION_MASK_INTERFACE_TYPE 0x70000000
38 #define JVMTI_VERSION_1_0 0x30010000
39 #define JVMTI_VERSION JVMTI_VERSION_1_0
42 typedef jobject jthread;
43 typedef jobject jthreadGroup;
44 typedef jlong jlocation;
45 struct _jrawMonitorID;
46 typedef struct _jrawMonitorID *jrawMonitorID;
47 typedef struct jvmtiEnv_struct *jvmtiEnv;
50 JVMTI_ERROR_NONE = 0, /* No error has occurred. This is the error code that is
51 returned on successful completion of the function. */
52 JVMTI_ERROR_NULL_POINTER = 100, /* Pointer is unexpectedly NULL. */
53 JVMTI_ERROR_OUT_OF_MEMORY = 110, /* The function attempted to allocate memory
54 and no more memory was available for
56 JVMTI_ERROR_ACCESS_DENIED = 111, /* The desired functionality has not been
57 enabled in this virtual machine. */
58 JVMTI_ERROR_UNATTACHED_THREAD = 115, /* The thread being used to call this
59 function is not attached to the virtual
60 machine. Calls must be made from attached threads.
61 See AttachCurrentThread in the JNI invocation API. */
62 JVMTI_ERROR_INVALID_ENVIRONMENT = 116, /*
63 The JVM TI environment provided is no longer connected or is not an environment. */
64 JVMTI_ERROR_WRONG_PHASE = 112, /*
65 The desired functionality is not available in the current phase. Always returned if the virtual machine has completed running. */
66 JVMTI_ERROR_INTERNAL = 113, /*
67 An unexpected internal error has occurred. */
69 /* ****** Function Specific Required Errors ********** */
70 JVMTI_ERROR_INVALID_PRIORITY = 12, /*
72 JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13, /*
73 Thread was not suspended. */
74 JVMTI_ERROR_THREAD_SUSPENDED = 14, /*
75 Thread already suspended. */
76 JVMTI_ERROR_THREAD_NOT_ALIVE = 15, /*
77 This operation requires the thread to be alive--that is, it must be started and not yet have died. */
78 JVMTI_ERROR_CLASS_NOT_PREPARED = 22, /*
79 The class has been loaded but not yet prepared. */
80 JVMTI_ERROR_NO_MORE_FRAMES = 31, /*
81 There are no Java programming language or JNI stack frames at the specified depth. */
82 JVMTI_ERROR_OPAQUE_FRAME = 32, /*
83 Information about the frame is not available = e.g. for native frames, */
84 JVMTI_ERROR_DUPLICATE = 40, /*
86 JVMTI_ERROR_NOT_FOUND = 41, /*
87 Desired element = e.g. field or breakpoint, not found */
88 JVMTI_ERROR_NOT_MONITOR_OWNER = 51, /*
89 This thread doesn't own the raw monitor. */
90 JVMTI_ERROR_INTERRUPT = 52, /*
91 The call has been interrupted before completion. */
92 JVMTI_ERROR_UNMODIFIABLE_CLASS = 79, /*
93 The class cannot be modified. */
94 JVMTI_ERROR_NOT_AVAILABLE = 98, /*
95 The functionality is not available in this virtual machine. */
96 JVMTI_ERROR_ABSENT_INFORMATION = 101, /*
97 The requested information is not available. */
98 JVMTI_ERROR_INVALID_EVENT_TYPE = 102, /*
99 The specified event type ID is not recognized. */
100 JVMTI_ERROR_NATIVE_METHOD = 104, /*
101 The requested information is not available for native method.
102 Function Specific Agent Errors
103 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. */
104 JVMTI_ERROR_INVALID_THREAD = 10, /*
105 The passed thread is not a valid thread.*/
106 JVMTI_ERROR_INVALID_FIELDID = 25, /*
108 JVMTI_ERROR_INVALID_METHODID = 23, /*
110 JVMTI_ERROR_INVALID_LOCATION = 24, /*
112 JVMTI_ERROR_INVALID_OBJECT = 20, /*
114 JVMTI_ERROR_INVALID_CLASS = 21, /*
116 JVMTI_ERROR_TYPE_MISMATCH = 34, /*
117 The variable is not an appropriate type for the function used. */
118 JVMTI_ERROR_INVALID_SLOT = 35, /*
120 JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99, /*
121 The capability being used is false in this environment. */
122 JVMTI_ERROR_INVALID_THREAD_GROUP = 11, /*
123 Thread group invalid. */
124 JVMTI_ERROR_INVALID_MONITOR = 50, /*
125 Invalid raw monitor. */
126 JVMTI_ERROR_ILLEGAL_ARGUMENT = 103, /*
128 JVMTI_ERROR_INVALID_TYPESTATE = 65, /*
129 The state of the thread has been modified, and is now inconsistent. */
130 JVMTI_ERROR_UNSUPPORTED_VERSION = 68, /*
131 A new class file has a version number not supported by this VM. */
132 JVMTI_ERROR_INVALID_CLASS_FORMAT = 60, /*
133 A new class file is malformed = the VM would return a ClassFormatError, */
134 JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61, /*
135 The new class file definitions would lead to a circular definition = the VM would return a ClassCircularityError, */
136 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63, /*
137 A new class file would require adding a method. */
138 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64, /*
139 A new class version changes a field. */
140 JVMTI_ERROR_FAILS_VERIFICATION = 62, /*
141 The class bytes fail verification. */
142 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66, /*
143 A direct superclass is different for the new class version, or the set of directly implemented interfaces is different. */
144 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67, /*
145 A new class version does not declare a method declared in the old class version. */
146 JVMTI_ERROR_NAMES_DONT_MATCH = 69, /*
147 The class name defined in the new class file is different from the name in the old class object. */
148 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70, /*
149 A new class version has different modifiers. */
150 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71 /*
151 A method in the new class version has different modifiers than its counterpart in the old class version.*/
157 JVMTI_PHASE_ONLOAD = 1,
158 JVMTI_PHASE_PRIMORDIAL = 2,
159 JVMTI_PHASE_START = 6,
160 JVMTI_PHASE_LIVE = 4,
166 JVMTI_JLOCATION_JVMBCI = 1,
167 JVMTI_JLOCATION_MACHINEPC = 2,
168 JVMTI_JLOCATION_OTHER = 0
169 } jvmtiJlocationFormat;
172 jlocation start_location;
174 } jvmtiLineNumberEntry;
180 jthreadGroup thread_group;
181 jobject context_class_loader;
185 JVMTI_VERBOSE_OTHER = 0,
186 JVMTI_VERBOSE_GC = 1,
187 JVMTI_VERBOSE_CLASS = 2,
188 JVMTI_VERBOSE_JNI = 4
193 jint class_byte_count;
194 const unsigned char* class_bytes;
195 } jvmtiClassDefinition;
197 typedef struct JNINativeInterface jniNativeInterface;
200 const void* start_address;
202 } jvmtiAddrLocationMap;
205 typedef void (JNICALL *jvmtiEventSingleStep)
206 (jvmtiEnv *jvmti_env,
212 typedef void (JNICALL *jvmtiEventBreakpoint)
213 (jvmtiEnv *jvmti_env,
219 typedef void (JNICALL *jvmtiEventFieldAccess)
220 (jvmtiEnv *jvmti_env,
229 typedef void (JNICALL *jvmtiEventFieldModification)
230 (jvmtiEnv *jvmti_env,
241 typedef void (JNICALL *jvmtiEventFramePop)
242 (jvmtiEnv *jvmti_env,
246 jboolean was_popped_by_exception);
248 typedef void (JNICALL *jvmtiEventMethodEntry)
249 (jvmtiEnv *jvmti_env,
254 typedef void (JNICALL *jvmtiEventMethodExit)
255 (jvmtiEnv *jvmti_env,
259 jboolean was_popped_by_exception,
260 jvalue return_value);
262 typedef void (JNICALL *jvmtiEventNativeMethodBind)
263 (jvmtiEnv *jvmti_env,
268 void** new_address_ptr);
270 typedef void (JNICALL *jvmtiEventException)
271 (jvmtiEnv *jvmti_env,
277 jmethodID catch_method,
278 jlocation catch_location);
280 typedef void (JNICALL *jvmtiEventExceptionCatch)
281 (jvmtiEnv *jvmti_env,
288 typedef void (JNICALL *jvmtiEventThreadStart)
289 (jvmtiEnv *jvmti_env,
293 typedef void (JNICALL *jvmtiEventThreadEnd)
294 (jvmtiEnv *jvmti_env,
298 typedef void (JNICALL *jvmtiEventClassLoad)
299 (jvmtiEnv *jvmti_env,
304 typedef void (JNICALL *jvmtiEventClassPrepare)
305 (jvmtiEnv *jvmti_env,
310 typedef void (JNICALL *jvmtiEventClassFileLoadHook)
311 (jvmtiEnv *jvmti_env,
313 jclass class_being_redefined,
316 jobject protection_domain,
318 const unsigned char* class_data,
319 jint* new_class_data_len,
320 unsigned char** new_class_data);
322 typedef void (JNICALL *jvmtiEventVMStart)
323 (jvmtiEnv *jvmti_env,
326 typedef void (JNICALL *jvmtiEventVMInit)
327 (jvmtiEnv *jvmti_env,
331 typedef void (JNICALL *jvmtiEventVMDeath)
332 (jvmtiEnv *jvmti_env,
336 typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
337 (jvmtiEnv *jvmti_env,
340 const void* code_addr,
342 const jvmtiAddrLocationMap* map,
343 const void* compile_info);
345 typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
346 (jvmtiEnv *jvmti_env,
348 const void* code_addr);
350 typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
351 (jvmtiEnv *jvmti_env,
356 typedef void (JNICALL *jvmtiEventDataDumpRequest)
357 (jvmtiEnv *jvmti_env);
359 typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
360 (jvmtiEnv *jvmti_env,
365 typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
366 (jvmtiEnv *jvmti_env,
371 typedef void (JNICALL *jvmtiEventMonitorWait)
372 (jvmtiEnv *jvmti_env,
378 typedef void (JNICALL *jvmtiEventMonitorWaited)
379 (jvmtiEnv *jvmti_env,
385 typedef void (JNICALL *jvmtiEventVMObjectAlloc)
386 (jvmtiEnv *jvmti_env,
393 typedef void (JNICALL *jvmtiEventObjectFree)
394 (jvmtiEnv *jvmti_env,
397 typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
398 (jvmtiEnv *jvmti_env);
400 typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
401 (jvmtiEnv *jvmti_env);
403 typedef void (JNICALL *jvmtiStartFunction)
404 (jvmtiEnv* jvmti_env,
413 } jvmtiThreadGroupInfo;
420 jint notify_waiter_count;
421 jthread* notify_waiters;
425 jlocation start_location;
429 char* generic_signature;
431 } jvmtiLocalVariableEntry;
441 jvmtiFrameInfo* frame_buffer;
446 JVMTI_HEAP_OBJECT_TAGGED = 1,
447 JVMTI_HEAP_OBJECT_UNTAGGED = 2,
448 JVMTI_HEAP_OBJECT_EITHER = 3
449 } jvmtiHeapObjectFilter;
452 JVMTI_REFERENCE_CLASS = 1,
453 JVMTI_REFERENCE_FIELD = 2,
454 JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
455 JVMTI_REFERENCE_CLASS_LOADER = 4,
456 JVMTI_REFERENCE_SIGNERS = 5,
457 JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
458 JVMTI_REFERENCE_INTERFACE = 7,
459 JVMTI_REFERENCE_STATIC_FIELD = 8,
460 JVMTI_REFERENCE_CONSTANT_POOL = 9
461 } jvmtiObjectReferenceKind;
464 JVMTI_ITERATION_CONTINUE = 1,
465 JVMTI_ITERATION_IGNORE = 2,
466 JVMTI_ITERATION_ABORT = 0
467 } jvmtiIterationControl;
470 JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
471 JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
472 JVMTI_HEAP_ROOT_MONITOR = 3,
473 JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
474 JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
475 JVMTI_HEAP_ROOT_THREAD = 6,
476 JVMTI_HEAP_ROOT_OTHER = 7
479 typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
480 (jvmtiObjectReferenceKind reference_kind,
488 typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
489 (jvmtiHeapRootKind root_kind,
495 typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
496 (jvmtiHeapRootKind root_kind,
506 typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
512 typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
513 (jvmtiEnv* jvmti_env,
518 JVMTI_KIND_IN_PTR = 92,
519 JVMTI_KIND_IN_BUF = 93,
520 JVMTI_KIND_ALLOC_BUF = 94,
521 JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
523 JVMTI_KIND_OUT_BUF = 97
527 JVMTI_TYPE_JBYTE = 101,
528 JVMTI_TYPE_JCHAR = 102,
529 JVMTI_TYPE_JSHORT = 103,
530 JVMTI_TYPE_JINT = 104,
531 JVMTI_TYPE_JLONG = 105,
532 JVMTI_TYPE_JFLOAT = 106,
533 JVMTI_TYPE_JDOUBLE = 107,
534 JVMTI_TYPE_JBOOLEAN = 108,
535 JVMTI_TYPE_JOBJECT = 109,
536 JVMTI_TYPE_JTHREAD = 110,
537 JVMTI_TYPE_JCLASS = 111,
538 JVMTI_TYPE_JVALUE = 112,
539 JVMTI_TYPE_JFIELDID = 113,
540 JVMTI_TYPE_JMETHODID = 114,
541 JVMTI_TYPE_CCHAR = 115,
542 JVMTI_TYPE_CVOID = 116,
543 JVMTI_TYPE_JNIENV = 117
549 jvmtiParamTypes base_type;
554 jint extension_event_index;
556 char* short_description;
558 jvmtiParamInfo* params;
559 } jvmtiExtensionEventInfo;
561 typedef void (JNICALL *jvmtiExtensionEvent)
562 (jvmtiEnv* jvmti_env,
566 JVMTI_TIMER_USER_CPU = 30,
567 JVMTI_TIMER_TOTAL_CPU = 31,
568 JVMTI_TIMER_ELAPSED = 32
573 jboolean may_skip_forward;
574 jboolean may_skip_backward;
581 jvmtiExtensionFunction func;
583 char* short_description;
585 jvmtiParamInfo* params;
588 } jvmtiExtensionFunctionInfo;
590 typedef void* jvmtiEventReserved;
593 jvmtiEventVMInit VMInit;
594 jvmtiEventVMDeath VMDeath;
595 jvmtiEventThreadStart ThreadStart;
596 jvmtiEventThreadEnd ThreadEnd;
597 jvmtiEventClassFileLoadHook ClassFileLoadHook;
598 jvmtiEventClassLoad ClassLoad;
599 jvmtiEventClassPrepare ClassPrepare;
600 jvmtiEventVMStart VMStart;
601 jvmtiEventException Exception;
602 jvmtiEventExceptionCatch ExceptionCatch;
603 jvmtiEventSingleStep SingleStep;
604 jvmtiEventFramePop FramePop;
605 jvmtiEventBreakpoint Breakpoint;
606 jvmtiEventFieldAccess FieldAccess;
607 jvmtiEventFieldModification FieldModification;
608 jvmtiEventMethodEntry MethodEntry;
609 jvmtiEventMethodExit MethodExit;
610 jvmtiEventNativeMethodBind NativeMethodBind;
611 jvmtiEventCompiledMethodLoad CompiledMethodLoad;
612 jvmtiEventCompiledMethodUnload CompiledMethodUnload;
613 jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
614 jvmtiEventDataDumpRequest DataDumpRequest;
615 jvmtiEventReserved reserved72;
616 jvmtiEventMonitorWait MonitorWait;
617 jvmtiEventMonitorWaited MonitorWaited;
618 jvmtiEventMonitorContendedEnter MonitorContendedEnter;
619 jvmtiEventMonitorContendedEntered MonitorContendedEntered;
620 jvmtiEventReserved reserved77;
621 jvmtiEventReserved reserved78;
622 jvmtiEventReserved reserved79;
623 jvmtiEventReserved reserved80;
624 jvmtiEventGarbageCollectionStart GarbageCollectionStart;
625 jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
626 jvmtiEventObjectFree ObjectFree;
627 jvmtiEventVMObjectAlloc VMObjectAlloc;
628 } jvmtiEventCallbacks;
636 JVMTI_EVENT_START_ENUM = 50,
637 JVMTI_EVENT_VM_INIT = 50,
638 JVMTI_EVENT_VM_DEATH = 51,
639 JVMTI_EVENT_THREAD_START = 52,
640 JVMTI_EVENT_THREAD_END = 53,
641 JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
642 JVMTI_EVENT_CLASS_LOAD = 55,
643 JVMTI_EVENT_CLASS_PREPARE = 56,
644 JVMTI_EVENT_VM_START = 57,
645 JVMTI_EVENT_EXCEPTION = 58,
646 JVMTI_EVENT_EXCEPTION_CATCH = 59,
647 JVMTI_EVENT_SINGLE_STEP = 60,
648 JVMTI_EVENT_FRAME_POP = 61,
649 JVMTI_EVENT_BREAKPOINT = 62,
650 JVMTI_EVENT_FIELD_ACCESS = 63,
651 JVMTI_EVENT_FIELD_MODIFICATION = 64,
652 JVMTI_EVENT_METHOD_ENTRY = 65,
653 JVMTI_EVENT_METHOD_EXIT = 66,
654 JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
655 JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
656 JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
657 JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
658 JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
659 JVMTI_EVENT_MONITOR_WAIT = 73,
660 JVMTI_EVENT_MONITOR_WAITED = 74,
661 JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
662 JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
663 JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
664 JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
665 JVMTI_EVENT_OBJECT_FREE = 83,
666 JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
667 JVMTI_EVENT_END_ENUM = 84
672 unsigned int can_tag_objects : 1;
673 unsigned int can_generate_field_modification_events : 1;
674 unsigned int can_generate_field_access_events : 1;
675 unsigned int can_get_bytecodes : 1;
676 unsigned int can_get_synthetic_attribute : 1;
677 unsigned int can_get_owned_monitor_info : 1;
678 unsigned int can_get_current_contended_monitor : 1;
679 unsigned int can_get_monitor_info : 1;
680 unsigned int can_pop_frame : 1;
681 unsigned int can_redefine_classes : 1;
682 unsigned int can_signal_thread : 1;
683 unsigned int can_get_source_file_name : 1;
684 unsigned int can_get_line_numbers : 1;
685 unsigned int can_get_source_debug_extension : 1;
686 unsigned int can_access_local_variables : 1;
687 unsigned int can_maintain_original_method_order : 1;
688 unsigned int can_generate_single_step_events : 1;
689 unsigned int can_generate_exception_events : 1;
690 unsigned int can_generate_frame_pop_events : 1;
691 unsigned int can_generate_breakpoint_events : 1;
692 unsigned int can_suspend : 1;
693 unsigned int can_redefine_any_class : 1;
694 unsigned int can_get_current_thread_cpu_time : 1;
695 unsigned int can_get_thread_cpu_time : 1;
696 unsigned int can_generate_method_entry_events : 1;
697 unsigned int can_generate_method_exit_events : 1;
698 unsigned int can_generate_all_class_hook_events : 1;
699 unsigned int can_generate_compiled_method_load_events : 1;
700 unsigned int can_generate_monitor_events : 1;
701 unsigned int can_generate_vm_object_alloc_events : 1;
702 unsigned int can_generate_native_method_bind_events : 1;
703 unsigned int can_generate_garbage_collection_events : 1;
704 unsigned int can_generate_object_free_events : 1;
717 /* Function Interface */
718 struct jvmtiEnv_struct {
720 jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env,
722 jvmtiEvent event_type,
723 jthread event_thread,
726 jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env,
727 jint* threads_count_ptr,
728 jthread** threads_ptr);
729 jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env,
731 jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env,
733 jvmtiError (JNICALL *StopThread) (jvmtiEnv* env,
736 jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env,
738 jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env,
740 jvmtiThreadInfo* info_ptr);
741 jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env,
743 jint* owned_monitor_count_ptr,
744 jobject** owned_monitors_ptr);
745 jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env,
747 jobject* monitor_ptr);
748 jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env,
750 jvmtiStartFunction proc,
753 jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env,
754 jint* group_count_ptr,
755 jthreadGroup** groups_ptr);
756 jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env,
758 jvmtiThreadGroupInfo* info_ptr);
759 jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env,
761 jint* thread_count_ptr,
762 jthread** threads_ptr,
763 jint* group_count_ptr,
764 jthreadGroup** groups_ptr);
765 jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env,
768 jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env,
770 jint* thread_state_ptr);
772 jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env,
775 jmethodID* method_ptr,
776 jlocation* location_ptr);
777 jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env,
780 jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env,
785 jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env,
790 jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env,
795 jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env,
800 jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env,
805 jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env,
810 jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env,
815 jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env,
820 jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env,
825 jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env,
830 jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env,
832 jrawMonitorID* monitor_ptr);
833 jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env,
834 jrawMonitorID monitor);
835 jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env,
836 jrawMonitorID monitor);
837 jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env,
838 jrawMonitorID monitor);
839 jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env,
840 jrawMonitorID monitor,
842 jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env,
843 jrawMonitorID monitor);
844 jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env,
845 jrawMonitorID monitor);
846 jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env,
849 jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env,
853 jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env,
856 jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env,
859 jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env,
862 jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env,
866 jvmtiError (JNICALL *Allocate) (jvmtiEnv* env,
868 unsigned char** mem_ptr);
869 jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env,
871 jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env,
873 char** signature_ptr,
875 jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env,
878 jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env,
880 char** source_name_ptr);
881 jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env,
883 jint* modifiers_ptr);
884 jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env,
886 jint* method_count_ptr,
887 jmethodID** methods_ptr);
888 jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env,
890 jint* field_count_ptr,
891 jfieldID** fields_ptr);
892 jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env,
894 jint* interface_count_ptr,
895 jclass** interfaces_ptr);
896 jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env,
898 jboolean* is_interface_ptr);
899 jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env,
901 jboolean* is_array_class_ptr);
902 jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env,
904 jobject* classloader_ptr);
905 jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env,
907 jint* hash_code_ptr);
908 jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env,
910 jvmtiMonitorUsage* info_ptr);
911 jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env,
915 char** signature_ptr,
917 jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env,
920 jclass* declaring_class_ptr);
921 jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env,
924 jint* modifiers_ptr);
925 jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env,
928 jboolean* is_synthetic_ptr);
929 jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env,
932 char** signature_ptr,
934 jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env,
936 jclass* declaring_class_ptr);
937 jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env,
939 jint* modifiers_ptr);
941 jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env,
944 jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env,
947 jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env,
949 jint* entry_count_ptr,
950 jvmtiLineNumberEntry** table_ptr);
951 jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env,
953 jlocation* start_location_ptr,
954 jlocation* end_location_ptr);
955 jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env,
957 jint* entry_count_ptr,
958 jvmtiLocalVariableEntry** table_ptr);
961 jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env,
963 jint* bytecode_count_ptr,
964 unsigned char** bytecodes_ptr);
965 jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env,
967 jboolean* is_native_ptr);
968 jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env,
970 jboolean* is_synthetic_ptr);
971 jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env,
972 jint* class_count_ptr,
973 jclass** classes_ptr);
974 jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env,
975 jobject initiating_loader,
976 jint* class_count_ptr,
977 jclass** classes_ptr);
978 jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env,
986 jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env,
988 const jvmtiClassDefinition* class_definitions);
989 jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env,
991 jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env,
992 jvmtiCapabilities* capabilities_ptr);
993 jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env,
995 char** source_debug_extension_ptr);
996 jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env,
998 jboolean* is_obsolete_ptr);
999 jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env,
1001 const jthread* request_list,
1002 jvmtiError* results);
1003 jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env,
1005 const jthread* request_list,
1006 jvmtiError* results);
1013 jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env,
1014 jint max_frame_count,
1015 jvmtiStackInfo** stack_info_ptr,
1016 jint* thread_count_ptr);
1017 jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env,
1019 const jthread* thread_list,
1020 jint max_frame_count,
1021 jvmtiStackInfo** stack_info_ptr);
1022 jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env,
1025 jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env,
1028 jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env,
1031 jint max_frame_count,
1032 jvmtiFrameInfo* frame_buffer,
1035 jvmtiError (JNICALL *GetTag) (jvmtiEnv* env,
1038 jvmtiError (JNICALL *SetTag) (jvmtiEnv* env,
1041 jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env);
1042 jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env,
1044 jvmtiObjectReferenceCallback object_reference_callback,
1046 jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env,
1047 jvmtiHeapRootCallback heap_root_callback,
1048 jvmtiStackReferenceCallback stack_ref_callback,
1049 jvmtiObjectReferenceCallback object_ref_callback,
1051 jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env,
1052 jvmtiHeapObjectFilter object_filter,
1053 jvmtiHeapObjectCallback heap_object_callback,
1055 jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env,
1057 jvmtiHeapObjectFilter object_filter,
1058 jvmtiHeapObjectCallback heap_object_callback,
1061 jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env,
1065 jobject** object_result_ptr,
1066 jlong** tag_result_ptr);
1072 jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env,
1073 const jniNativeInterface* function_table);
1074 jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env,
1075 jniNativeInterface** function_table);
1076 jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env,
1077 const jvmtiEventCallbacks* callbacks,
1078 jint size_of_callbacks);
1079 jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env,
1080 jvmtiEvent event_type);
1081 jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env,
1082 jint* extension_count_ptr,
1083 jvmtiExtensionFunctionInfo** extensions);
1084 jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env,
1085 jint* extension_count_ptr,
1086 jvmtiExtensionEventInfo** extensions);
1087 jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env,
1088 jint extension_event_index,
1089 jvmtiExtensionEvent callback);
1090 jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env);
1091 jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env,
1094 jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env,
1095 jvmtiJlocationFormat* format_ptr);
1096 jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env,
1098 char*** property_ptr);
1099 jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env,
1100 const char* property,
1102 jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env,
1103 const char* property,
1105 jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env,
1106 jvmtiPhase* phase_ptr);
1107 jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env,
1108 jvmtiTimerInfo* info_ptr);
1109 jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env,
1111 jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env,
1112 jvmtiTimerInfo* info_ptr);
1113 jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env,
1116 jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env,
1117 jvmtiTimerInfo* info_ptr);
1118 jvmtiError (JNICALL *GetTime) (jvmtiEnv* env,
1120 jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env,
1121 jvmtiCapabilities* capabilities_ptr);
1123 jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env,
1124 const jvmtiCapabilities* capabilities_ptr);
1125 jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env,
1126 const jvmtiCapabilities* capabilities_ptr);
1127 jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env,
1128 jint* processor_count_ptr);
1131 jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env,
1133 jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env,
1135 jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env,
1136 const char* segment);
1137 jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env,
1138 jvmtiVerboseFlag flag,
1143 jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env,
1149 #define JVMTI_THREAD_STATE_ALIVE 0x0001
1150 #define JVMTI_THREAD_STATE_TERMINATED 0x0002
1151 #define JVMTI_THREAD_STATE_RUNNABLE 0x0004
1152 #define JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER 0x0400
1153 #define JVMTI_THREAD_STATE_WAITING 0x0080
1154 #define JVMTI_THREAD_STATE_WAITING_INDEFINITELY 0x0010
1155 #define JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT 0x0020
1156 #define JVMTI_THREAD_STATE_SLEEPING 0x0040
1157 #define JVMTI_THREAD_STATE_IN_OBJECT_WAIT 0x0100
1158 #define JVMTI_THREAD_STATE_PARKED 0x0200
1159 #define JVMTI_THREAD_STATE_SUSPENDED 0x100000
1160 #define JVMTI_THREAD_STATE_INTERRUPTED 0x200000
1161 #define JVMTI_THREAD_STATE_IN_NATIVE 0x400000
1162 #define JVMTI_THREAD_STATE_VENDOR_1 0x10000000
1163 #define JVMTI_THREAD_STATE_VENDOR_2 0x20000000
1164 #define JVMTI_THREAD_STATE_VENDOR_3 0x40000000
1166 #define JVMTI_THREAD_MIN_PRIORITY 1
1167 #define JVMTI_THREAD_NORM_PRIORITY 5
1168 #define JVMTI_THREAD_MAX_PRIORITY 10
1170 #define JVMTI_CLASS_STATUS_VERIFIED 1
1171 #define JVMTI_CLASS_STATUS_PREPARED 2
1172 #define JVMTI_CLASS_STATUS_INITIALIZED 4
1173 #define JVMTI_CLASS_STATUS_ERROR 8
1174 #define JVMTI_CLASS_STATUS_ARRAY 16
1175 #define JVMTI_CLASS_STATUS_PRIMITIVE 32
1183 * These are local overrides for various environment variables in Emacs.
1184 * Please do not remove this and leave it at the end of the file, where
1185 * Emacs will automagically detect them.
1186 * ---------------------------------------------------------------------
1189 * indent-tabs-mode: t