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
38 #include "native/jni.h"
41 #define JVMTI_VERSION_INTERFACE_JNI 0x00000000
42 #define JVMTI_VERSION_INTERFACE_JVMTI 0x30000000
43 #define JVMTI_VERSION_MASK_INTERFACE_TYPE 0x70000000
44 #define JVMTI_VERSION_1_0 0x30010000
45 #define JVMTI_VERSION JVMTI_VERSION_1_0
48 typedef jobject jthread;
49 typedef jobject jthreadGroup;
50 typedef jlong jlocation;
51 struct _jrawMonitorID;
52 typedef struct _jrawMonitorID *jrawMonitorID;
53 typedef struct jvmtiEnv_struct *jvmtiEnv;
56 JVMTI_ERROR_NONE = 0, /* No error has occurred. This is the error code that is
57 returned on successful completion of the function. */
58 JVMTI_ERROR_NULL_POINTER = 100, /* Pointer is unexpectedly NULL. */
59 JVMTI_ERROR_OUT_OF_MEMORY = 110, /* The function attempted to allocate memory
60 and no more memory was available for
62 JVMTI_ERROR_ACCESS_DENIED = 111, /* The desired functionality has not been
63 enabled in this virtual machine. */
64 JVMTI_ERROR_UNATTACHED_THREAD = 115, /* The thread being used to call this
65 function is not attached to the virtual
66 machine. Calls must be made from attached threads.
67 See AttachCurrentThread in the JNI invocation API. */
68 JVMTI_ERROR_INVALID_ENVIRONMENT = 116, /*
69 The JVM TI environment provided is no longer connected or is not an environment. */
70 JVMTI_ERROR_WRONG_PHASE = 112, /*
71 The desired functionality is not available in the current phase. Always returned if the virtual machine has completed running. */
72 JVMTI_ERROR_INTERNAL = 113, /*
73 An unexpected internal error has occurred. */
75 /* ****** Function Specific Required Errors ********** */
76 JVMTI_ERROR_INVALID_PRIORITY = 12, /*
78 JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13, /*
79 Thread was not suspended. */
80 JVMTI_ERROR_THREAD_SUSPENDED = 14, /*
81 Thread already suspended. */
82 JVMTI_ERROR_THREAD_NOT_ALIVE = 15, /*
83 This operation requires the thread to be alive--that is, it must be started and not yet have died. */
84 JVMTI_ERROR_CLASS_NOT_PREPARED = 22, /*
85 The class has been loaded but not yet prepared. */
86 JVMTI_ERROR_NO_MORE_FRAMES = 31, /*
87 There are no Java programming language or JNI stack frames at the specified depth. */
88 JVMTI_ERROR_OPAQUE_FRAME = 32, /*
89 Information about the frame is not available = e.g. for native frames, */
90 JVMTI_ERROR_DUPLICATE = 40, /*
92 JVMTI_ERROR_NOT_FOUND = 41, /*
93 Desired element = e.g. field or breakpoint, not found */
94 JVMTI_ERROR_NOT_MONITOR_OWNER = 51, /*
95 This thread doesn't own the raw monitor. */
96 JVMTI_ERROR_INTERRUPT = 52, /*
97 The call has been interrupted before completion. */
98 JVMTI_ERROR_UNMODIFIABLE_CLASS = 79, /*
99 The class cannot be modified. */
100 JVMTI_ERROR_NOT_AVAILABLE = 98, /*
101 The functionality is not available in this virtual machine. */
102 JVMTI_ERROR_ABSENT_INFORMATION = 101, /*
103 The requested information is not available. */
104 JVMTI_ERROR_INVALID_EVENT_TYPE = 102, /*
105 The specified event type ID is not recognized. */
106 JVMTI_ERROR_NATIVE_METHOD = 104, /*
107 The requested information is not available for native method.
108 Function Specific Agent Errors
109 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. */
110 JVMTI_ERROR_INVALID_THREAD = 10, /*
111 The passed thread is not a valid thread.*/
112 JVMTI_ERROR_INVALID_FIELDID = 25, /*
114 JVMTI_ERROR_INVALID_METHODID = 23, /*
116 JVMTI_ERROR_INVALID_LOCATION = 24, /*
118 JVMTI_ERROR_INVALID_OBJECT = 20, /*
120 JVMTI_ERROR_INVALID_CLASS = 21, /*
122 JVMTI_ERROR_TYPE_MISMATCH = 34, /*
123 The variable is not an appropriate type for the function used. */
124 JVMTI_ERROR_INVALID_SLOT = 35, /*
126 JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99, /*
127 The capability being used is false in this environment. */
128 JVMTI_ERROR_INVALID_THREAD_GROUP = 11, /*
129 Thread group invalid. */
130 JVMTI_ERROR_INVALID_MONITOR = 50, /*
131 Invalid raw monitor. */
132 JVMTI_ERROR_ILLEGAL_ARGUMENT = 103, /*
134 JVMTI_ERROR_INVALID_TYPESTATE = 65, /*
135 The state of the thread has been modified, and is now inconsistent. */
136 JVMTI_ERROR_UNSUPPORTED_VERSION = 68, /*
137 A new class file has a version number not supported by this VM. */
138 JVMTI_ERROR_INVALID_CLASS_FORMAT = 60, /*
139 A new class file is malformed = the VM would return a ClassFormatError, */
140 JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61, /*
141 The new class file definitions would lead to a circular definition = the VM would return a ClassCircularityError, */
142 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63, /*
143 A new class file would require adding a method. */
144 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64, /*
145 A new class version changes a field. */
146 JVMTI_ERROR_FAILS_VERIFICATION = 62, /*
147 The class bytes fail verification. */
148 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66, /*
149 A direct superclass is different for the new class version, or the set of directly implemented interfaces is different. */
150 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67, /*
151 A new class version does not declare a method declared in the old class version. */
152 JVMTI_ERROR_NAMES_DONT_MATCH = 69, /*
153 The class name defined in the new class file is different from the name in the old class object. */
154 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70, /*
155 A new class version has different modifiers. */
156 JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71 /*
157 A method in the new class version has different modifiers than its counterpart in the old class version.*/
163 JVMTI_PHASE_ONLOAD = 1,
164 JVMTI_PHASE_PRIMORDIAL = 2,
165 JVMTI_PHASE_START = 6,
166 JVMTI_PHASE_LIVE = 4,
172 JVMTI_JLOCATION_JVMBCI = 1,
173 JVMTI_JLOCATION_MACHINEPC = 2,
174 JVMTI_JLOCATION_OTHER = 0
175 } jvmtiJlocationFormat;
178 jlocation start_location;
180 } jvmtiLineNumberEntry;
186 jthreadGroup thread_group;
187 jobject context_class_loader;
191 JVMTI_VERBOSE_OTHER = 0,
192 JVMTI_VERBOSE_GC = 1,
193 JVMTI_VERBOSE_CLASS = 2,
194 JVMTI_VERBOSE_JNI = 4
199 jint class_byte_count;
200 const unsigned char* class_bytes;
201 } jvmtiClassDefinition;
203 typedef struct JNINativeInterface jniNativeInterface;
206 const void* start_address;
208 } jvmtiAddrLocationMap;
211 typedef void (JNICALL *jvmtiEventSingleStep)
212 (jvmtiEnv *jvmti_env,
218 typedef void (JNICALL *jvmtiEventBreakpoint)
219 (jvmtiEnv *jvmti_env,
225 typedef void (JNICALL *jvmtiEventFieldAccess)
226 (jvmtiEnv *jvmti_env,
235 typedef void (JNICALL *jvmtiEventFieldModification)
236 (jvmtiEnv *jvmti_env,
247 typedef void (JNICALL *jvmtiEventFramePop)
248 (jvmtiEnv *jvmti_env,
252 jboolean was_popped_by_exception);
254 typedef void (JNICALL *jvmtiEventMethodEntry)
255 (jvmtiEnv *jvmti_env,
260 typedef void (JNICALL *jvmtiEventMethodExit)
261 (jvmtiEnv *jvmti_env,
265 jboolean was_popped_by_exception,
266 jvalue return_value);
268 typedef void (JNICALL *jvmtiEventNativeMethodBind)
269 (jvmtiEnv *jvmti_env,
274 void** new_address_ptr);
276 typedef void (JNICALL *jvmtiEventException)
277 (jvmtiEnv *jvmti_env,
283 jmethodID catch_method,
284 jlocation catch_location);
286 typedef void (JNICALL *jvmtiEventExceptionCatch)
287 (jvmtiEnv *jvmti_env,
294 typedef void (JNICALL *jvmtiEventThreadStart)
295 (jvmtiEnv *jvmti_env,
299 typedef void (JNICALL *jvmtiEventThreadEnd)
300 (jvmtiEnv *jvmti_env,
304 typedef void (JNICALL *jvmtiEventClassLoad)
305 (jvmtiEnv *jvmti_env,
310 typedef void (JNICALL *jvmtiEventClassPrepare)
311 (jvmtiEnv *jvmti_env,
316 typedef void (JNICALL *jvmtiEventClassFileLoadHook)
317 (jvmtiEnv *jvmti_env,
319 jclass class_being_redefined,
322 jobject protection_domain,
324 const unsigned char* class_data,
325 jint* new_class_data_len,
326 unsigned char** new_class_data);
328 typedef void (JNICALL *jvmtiEventVMStart)
329 (jvmtiEnv *jvmti_env,
332 typedef void (JNICALL *jvmtiEventVMInit)
333 (jvmtiEnv *jvmti_env,
337 typedef void (JNICALL *jvmtiEventVMDeath)
338 (jvmtiEnv *jvmti_env,
342 typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
343 (jvmtiEnv *jvmti_env,
346 const void* code_addr,
348 const jvmtiAddrLocationMap* map,
349 const void* compile_info);
351 typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
352 (jvmtiEnv *jvmti_env,
354 const void* code_addr);
356 typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
357 (jvmtiEnv *jvmti_env,
362 typedef void (JNICALL *jvmtiEventDataDumpRequest)
363 (jvmtiEnv *jvmti_env);
365 typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
366 (jvmtiEnv *jvmti_env,
371 typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
372 (jvmtiEnv *jvmti_env,
377 typedef void (JNICALL *jvmtiEventMonitorWait)
378 (jvmtiEnv *jvmti_env,
384 typedef void (JNICALL *jvmtiEventMonitorWaited)
385 (jvmtiEnv *jvmti_env,
391 typedef void (JNICALL *jvmtiEventVMObjectAlloc)
392 (jvmtiEnv *jvmti_env,
399 typedef void (JNICALL *jvmtiEventObjectFree)
400 (jvmtiEnv *jvmti_env,
403 typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
404 (jvmtiEnv *jvmti_env);
406 typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
407 (jvmtiEnv *jvmti_env);
409 typedef void (JNICALL *jvmtiStartFunction)
410 (jvmtiEnv* jvmti_env,
419 } jvmtiThreadGroupInfo;
426 jint notify_waiter_count;
427 jthread* notify_waiters;
431 jlocation start_location;
435 char* generic_signature;
437 } jvmtiLocalVariableEntry;
447 jvmtiFrameInfo* frame_buffer;
452 JVMTI_HEAP_OBJECT_TAGGED = 1,
453 JVMTI_HEAP_OBJECT_UNTAGGED = 2,
454 JVMTI_HEAP_OBJECT_EITHER = 3
455 } jvmtiHeapObjectFilter;
458 JVMTI_REFERENCE_CLASS = 1,
459 JVMTI_REFERENCE_FIELD = 2,
460 JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
461 JVMTI_REFERENCE_CLASS_LOADER = 4,
462 JVMTI_REFERENCE_SIGNERS = 5,
463 JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
464 JVMTI_REFERENCE_INTERFACE = 7,
465 JVMTI_REFERENCE_STATIC_FIELD = 8,
466 JVMTI_REFERENCE_CONSTANT_POOL = 9
467 } jvmtiObjectReferenceKind;
470 JVMTI_ITERATION_CONTINUE = 1,
471 JVMTI_ITERATION_IGNORE = 2,
472 JVMTI_ITERATION_ABORT = 0
473 } jvmtiIterationControl;
476 JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
477 JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
478 JVMTI_HEAP_ROOT_MONITOR = 3,
479 JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
480 JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
481 JVMTI_HEAP_ROOT_THREAD = 6,
482 JVMTI_HEAP_ROOT_OTHER = 7
485 typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
486 (jvmtiObjectReferenceKind reference_kind,
494 typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
495 (jvmtiHeapRootKind root_kind,
501 typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
502 (jvmtiHeapRootKind root_kind,
512 typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
518 typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
519 (jvmtiEnv* jvmti_env,
524 JVMTI_KIND_IN_PTR = 92,
525 JVMTI_KIND_IN_BUF = 93,
526 JVMTI_KIND_ALLOC_BUF = 94,
527 JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
529 JVMTI_KIND_OUT_BUF = 97
533 JVMTI_TYPE_JBYTE = 101,
534 JVMTI_TYPE_JCHAR = 102,
535 JVMTI_TYPE_JSHORT = 103,
536 JVMTI_TYPE_JINT = 104,
537 JVMTI_TYPE_JLONG = 105,
538 JVMTI_TYPE_JFLOAT = 106,
539 JVMTI_TYPE_JDOUBLE = 107,
540 JVMTI_TYPE_JBOOLEAN = 108,
541 JVMTI_TYPE_JOBJECT = 109,
542 JVMTI_TYPE_JTHREAD = 110,
543 JVMTI_TYPE_JCLASS = 111,
544 JVMTI_TYPE_JVALUE = 112,
545 JVMTI_TYPE_JFIELDID = 113,
546 JVMTI_TYPE_JMETHODID = 114,
547 JVMTI_TYPE_CCHAR = 115,
548 JVMTI_TYPE_CVOID = 116,
549 JVMTI_TYPE_JNIENV = 117
555 jvmtiParamTypes base_type;
560 jint extension_event_index;
562 char* short_description;
564 jvmtiParamInfo* params;
565 } jvmtiExtensionEventInfo;
567 typedef void (JNICALL *jvmtiExtensionEvent)
568 (jvmtiEnv* jvmti_env,
572 JVMTI_TIMER_USER_CPU = 30,
573 JVMTI_TIMER_TOTAL_CPU = 31,
574 JVMTI_TIMER_ELAPSED = 32
579 jboolean may_skip_forward;
580 jboolean may_skip_backward;
587 jvmtiExtensionFunction func;
589 char* short_description;
591 jvmtiParamInfo* params;
594 } jvmtiExtensionFunctionInfo;
596 typedef void* jvmtiEventReserved;
599 jvmtiEventVMInit VMInit;
600 jvmtiEventVMDeath VMDeath;
601 jvmtiEventThreadStart ThreadStart;
602 jvmtiEventThreadEnd ThreadEnd;
603 jvmtiEventClassFileLoadHook ClassFileLoadHook;
604 jvmtiEventClassLoad ClassLoad;
605 jvmtiEventClassPrepare ClassPrepare;
606 jvmtiEventVMStart VMStart;
607 jvmtiEventException Exception;
608 jvmtiEventExceptionCatch ExceptionCatch;
609 jvmtiEventSingleStep SingleStep;
610 jvmtiEventFramePop FramePop;
611 jvmtiEventBreakpoint Breakpoint;
612 jvmtiEventFieldAccess FieldAccess;
613 jvmtiEventFieldModification FieldModification;
614 jvmtiEventMethodEntry MethodEntry;
615 jvmtiEventMethodExit MethodExit;
616 jvmtiEventNativeMethodBind NativeMethodBind;
617 jvmtiEventCompiledMethodLoad CompiledMethodLoad;
618 jvmtiEventCompiledMethodUnload CompiledMethodUnload;
619 jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
620 jvmtiEventDataDumpRequest DataDumpRequest;
621 jvmtiEventReserved reserved72;
622 jvmtiEventMonitorWait MonitorWait;
623 jvmtiEventMonitorWaited MonitorWaited;
624 jvmtiEventMonitorContendedEnter MonitorContendedEnter;
625 jvmtiEventMonitorContendedEntered MonitorContendedEntered;
626 jvmtiEventReserved reserved77;
627 jvmtiEventReserved reserved78;
628 jvmtiEventReserved reserved79;
629 jvmtiEventReserved reserved80;
630 jvmtiEventGarbageCollectionStart GarbageCollectionStart;
631 jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
632 jvmtiEventObjectFree ObjectFree;
633 jvmtiEventVMObjectAlloc VMObjectAlloc;
634 } jvmtiEventCallbacks;
642 JVMTI_EVENT_START_ENUM = 50,
643 JVMTI_EVENT_VM_INIT = 50,
644 JVMTI_EVENT_VM_DEATH = 51,
645 JVMTI_EVENT_THREAD_START = 52,
646 JVMTI_EVENT_THREAD_END = 53,
647 JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
648 JVMTI_EVENT_CLASS_LOAD = 55,
649 JVMTI_EVENT_CLASS_PREPARE = 56,
650 JVMTI_EVENT_VM_START = 57,
651 JVMTI_EVENT_EXCEPTION = 58,
652 JVMTI_EVENT_EXCEPTION_CATCH = 59,
653 JVMTI_EVENT_SINGLE_STEP = 60,
654 JVMTI_EVENT_FRAME_POP = 61,
655 JVMTI_EVENT_BREAKPOINT = 62,
656 JVMTI_EVENT_FIELD_ACCESS = 63,
657 JVMTI_EVENT_FIELD_MODIFICATION = 64,
658 JVMTI_EVENT_METHOD_ENTRY = 65,
659 JVMTI_EVENT_METHOD_EXIT = 66,
660 JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
661 JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
662 JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
663 JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
664 JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
665 JVMTI_EVENT_MONITOR_WAIT = 73,
666 JVMTI_EVENT_MONITOR_WAITED = 74,
667 JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
668 JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
669 JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
670 JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
671 JVMTI_EVENT_OBJECT_FREE = 83,
672 JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
673 JVMTI_EVENT_END_ENUM = 84
678 unsigned int can_tag_objects : 1;
679 unsigned int can_generate_field_modification_events : 1;
680 unsigned int can_generate_field_access_events : 1;
681 unsigned int can_get_bytecodes : 1;
682 unsigned int can_get_synthetic_attribute : 1;
683 unsigned int can_get_owned_monitor_info : 1;
684 unsigned int can_get_current_contended_monitor : 1;
685 unsigned int can_get_monitor_info : 1;
686 unsigned int can_pop_frame : 1;
687 unsigned int can_redefine_classes : 1;
688 unsigned int can_signal_thread : 1;
689 unsigned int can_get_source_file_name : 1;
690 unsigned int can_get_line_numbers : 1;
691 unsigned int can_get_source_debug_extension : 1;
692 unsigned int can_access_local_variables : 1;
693 unsigned int can_maintain_original_method_order : 1;
694 unsigned int can_generate_single_step_events : 1;
695 unsigned int can_generate_exception_events : 1;
696 unsigned int can_generate_frame_pop_events : 1;
697 unsigned int can_generate_breakpoint_events : 1;
698 unsigned int can_suspend : 1;
699 unsigned int can_redefine_any_class : 1;
700 unsigned int can_get_current_thread_cpu_time : 1;
701 unsigned int can_get_thread_cpu_time : 1;
702 unsigned int can_generate_method_entry_events : 1;
703 unsigned int can_generate_method_exit_events : 1;
704 unsigned int can_generate_all_class_hook_events : 1;
705 unsigned int can_generate_compiled_method_load_events : 1;
706 unsigned int can_generate_monitor_events : 1;
707 unsigned int can_generate_vm_object_alloc_events : 1;
708 unsigned int can_generate_native_method_bind_events : 1;
709 unsigned int can_generate_garbage_collection_events : 1;
710 unsigned int can_generate_object_free_events : 1;
723 /* Function Interface */
724 struct jvmtiEnv_struct {
726 jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env,
728 jvmtiEvent event_type,
729 jthread event_thread,
732 jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env,
733 jint* threads_count_ptr,
734 jthread** threads_ptr);
735 jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env,
737 jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env,
739 jvmtiError (JNICALL *StopThread) (jvmtiEnv* env,
742 jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env,
744 jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env,
746 jvmtiThreadInfo* info_ptr);
747 jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env,
749 jint* owned_monitor_count_ptr,
750 jobject** owned_monitors_ptr);
751 jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env,
753 jobject* monitor_ptr);
754 jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env,
756 jvmtiStartFunction proc,
759 jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env,
760 jint* group_count_ptr,
761 jthreadGroup** groups_ptr);
762 jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env,
764 jvmtiThreadGroupInfo* info_ptr);
765 jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env,
767 jint* thread_count_ptr,
768 jthread** threads_ptr,
769 jint* group_count_ptr,
770 jthreadGroup** groups_ptr);
771 jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env,
774 jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env,
776 jint* thread_state_ptr);
778 jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env,
781 jmethodID* method_ptr,
782 jlocation* location_ptr);
783 jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env,
786 jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env,
791 jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env,
796 jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env,
801 jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env,
806 jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env,
811 jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env,
816 jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env,
821 jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env,
826 jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env,
831 jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env,
836 jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env,
838 jrawMonitorID* monitor_ptr);
839 jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env,
840 jrawMonitorID monitor);
841 jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env,
842 jrawMonitorID monitor);
843 jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env,
844 jrawMonitorID monitor);
845 jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env,
846 jrawMonitorID monitor,
848 jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env,
849 jrawMonitorID monitor);
850 jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env,
851 jrawMonitorID monitor);
852 jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env,
855 jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env,
859 jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env,
862 jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env,
865 jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env,
868 jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env,
872 jvmtiError (JNICALL *Allocate) (jvmtiEnv* env,
874 unsigned char** mem_ptr);
875 jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env,
877 jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env,
879 char** signature_ptr,
881 jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env,
884 jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env,
886 char** source_name_ptr);
887 jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env,
889 jint* modifiers_ptr);
890 jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env,
892 jint* method_count_ptr,
893 jmethodID** methods_ptr);
894 jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env,
896 jint* field_count_ptr,
897 jfieldID** fields_ptr);
898 jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env,
900 jint* interface_count_ptr,
901 jclass** interfaces_ptr);
902 jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env,
904 jboolean* is_interface_ptr);
905 jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env,
907 jboolean* is_array_class_ptr);
908 jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env,
910 jobject* classloader_ptr);
911 jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env,
913 jint* hash_code_ptr);
914 jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env,
916 jvmtiMonitorUsage* info_ptr);
917 jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env,
921 char** signature_ptr,
923 jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env,
926 jclass* declaring_class_ptr);
927 jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env,
930 jint* modifiers_ptr);
931 jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env,
934 jboolean* is_synthetic_ptr);
935 jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env,
938 char** signature_ptr,
940 jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env,
942 jclass* declaring_class_ptr);
943 jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env,
945 jint* modifiers_ptr);
947 jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env,
950 jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env,
953 jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env,
955 jint* entry_count_ptr,
956 jvmtiLineNumberEntry** table_ptr);
957 jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env,
959 jlocation* start_location_ptr,
960 jlocation* end_location_ptr);
961 jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env,
963 jint* entry_count_ptr,
964 jvmtiLocalVariableEntry** table_ptr);
967 jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env,
969 jint* bytecode_count_ptr,
970 unsigned char** bytecodes_ptr);
971 jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env,
973 jboolean* is_native_ptr);
974 jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env,
976 jboolean* is_synthetic_ptr);
977 jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env,
978 jint* class_count_ptr,
979 jclass** classes_ptr);
980 jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env,
981 jobject initiating_loader,
982 jint* class_count_ptr,
983 jclass** classes_ptr);
984 jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env,
992 jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env,
994 const jvmtiClassDefinition* class_definitions);
995 jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env,
997 jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env,
998 jvmtiCapabilities* capabilities_ptr);
999 jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env,
1001 char** source_debug_extension_ptr);
1002 jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env,
1004 jboolean* is_obsolete_ptr);
1005 jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env,
1007 const jthread* request_list,
1008 jvmtiError* results);
1009 jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env,
1011 const jthread* request_list,
1012 jvmtiError* results);
1019 jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env,
1020 jint max_frame_count,
1021 jvmtiStackInfo** stack_info_ptr,
1022 jint* thread_count_ptr);
1023 jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env,
1025 const jthread* thread_list,
1026 jint max_frame_count,
1027 jvmtiStackInfo** stack_info_ptr);
1028 jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env,
1031 jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env,
1034 jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env,
1037 jint max_frame_count,
1038 jvmtiFrameInfo* frame_buffer,
1041 jvmtiError (JNICALL *GetTag) (jvmtiEnv* env,
1044 jvmtiError (JNICALL *SetTag) (jvmtiEnv* env,
1047 jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env);
1048 jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env,
1050 jvmtiObjectReferenceCallback object_reference_callback,
1052 jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env,
1053 jvmtiHeapRootCallback heap_root_callback,
1054 jvmtiStackReferenceCallback stack_ref_callback,
1055 jvmtiObjectReferenceCallback object_ref_callback,
1057 jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env,
1058 jvmtiHeapObjectFilter object_filter,
1059 jvmtiHeapObjectCallback heap_object_callback,
1061 jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env,
1063 jvmtiHeapObjectFilter object_filter,
1064 jvmtiHeapObjectCallback heap_object_callback,
1067 jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env,
1071 jobject** object_result_ptr,
1072 jlong** tag_result_ptr);
1078 jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env,
1079 const jniNativeInterface* function_table);
1080 jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env,
1081 jniNativeInterface** function_table);
1082 jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env,
1083 const jvmtiEventCallbacks* callbacks,
1084 jint size_of_callbacks);
1085 jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env,
1086 jvmtiEvent event_type);
1087 jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env,
1088 jint* extension_count_ptr,
1089 jvmtiExtensionFunctionInfo** extensions);
1090 jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env,
1091 jint* extension_count_ptr,
1092 jvmtiExtensionEventInfo** extensions);
1093 jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env,
1094 jint extension_event_index,
1095 jvmtiExtensionEvent callback);
1096 jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env);
1097 jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env,
1100 jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env,
1101 jvmtiJlocationFormat* format_ptr);
1102 jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env,
1104 char*** property_ptr);
1105 jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env,
1106 const char* property,
1108 jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env,
1109 const char* property,
1111 jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env,
1112 jvmtiPhase* phase_ptr);
1113 jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env,
1114 jvmtiTimerInfo* info_ptr);
1115 jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env,
1117 jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env,
1118 jvmtiTimerInfo* info_ptr);
1119 jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env,
1122 jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env,
1123 jvmtiTimerInfo* info_ptr);
1124 jvmtiError (JNICALL *GetTime) (jvmtiEnv* env,
1126 jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env,
1127 jvmtiCapabilities* capabilities_ptr);
1129 jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env,
1130 const jvmtiCapabilities* capabilities_ptr);
1131 jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env,
1132 const jvmtiCapabilities* capabilities_ptr);
1133 jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env,
1134 jint* processor_count_ptr);
1137 jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env,
1139 jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env,
1141 jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env,
1142 const char* segment);
1143 jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env,
1144 jvmtiVerboseFlag flag,
1149 jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env,
1155 #define JVMTI_THREAD_STATE_ALIVE 0x0001
1156 #define JVMTI_THREAD_STATE_TERMINATED 0x0002
1157 #define JVMTI_THREAD_STATE_RUNNABLE 0x0004
1158 #define JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER 0x0400
1159 #define JVMTI_THREAD_STATE_WAITING 0x0080
1160 #define JVMTI_THREAD_STATE_WAITING_INDEFINITELY 0x0010
1161 #define JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT 0x0020
1162 #define JVMTI_THREAD_STATE_SLEEPING 0x0040
1163 #define JVMTI_THREAD_STATE_IN_OBJECT_WAIT 0x0100
1164 #define JVMTI_THREAD_STATE_PARKED 0x0200
1165 #define JVMTI_THREAD_STATE_SUSPENDED 0x100000
1166 #define JVMTI_THREAD_STATE_INTERRUPTED 0x200000
1167 #define JVMTI_THREAD_STATE_IN_NATIVE 0x400000
1168 #define JVMTI_THREAD_STATE_VENDOR_1 0x10000000
1169 #define JVMTI_THREAD_STATE_VENDOR_2 0x20000000
1170 #define JVMTI_THREAD_STATE_VENDOR_3 0x40000000
1172 #define JVMTI_THREAD_MIN_PRIORITY 1
1173 #define JVMTI_THREAD_NORM_PRIORITY 5
1174 #define JVMTI_THREAD_MAX_PRIORITY 10
1176 #define JVMTI_CLASS_STATUS_VERIFIED 1
1177 #define JVMTI_CLASS_STATUS_PREPARED 2
1178 #define JVMTI_CLASS_STATUS_INITIALIZED 4
1179 #define JVMTI_CLASS_STATUS_ERROR 8
1180 #define JVMTI_CLASS_STATUS_ARRAY 16
1181 #define JVMTI_CLASS_STATUS_PRIMITIVE 32
1189 * These are local overrides for various environment variables in Emacs.
1190 * Please do not remove this and leave it at the end of the file, where
1191 * Emacs will automagically detect them.
1192 * ---------------------------------------------------------------------
1195 * indent-tabs-mode: t