jvmti2_sys/
lib.rs

1#![allow(non_snake_case, non_camel_case_types, unused)]
2#![warn(rust_2018_idioms, missing_debug_implementations)]
3
4use core::ffi::{c_char, c_uchar, c_uint, c_void};
5
6use bitflags::bitflags;
7use jni_sys::{
8    jboolean, jchar, jclass, jdouble, jfieldID, jfloat, jint, jlong, jmethodID, jobject, jvalue,
9    JNIEnv, JNIEnv_, JNINativeInterface_,
10};
11use jni_sys_macros::jni_to_union;
12
13pub mod jvmticmlr;
14
15pub const JVMTI_VERSION_1: jint = 0x30010000;
16pub const JVMTI_VERSION_1_0: jint = 0x30010000;
17pub const JVMTI_VERSION_1_1: jint = 0x30010100;
18pub const JVMTI_VERSION_1_2: jint = 0x30010200;
19
20pub type Agent_OnLoad =
21    extern "system" fn(vm: *mut JNIEnv, options: *mut c_char, reserved: *mut c_void) -> jint;
22pub type Agent_OnAttach =
23    extern "system" fn(vm: *mut JNIEnv, options: *mut c_char, reserved: *mut c_void) -> jint;
24pub type Agent_OnUnload = extern "system" fn(vm: *mut jni_sys::JavaVM);
25
26pub type jvmtiEnv = *const jvmtiInterface_1_;
27
28pub type jthread = jobject;
29pub type jthreadGroup = jobject;
30pub type jlocation = jlong;
31
32#[derive(Debug)]
33pub struct _jrawMonitorID {}
34pub type jrawMonitorID = *mut _jrawMonitorID;
35pub type jniNativeInterface = JNINativeInterface_;
36
37pub const JVMTI_THREAD_STATE_ALIVE: c_uint = 1;
38pub const JVMTI_THREAD_STATE_TERMINATED: c_uint = 2;
39pub const JVMTI_THREAD_STATE_RUNNABLE: c_uint = 4;
40pub const JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER: c_uint = 1024;
41pub const JVMTI_THREAD_STATE_WAITING: c_uint = 128;
42pub const JVMTI_THREAD_STATE_WAITING_INDEFINITELY: c_uint = 16;
43pub const JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT: c_uint = 32;
44pub const JVMTI_THREAD_STATE_SLEEPING: c_uint = 64;
45pub const JVMTI_THREAD_STATE_IN_OBJECT_WAIT: c_uint = 256;
46pub const JVMTI_THREAD_STATE_PARKED: c_uint = 512;
47pub const JVMTI_THREAD_STATE_SUSPENDED: c_uint = 1048576;
48pub const JVMTI_THREAD_STATE_INTERRUPTED: c_uint = 2097152;
49pub const JVMTI_THREAD_STATE_IN_NATIVE: c_uint = 4194304;
50pub const JVMTI_THREAD_STATE_VENDOR_1: c_uint = 268435456;
51pub const JVMTI_THREAD_STATE_VENDOR_2: c_uint = 536870912;
52pub const JVMTI_THREAD_STATE_VENDOR_3: c_uint = 1073741824;
53
54pub const JVMTI_JAVA_LANG_THREAD_STATE_MASK: c_uint = 1207;
55pub const JVMTI_JAVA_LANG_THREAD_STATE_NEW: c_uint = 0;
56pub const JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED: c_uint = 2;
57pub const JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE: c_uint = 5;
58pub const JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED: c_uint = 1025;
59pub const JVMTI_JAVA_LANG_THREAD_STATE_WAITING: c_uint = 145;
60pub const JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING: c_uint = 161;
61
62pub const JVMTI_THREAD_MIN_PRIORITY: c_uint = 1;
63pub const JVMTI_THREAD_NORM_PRIORITY: c_uint = 5;
64pub const JVMTI_THREAD_MAX_PRIORITY: c_uint = 10;
65
66pub const JVMTI_HEAP_FILTER_TAGGED: c_uint = 4;
67pub const JVMTI_HEAP_FILTER_UNTAGGED: c_uint = 8;
68pub const JVMTI_HEAP_FILTER_CLASS_TAGGED: c_uint = 16;
69pub const JVMTI_HEAP_FILTER_CLASS_UNTAGGED: c_uint = 32;
70
71pub const JVMTI_VISIT_OBJECTS: c_uint = 256;
72pub const JVMTI_VISIT_ABORT: c_uint = 32768;
73
74/* Heap Reference Enumeration */
75#[derive(Clone, Copy, Debug)]
76#[repr(C)]
77pub enum jvmtiHeapReferenceKind {
78    JVMTI_HEAP_REFERENCE_CLASS = 1,
79    JVMTI_HEAP_REFERENCE_FIELD = 2,
80    JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT = 3,
81    JVMTI_HEAP_REFERENCE_CLASS_LOADER = 4,
82    JVMTI_HEAP_REFERENCE_SIGNERS = 5,
83    JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN = 6,
84    JVMTI_HEAP_REFERENCE_INTERFACE = 7,
85    JVMTI_HEAP_REFERENCE_STATIC_FIELD = 8,
86    JVMTI_HEAP_REFERENCE_CONSTANT_POOL = 9,
87    JVMTI_HEAP_REFERENCE_SUPERCLASS = 10,
88    JVMTI_HEAP_REFERENCE_JNI_GLOBAL = 21,
89    JVMTI_HEAP_REFERENCE_SYSTEM_CLASS = 22,
90    JVMTI_HEAP_REFERENCE_MONITOR = 23,
91    JVMTI_HEAP_REFERENCE_STACK_LOCAL = 24,
92    JVMTI_HEAP_REFERENCE_JNI_LOCAL = 25,
93    JVMTI_HEAP_REFERENCE_THREAD = 26,
94    JVMTI_HEAP_REFERENCE_OTHER = 27,
95}
96
97/* Primitive Type Enumeration */
98#[derive(Clone, Copy, Debug)]
99#[repr(C)]
100pub enum jvmtiPrimitiveType {
101    JVMTI_PRIMITIVE_TYPE_BOOLEAN = 90,
102    JVMTI_PRIMITIVE_TYPE_BYTE = 66,
103    JVMTI_PRIMITIVE_TYPE_CHAR = 67,
104    JVMTI_PRIMITIVE_TYPE_SHORT = 83,
105    JVMTI_PRIMITIVE_TYPE_INT = 73,
106    JVMTI_PRIMITIVE_TYPE_LONG = 74,
107    JVMTI_PRIMITIVE_TYPE_FLOAT = 70,
108    JVMTI_PRIMITIVE_TYPE_DOUBLE = 68,
109}
110/* Heap Object Filter Enumeration */
111#[derive(Clone, Copy, Debug)]
112#[repr(C)]
113pub enum jvmtiHeapObjectFilter {
114    JVMTI_HEAP_OBJECT_TAGGED = 1,
115    JVMTI_HEAP_OBJECT_UNTAGGED = 2,
116    JVMTI_HEAP_OBJECT_EITHER = 3,
117}
118/* Heap Root Kind Enumeration */
119#[derive(Clone, Copy, Debug)]
120#[repr(C)]
121pub enum jvmtiHeapRootKind {
122    JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
123    JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
124    JVMTI_HEAP_ROOT_MONITOR = 3,
125    JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
126    JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
127    JVMTI_HEAP_ROOT_THREAD = 6,
128    JVMTI_HEAP_ROOT_OTHER = 7,
129}
130/* Object Reference Enumeration */
131#[derive(Clone, Copy, Debug)]
132#[repr(C)]
133pub enum jvmtiObjectReferenceKind {
134    JVMTI_REFERENCE_CLASS = 1,
135    JVMTI_REFERENCE_FIELD = 2,
136    JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
137    JVMTI_REFERENCE_CLASS_LOADER = 4,
138    JVMTI_REFERENCE_SIGNERS = 5,
139    JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
140    JVMTI_REFERENCE_INTERFACE = 7,
141    JVMTI_REFERENCE_STATIC_FIELD = 8,
142    JVMTI_REFERENCE_CONSTANT_POOL = 9,
143}
144/* Iteration Control Enumeration */
145#[derive(Clone, Copy, Debug)]
146#[repr(C)]
147pub enum jvmtiIterationControl {
148    JVMTI_ITERATION_CONTINUE = 1,
149    JVMTI_ITERATION_IGNORE = 2,
150    JVMTI_ITERATION_ABORT = 0,
151}
152/* Class Status Flags */
153pub const JVMTI_CLASS_STATUS_VERIFIED: c_uint = 1;
154pub const JVMTI_CLASS_STATUS_PREPARED: c_uint = 2;
155pub const JVMTI_CLASS_STATUS_INITIALIZED: c_uint = 4;
156pub const JVMTI_CLASS_STATUS_ERROR: c_uint = 8;
157pub const JVMTI_CLASS_STATUS_ARRAY: c_uint = 16;
158pub const JVMTI_CLASS_STATUS_PRIMITIVE: c_uint = 32;
159
160/* Event Enable/Disable */
161#[derive(Clone, Copy, Debug)]
162#[repr(C)]
163pub enum jvmtiEventMode {
164    JVMTI_ENABLE = 1,
165    JVMTI_DISABLE = 0,
166}
167
168/* Extension Function/Event Parameter Types */
169#[derive(Clone, Copy, Debug)]
170#[repr(C)]
171pub enum jvmtiParamTypes {
172    JVMTI_TYPE_JBYTE = 101,
173    JVMTI_TYPE_JCHAR = 102,
174    JVMTI_TYPE_JSHORT = 103,
175    JVMTI_TYPE_JINT = 104,
176    JVMTI_TYPE_JLONG = 105,
177    JVMTI_TYPE_JFLOAT = 106,
178    JVMTI_TYPE_JDOUBLE = 107,
179    JVMTI_TYPE_JBOOLEAN = 108,
180    JVMTI_TYPE_JOBJECT = 109,
181    JVMTI_TYPE_JTHREAD = 110,
182    JVMTI_TYPE_JCLASS = 111,
183    JVMTI_TYPE_JVALUE = 112,
184    JVMTI_TYPE_JFIELDID = 113,
185    JVMTI_TYPE_JMETHODID = 114,
186    JVMTI_TYPE_CCHAR = 115,
187    JVMTI_TYPE_CVOID = 116,
188    JVMTI_TYPE_JNIENV = 117,
189}
190
191/* Extension Function/Event Parameter Kinds */
192#[derive(Clone, Copy, Debug)]
193#[repr(C)]
194pub enum jvmtiParamKind {
195    JVMTI_KIND_IN = 91,
196    JVMTI_KIND_IN_PTR = 92,
197    JVMTI_KIND_IN_BUF = 93,
198    JVMTI_KIND_ALLOC_BUF = 94,
199    JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
200    JVMTI_KIND_OUT = 96,
201    JVMTI_KIND_OUT_BUF = 97,
202}
203
204#[derive(Clone, Copy, Debug)]
205#[repr(C)]
206/* Timer Kinds */
207pub enum jvmtiTimerKind {
208    JVMTI_TIMER_USER_CPU = 30,
209    JVMTI_TIMER_TOTAL_CPU = 31,
210    JVMTI_TIMER_ELAPSED = 32,
211}
212
213/* Phases of execution */
214#[derive(Clone, Copy, Debug)]
215#[repr(C)]
216pub enum jvmtiPhase {
217    JVMTI_PHASE_ONLOAD = 1,
218    JVMTI_PHASE_PRIMORDIAL = 2,
219    JVMTI_PHASE_START = 6,
220    JVMTI_PHASE_LIVE = 4,
221    JVMTI_PHASE_DEAD = 8,
222}
223/* Version Interface Types */
224pub const JVMTI_VERSION_INTERFACE_JNI: c_uint = 0x00000000;
225pub const JVMTI_VERSION_INTERFACE_JVMTI: c_uint = 0x30000000;
226/* Version Masks */
227
228pub const JVMTI_VERSION_MASK_INTERFACE_TYPE: c_uint = 0x70000000;
229pub const JVMTI_VERSION_MASK_MAJOR: c_uint = 0x0FFF0000;
230pub const JVMTI_VERSION_MASK_MINOR: c_uint = 0x0000FF00;
231pub const JVMTI_VERSION_MASK_MICRO: c_uint = 0x000000FF;
232
233/* Version Shifts */
234pub const JVMTI_VERSION_SHIFT_MAJOR: c_uint = 16;
235pub const JVMTI_VERSION_SHIFT_MINOR: c_uint = 8;
236pub const JVMTI_VERSION_SHIFT_MICRO: c_uint = 0;
237
238/* Verbose Flag Enumeration */
239#[derive(Clone, Copy, Debug)]
240#[repr(C)]
241pub enum jvmtiVerboseFlag {
242    JVMTI_VERBOSE_OTHER = 0,
243    JVMTI_VERBOSE_GC = 1,
244    JVMTI_VERBOSE_CLASS = 2,
245    JVMTI_VERBOSE_JNI = 4,
246}
247
248/* JLocation Format Enumeration */
249#[derive(Clone, Copy, Debug)]
250#[repr(C)]
251pub enum jvmtiJlocationFormat {
252    JVMTI_JLOCATION_JVMBCI = 1,
253    JVMTI_JLOCATION_MACHINEPC = 2,
254    JVMTI_JLOCATION_OTHER = 0,
255}
256/* Resource Exhaustion Flags */
257
258pub const JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR: jint = 0x0001;
259pub const JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP: jint = 0x0002;
260pub const JVMTI_RESOURCE_EXHAUSTED_THREADS: jint = 0x0004;
261
262bitflags! {
263    /// Represents the capabilities of the JVMTI agent.
264    #[derive(Clone,  Debug)]
265    #[repr(C)]
266    pub struct JVMTI_RESOURCE_EXHAUSTED_FLAGS: jint {
267        const OOM_ERROR = JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR;
268        const JAVA_HEAP = 0x0002;
269        const THREADS = 0x0004;
270    }
271}
272
273/* Errors */
274#[derive(Clone, Copy, Debug, PartialEq, Eq)]
275#[repr(C)]
276pub enum jvmtiError {
277    JVMTI_ERROR_NONE = 0,
278    JVMTI_ERROR_INVALID_THREAD = 10,
279    JVMTI_ERROR_INVALID_THREAD_GROUP = 11,
280    JVMTI_ERROR_INVALID_PRIORITY = 12,
281    JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13,
282    JVMTI_ERROR_THREAD_SUSPENDED = 14,
283    JVMTI_ERROR_THREAD_NOT_ALIVE = 15,
284    JVMTI_ERROR_INVALID_OBJECT = 20,
285    JVMTI_ERROR_INVALID_CLASS = 21,
286    JVMTI_ERROR_CLASS_NOT_PREPARED = 22,
287    JVMTI_ERROR_INVALID_METHODID = 23,
288    JVMTI_ERROR_INVALID_LOCATION = 24,
289    JVMTI_ERROR_INVALID_FIELDID = 25,
290    JVMTI_ERROR_INVALID_MODULE = 26,
291    JVMTI_ERROR_NO_MORE_FRAMES = 31,
292    JVMTI_ERROR_OPAQUE_FRAME = 32,
293    JVMTI_ERROR_TYPE_MISMATCH = 34,
294    JVMTI_ERROR_INVALID_SLOT = 35,
295    JVMTI_ERROR_DUPLICATE = 40,
296    JVMTI_ERROR_NOT_FOUND = 41,
297    JVMTI_ERROR_INVALID_MONITOR = 50,
298    JVMTI_ERROR_NOT_MONITOR_OWNER = 51,
299    JVMTI_ERROR_INTERRUPT = 52,
300    JVMTI_ERROR_INVALID_CLASS_FORMAT = 60,
301    JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61,
302    JVMTI_ERROR_FAILS_VERIFICATION = 62,
303    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63,
304    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64,
305    JVMTI_ERROR_INVALID_TYPESTATE = 65,
306    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66,
307    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67,
308    JVMTI_ERROR_UNSUPPORTED_VERSION = 68,
309    JVMTI_ERROR_NAMES_DONT_MATCH = 69,
310    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70,
311    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71,
312    JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED = 72,
313    JVMTI_ERROR_UNMODIFIABLE_CLASS = 79,
314    JVMTI_ERROR_UNMODIFIABLE_MODULE = 80,
315    JVMTI_ERROR_NOT_AVAILABLE = 98,
316    JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99,
317    JVMTI_ERROR_NULL_POINTER = 100,
318    JVMTI_ERROR_ABSENT_INFORMATION = 101,
319    JVMTI_ERROR_INVALID_EVENT_TYPE = 102,
320    JVMTI_ERROR_ILLEGAL_ARGUMENT = 103,
321    JVMTI_ERROR_NATIVE_METHOD = 104,
322    JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED = 106,
323    JVMTI_ERROR_OUT_OF_MEMORY = 110,
324    JVMTI_ERROR_ACCESS_DENIED = 111,
325    JVMTI_ERROR_WRONG_PHASE = 112,
326    JVMTI_ERROR_INTERNAL = 113,
327    JVMTI_ERROR_UNATTACHED_THREAD = 115,
328    JVMTI_ERROR_INVALID_ENVIRONMENT = 116,
329    // JVMTI_ERROR_MAX = 116
330}
331/* Event IDs */
332
333#[derive(Clone, Copy, Debug)]
334#[repr(C)]
335pub enum jvmtiEvent {
336    // JVMTI_MIN_EVENT_TYPE_VAL = 50,
337    JVMTI_EVENT_VM_INIT = 50,
338    JVMTI_EVENT_VM_DEATH = 51,
339    JVMTI_EVENT_THREAD_START = 52,
340    JVMTI_EVENT_THREAD_END = 53,
341    JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
342    JVMTI_EVENT_CLASS_LOAD = 55,
343    JVMTI_EVENT_CLASS_PREPARE = 56,
344    JVMTI_EVENT_VM_START = 57,
345    JVMTI_EVENT_EXCEPTION = 58,
346    JVMTI_EVENT_EXCEPTION_CATCH = 59,
347    JVMTI_EVENT_SINGLE_STEP = 60,
348    JVMTI_EVENT_FRAME_POP = 61,
349    JVMTI_EVENT_BREAKPOINT = 62,
350    JVMTI_EVENT_FIELD_ACCESS = 63,
351    JVMTI_EVENT_FIELD_MODIFICATION = 64,
352    JVMTI_EVENT_METHOD_ENTRY = 65,
353    JVMTI_EVENT_METHOD_EXIT = 66,
354    JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
355    JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
356    JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
357    JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
358    JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
359    JVMTI_EVENT_MONITOR_WAIT = 73,
360    JVMTI_EVENT_MONITOR_WAITED = 74,
361    JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
362    JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
363    JVMTI_EVENT_RESOURCE_EXHAUSTED = 80,
364    JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
365    JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
366    JVMTI_EVENT_OBJECT_FREE = 83,
367    JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
368    JVMTI_EVENT_SAMPLED_OBJECT_ALLOC = 86,
369    JVMTI_EVENT_VIRTUAL_THREAD_START = 87,
370    JVMTI_EVENT_VIRTUAL_THREAD_END = 88,
371    // JVMTI_MAX_EVENT_TYPE_VAL = 88
372}
373
374pub type jvmtiThreadInfo = _jvmtiThreadInfo;
375pub type jvmtiMonitorStackDepthInfo = _jvmtiMonitorStackDepthInfo;
376pub type jvmtiThreadGroupInfo = _jvmtiThreadGroupInfo;
377pub type jvmtiFrameInfo = _jvmtiFrameInfo;
378pub type jvmtiStackInfo = _jvmtiStackInfo;
379pub type jvmtiHeapReferenceInfoField = _jvmtiHeapReferenceInfoField;
380pub type jvmtiHeapReferenceInfoArray = _jvmtiHeapReferenceInfoArray;
381pub type jvmtiHeapReferenceInfoConstantPool = _jvmtiHeapReferenceInfoConstantPool;
382pub type jvmtiHeapReferenceInfoStackLocal = _jvmtiHeapReferenceInfoStackLocal;
383pub type jvmtiHeapReferenceInfoJniLocal = _jvmtiHeapReferenceInfoJniLocal;
384pub type jvmtiHeapReferenceInfoReserved = _jvmtiHeapReferenceInfoReserved;
385pub type jvmtiHeapReferenceInfo = _jvmtiHeapReferenceInfo;
386pub type jvmtiHeapCallbacks = _jvmtiHeapCallbacks;
387pub type jvmtiClassDefinition = _jvmtiClassDefinition;
388pub type jvmtiMonitorUsage = _jvmtiMonitorUsage;
389pub type jvmtiLineNumberEntry = _jvmtiLineNumberEntry;
390pub type jvmtiLocalVariableEntry = _jvmtiLocalVariableEntry;
391pub type jvmtiParamInfo = _jvmtiParamInfo;
392pub type jvmtiExtensionFunctionInfo = _jvmtiExtensionFunctionInfo;
393pub type jvmtiExtensionEventInfo = _jvmtiExtensionEventInfo;
394pub type jvmtiTimerInfo = _jvmtiTimerInfo;
395pub type jvmtiAddrLocationMap = _jvmtiAddrLocationMap;
396
397pub type jvmtiStartFunction =
398    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv, arg: *mut c_void);
399pub type jvmtiHeapIterationCallback = unsafe extern "system" fn(
400    class_tag: jlong,
401    size: jlong,
402    tag_ptr: *mut jlong,
403    length: jint,
404    user_data: *mut c_void,
405) -> jint;
406pub type jvmtiHeapReferenceCallback = unsafe extern "system" fn(
407    reference_kind: jvmtiHeapReferenceKind,
408    reference_info: *const jvmtiHeapReferenceInfo,
409    class_tag: jlong,
410    referrer_class_tag: jlong,
411    size: jlong,
412    tag_ptr: *mut jlong,
413    referrer_tag_ptr: *mut jlong,
414    length: jint,
415    user_data: *mut c_void,
416) -> jint;
417pub type jvmtiPrimitiveFieldCallback = unsafe extern "system" fn(
418    kind: jvmtiHeapReferenceKind,
419    info: *const jvmtiHeapReferenceInfo,
420    object_class_tag: jlong,
421    object_tag_ptr: *mut jlong,
422    value: jvalue,
423    value_type: jvmtiPrimitiveType,
424    user_data: *mut c_void,
425) -> jint;
426pub type jvmtiArrayPrimitiveValueCallback = unsafe extern "system" fn(
427    class_tag: jlong,
428    size: jlong,
429    tag_ptr: *mut jlong,
430    element_count: jint,
431    element_type: jvmtiPrimitiveType,
432    elements: *mut c_void,
433    user_data: *mut c_void,
434) -> jint;
435pub type jvmtiStringPrimitiveValueCallback = unsafe extern "system" fn(
436    class_tag: jlong,
437    size: jlong,
438    tag_ptr: *mut jlong,
439    value: *mut jchar,
440    value_length: jint,
441    user_data: *mut c_void,
442) -> jint;
443pub type jvmtiReservedCallback = unsafe extern "system" fn() -> jint;
444pub type jvmtiHeapObjectCallback = unsafe extern "system" fn(
445    class_tag: jlong,
446    size: jlong,
447    tag_ptr: *mut jlong,
448    user_data: *mut c_void,
449) -> jvmtiIterationControl;
450pub type jvmtiHeapRootCallback = unsafe extern "system" fn(
451    root_kind: jvmtiHeapRootKind,
452    class_tag: jlong,
453    size: jlong,
454    tag_ptr: *mut jlong,
455    user_data: *mut c_void,
456) -> jvmtiIterationControl;
457pub type jvmtiStackReferenceCallback = unsafe extern "system" fn(
458    root_kind: jvmtiHeapRootKind,
459    class_tag: jlong,
460    size: jlong,
461    tag_ptr: *mut jlong,
462    thread_tag: jlong,
463    depth: jint,
464    method: jmethodID,
465    slot: jint,
466    user_data: *mut c_void,
467) -> jvmtiIterationControl;
468pub type jvmtiObjectReferenceCallback = unsafe extern "system" fn(
469    reference_kind: jvmtiObjectReferenceKind,
470    class_tag: jlong,
471    size: jlong,
472    tag_ptr: *mut jlong,
473    referrer_tag: jlong,
474    referrer_index: jint,
475    user_data: *mut c_void,
476) -> jvmtiIterationControl;
477pub type jvmtiExtensionFunction = unsafe extern "C" fn(jvmti_env: *mut jvmtiEnv, ...) -> jvmtiError;
478pub type jvmtiExtensionEvent = unsafe extern "C" fn(jvmti_env: *mut jvmtiEnv, ...) -> jvmtiError;
479
480#[derive(Clone, Copy, Debug)]
481#[repr(C)]
482pub struct _jvmtiThreadInfo {
483    pub name: *mut c_char,
484    pub priority: jint,
485    pub is_daemon: bool,
486    pub thread_group: jthreadGroup,
487    pub context_class_loader: jobject,
488}
489
490#[derive(Clone, Copy, Debug)]
491#[repr(C)]
492pub struct _jvmtiMonitorStackDepthInfo {
493    pub monitor: jobject,
494    pub stack_depth: jint,
495}
496
497#[derive(Clone, Copy, Debug)]
498#[repr(C)]
499pub struct _jvmtiThreadGroupInfo {
500    pub parent: jthreadGroup,
501    pub name: *mut c_char,
502    pub max_priority: jint,
503    pub is_daemon: jboolean,
504}
505
506#[derive(Clone, Copy, Debug)]
507#[repr(C)]
508pub struct _jvmtiFrameInfo {
509    pub method: jmethodID,
510    pub location: jlocation,
511}
512
513#[derive(Clone, Copy, Debug)]
514#[repr(C)]
515pub struct _jvmtiStackInfo {
516    pub thread: jthread,
517    pub state: jint,
518    pub frame_buffer: *mut _jvmtiFrameInfo,
519    pub frame_count: jint,
520}
521
522#[derive(Clone, Copy, Debug)]
523#[repr(C)]
524pub struct _jvmtiHeapReferenceInfoField {
525    pub index: jint,
526}
527
528#[derive(Clone, Copy, Debug)]
529#[repr(C)]
530pub struct _jvmtiHeapReferenceInfoArray {
531    pub index: jint,
532}
533
534#[derive(Clone, Copy, Debug)]
535#[repr(C)]
536pub struct _jvmtiHeapReferenceInfoConstantPool {
537    pub index: jint,
538}
539
540#[derive(Clone, Copy, Debug)]
541#[repr(C)]
542pub struct _jvmtiHeapReferenceInfoStackLocal {
543    pub thread_tag: jlong,
544    pub thread_id: jlong,
545    pub depth: jint,
546    pub method: jmethodID,
547    pub location: jlocation,
548    pub slot: jint,
549}
550
551#[derive(Clone, Copy, Debug)]
552#[repr(C)]
553pub struct _jvmtiHeapReferenceInfoJniLocal {
554    pub thread_tag: jlong,
555    pub thread_id: jlong,
556    pub depth: jint,
557    pub method: jmethodID,
558}
559
560#[derive(Clone, Copy, Debug)]
561#[repr(C)]
562pub struct _jvmtiHeapReferenceInfoReserved {
563    pub reserved1: jlong,
564    pub reserved2: jlong,
565    pub reserved3: jlong,
566    pub reserved4: jlong,
567    pub reserved5: jlong,
568    pub reserved6: jlong,
569    pub reserved7: jlong,
570    pub reserved8: jlong,
571}
572
573#[derive(Clone, Copy)]
574#[repr(C)]
575pub union _jvmtiHeapReferenceInfo {
576    pub field: jvmtiHeapReferenceInfoField,
577    pub array: jvmtiHeapReferenceInfoArray,
578    pub constant_pool: jvmtiHeapReferenceInfoConstantPool,
579    pub stack_local: jvmtiHeapReferenceInfoStackLocal,
580    pub jni_local: jvmtiHeapReferenceInfoJniLocal,
581    pub other: jvmtiHeapReferenceInfoReserved,
582}
583
584impl core::fmt::Debug for _jvmtiHeapReferenceInfo {
585    // TODO: think about how can this be represented better
586    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
587        let field = unsafe { self.field };
588        f.debug_struct("_jvmtiHeapReferenceInfo")
589            .field("field", unsafe { &self.field })
590            .field("array", unsafe { &self.array })
591            .field("constant_pool", unsafe { &self.constant_pool })
592            .field("stack_local", unsafe { &self.stack_local })
593            .field("jni_local", unsafe { &self.jni_local })
594            .field("other", unsafe { &self.other })
595            .finish()
596    }
597}
598
599#[derive(Clone, Copy, Debug)]
600#[repr(C)]
601pub struct _jvmtiHeapCallbacks {
602    pub heap_iteration_callback: jvmtiHeapIterationCallback,
603    pub heap_reference_callback: jvmtiHeapReferenceCallback,
604    pub primitive_field_callback: jvmtiPrimitiveFieldCallback,
605    pub array_primitive_value_callback: jvmtiArrayPrimitiveValueCallback,
606    pub string_primitive_value_callback: jvmtiStringPrimitiveValueCallback,
607    pub reserved5: jvmtiReservedCallback,
608    pub reserved6: jvmtiReservedCallback,
609    pub reserved7: jvmtiReservedCallback,
610    pub reserved8: jvmtiReservedCallback,
611    pub reserved9: jvmtiReservedCallback,
612    pub reserved10: jvmtiReservedCallback,
613    pub reserved11: jvmtiReservedCallback,
614    pub reserved12: jvmtiReservedCallback,
615    pub reserved13: jvmtiReservedCallback,
616    pub reserved14: jvmtiReservedCallback,
617    pub reserved15: jvmtiReservedCallback,
618}
619
620#[derive(Clone, Copy, Debug)]
621#[repr(C)]
622pub struct _jvmtiClassDefinition {
623    pub klass: jclass,
624    pub class_byte_count: jint,
625    pub class_bytes: *const c_uchar,
626}
627
628#[derive(Clone, Copy, Debug)]
629#[repr(C)]
630pub struct _jvmtiMonitorUsage {
631    pub owner: jthread,
632    pub entry_count: jint,
633    pub waiter_count: jint,
634    pub waiters: *mut jthread,
635    pub notify_waiter_count: jint,
636    pub notify_waiters: *mut jthread,
637}
638
639#[derive(Clone, Copy, Debug)]
640#[repr(C)]
641pub struct _jvmtiLineNumberEntry {
642    pub start_location: jlocation,
643    pub line_number: jint,
644}
645
646#[derive(Clone, Copy, Debug)]
647#[repr(C)]
648pub struct _jvmtiLocalVariableEntry {
649    pub start_location: jlocation,
650    pub length: jint,
651    pub name: *mut c_char,
652    pub signature: *mut c_char,
653    pub generic_signature: *mut c_char,
654    pub slot: jint,
655}
656
657#[derive(Clone, Copy, Debug)]
658#[repr(C)]
659pub struct _jvmtiParamInfo {
660    pub name: *mut c_char,
661    pub kind: jvmtiParamKind,
662    pub base_type: jvmtiParamTypes,
663    pub null_ok: jboolean,
664}
665
666#[derive(Clone, Copy, Debug)]
667#[repr(C)]
668pub struct _jvmtiExtensionFunctionInfo {
669    pub func: jvmtiExtensionFunction,
670    pub id: *mut c_char,
671    pub short_description: *mut c_char,
672    pub param_count: jint,
673    pub params: *mut jvmtiParamInfo,
674    pub error_count: jint,
675    pub errors: *mut jvmtiError,
676}
677
678#[derive(Clone, Copy, Debug)]
679#[repr(C)]
680pub struct _jvmtiExtensionEventInfo {
681    pub extension_event_index: jint,
682    pub id: *mut c_char,
683    pub short_description: *mut c_char,
684    pub param_count: jint,
685    pub params: *mut jvmtiParamInfo,
686}
687
688#[derive(Clone, Copy, Debug)]
689#[repr(C)]
690pub struct _jvmtiTimerInfo {
691    pub max_value: jlong,
692    pub may_skip_forward: jboolean,
693    pub may_skip_backward: jboolean,
694    pub kind: jvmtiTimerKind,
695    pub reserved1: jlong,
696    pub reserved2: jlong,
697}
698
699#[derive(Clone, Copy, Debug)]
700#[repr(C)]
701pub struct _jvmtiAddrLocationMap {
702    pub start_address: *const c_void,
703    pub location: jlocation,
704}
705
706bitflags! {
707    /// Represents the capabilities of the JVMTI agent.
708    #[derive(Clone, Copy, Debug)]
709    #[repr(C)]
710    pub struct jvmtiCapabilities: u128 {
711        const CAN_TAG_OBJECTS = 1 << 0;
712        const CAN_GENERATE_FIELD_MODIFICATION_EVENTS = 1 << 1;
713        const CAN_GENERATE_FIELD_ACCESS_EVENTS = 1 << 2;
714        const CAN_GET_BYTECODES = 1 << 3;
715        const CAN_GET_SYNTHETIC_ATTRIBUTE = 1 << 4;
716        const CAN_GET_OWNED_MONITOR_INFO = 1 << 5;
717        const CAN_GET_CURRENT_CONTENDED_MONITOR = 1 << 6;
718        const CAN_GET_MONITOR_INFO = 1 << 7;
719        const CAN_POP_FRAME = 1 << 8;
720        const CAN_REDEFINE_CLASSES = 1 << 9;
721        const CAN_SIGNAL_THREAD = 1 << 10;
722        const CAN_GET_SOURCE_FILE_NAME = 1 << 11;
723        const CAN_GET_LINE_NUMBERS = 1 << 12;
724        const CAN_GET_SOURCE_DEBUG_EXTENSION = 1 << 13;
725        const CAN_ACCESS_LOCAL_VARIABLES = 1 << 14;
726        const CAN_MAINTAIN_ORIGINAL_METHOD_ORDER = 1 << 15;
727        const CAN_GENERATE_SINGLE_STEP_EVENTS = 1 << 16;
728        const CAN_GENERATE_EXCEPTION_EVENTS = 1 << 17;
729        const CAN_GENERATE_FRAME_POP_EVENTS = 1 << 18;
730        const CAN_GENERATE_BREAKPOINT_EVENTS = 1 << 19;
731        const CAN_SUSPEND = 1 << 20;
732        const CAN_REDEFINE_ANY_CLASS = 1 << 21;
733        const CAN_GET_CURRENT_THREAD_CPU_TIME = 1 << 22;
734        const CAN_GET_THREAD_CPU_TIME = 1 << 23;
735        const CAN_GENERATE_METHOD_ENTRY_EVENTS = 1 << 24;
736        const CAN_GENERATE_METHOD_EXIT_EVENTS = 1 << 25;
737        const CAN_GENERATE_ALL_CLASS_HOOK_EVENTS = 1 << 26;
738        const CAN_GENERATE_COMPILED_METHOD_LOAD_EVENTS = 1 << 27;
739        const CAN_GENERATE_MONITOR_EVENTS = 1 << 28;
740        const CAN_GENERATE_VM_OBJECT_ALLOC_EVENTS = 1 << 29;
741        const CAN_GENERATE_NATIVE_METHOD_BIND_EVENTS = 1 << 30;
742        const CAN_GENERATE_GARBAGE_COLLECTION_EVENTS = 1 << 31;
743        const CAN_GENERATE_OBJECT_FREE_EVENTS = 1 << 32; // 33rd capability
744        const CAN_FORCE_EARLY_RETURN = 1 << 33; // 34th capability
745        const CAN_GET_OWNED_MONITOR_STACK_DEPTH_INFO = 1 << 34;
746        const CAN_GET_CONSTANT_POOL = 1 << 35;
747        const CAN_SET_NATIVE_METHOD_PREFIX = 1 << 36;
748        const CAN_RETRANSFORM_CLASSES = 1 << 37;
749        const CAN_RETRANSFORM_ANY_CLASS = 1 << 38;
750        const CAN_GENERATE_RESOURCE_EXHAUSTION_HEAP_EVENTS = 1 << 39;
751        const CAN_GENERATE_RESOURCE_EXHAUSTION_THREADS_EVENTS = 1 << 40;
752        // TODO: Think how to represent new fields better
753        const CAN_GENERATE_EARLY_VMSTART = 1 << 41;
754        const CAN_GENERATE_EARLY_CLASS_HOOK_EVENTS = 1 << 42;
755        const CAN_GENERATE_SAMPLED_OBJECT_ALLOC_EVENTS = 1 << 43;
756        const CAN_SUPPORT_VIRTUAL_THREADS = 1 << 44;
757
758    }
759}
760
761/* Event Definitions */
762
763pub type jvmtiEventReserved = extern "system" fn();
764pub type jvmtiEventBreakpoint = unsafe extern "system" fn(
765    jvmti_env: *mut jvmtiEnv,
766    jni_env: *mut JNIEnv,
767    thread: jthread,
768    method: jmethodID,
769    location: jlocation,
770);
771
772pub type jvmtiEventClassFileLoadHook = unsafe extern "system" fn(
773    jvmti_env: *mut jvmtiEnv,
774    jni_env: *mut JNIEnv,
775    class_being_redefined: jclass,
776    loader: jobject,
777    name: *const c_char,
778    protection_domain: jobject,
779    class_data_len: jint,
780    class_data: *const c_uchar,
781    new_class_data_len: *mut jint,
782    new_class_data: *mut *mut c_uint,
783);
784
785pub type jvmtiEventClassLoad = unsafe extern "system" fn(
786    jvmti_env: *mut jvmtiEnv,
787    jni_env: *mut JNIEnv,
788    thread: jthread,
789    klass: jclass,
790);
791
792pub type jvmtiEventClassPrepare = unsafe extern "system" fn(
793    jvmti_env: *mut jvmtiEnv,
794    jni_env: *mut JNIEnv,
795    thread: jthread,
796    klass: jclass,
797);
798
799pub type jvmtiEventCompiledMethodLoad = unsafe extern "system" fn(
800    jvmti_env: *mut jvmtiEnv,
801    jni_env: *mut JNIEnv,
802    code_size: jint,
803    code_addr: *const c_void,
804    map_length: jint,
805    map: *const jvmtiAddrLocationMap,
806    compile_info: *const c_void,
807);
808
809pub type jvmtiEventCompiledMethodUnload = unsafe extern "system" fn(
810    jvmti_env: *mut jvmtiEnv,
811    method: jmethodID,
812    code_addr: *const c_void,
813);
814
815pub type jvmtiEventDataDumpRequest = unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv);
816
817pub type jvmtiEventDynamicCodeGenerated = unsafe extern "system" fn(
818    jvmti_env: *mut jvmtiEnv,
819    name: *const c_char,
820    address: *const c_void,
821    length: jint,
822);
823
824pub type jvmtiEventException = unsafe extern "system" fn(
825    jvmti_env: *mut jvmtiEnv,
826    jni_env: *mut JNIEnv,
827    thread: jthread,
828    method: jmethodID,
829    location: jlocation,
830    exception: jobject,
831    catch_method: jmethodID,
832    catch_location: jlocation,
833);
834
835pub type jvmtiEventExceptionCatch = unsafe extern "system" fn(
836    jvmti_env: *mut jvmtiEnv,
837    jni_env: *mut JNIEnv,
838    thread: jthread,
839    method: jmethodID,
840    location: jlocation,
841    exception: jobject,
842);
843
844pub type jvmtiEventFieldAccess = unsafe extern "system" fn(
845    jvmti_env: *mut jvmtiEnv,
846    jni_env: *mut JNIEnv,
847    thread: jthread,
848    method: jmethodID,
849    location: jlocation,
850    field_klass: jclass,
851    object: jobject,
852    field: jfieldID,
853);
854
855pub type jvmtiEventFieldModification = unsafe extern "system" fn(
856    jvmti_env: *mut jvmtiEnv,
857    jni_env: *mut JNIEnv,
858    thread: jthread,
859    method: jmethodID,
860    location: jlocation,
861    field_klass: jclass,
862    object: jobject,
863    field: jfieldID,
864    signature_type: c_char,
865    new_value: jvalue,
866);
867
868pub type jvmtiEventFramePop = unsafe extern "system" fn(
869    jvmti_env: *mut jvmtiEnv,
870    jni_env: *mut JNIEnv,
871    thread: jthread,
872    method: jmethodID,
873    was_popped_by_exception: jboolean,
874);
875
876pub type jvmtiEventGarbageCollectionFinish = unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv);
877pub type jvmtiEventGarbageCollectionStart = unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv);
878pub type jvmtiEventMethodEntry = unsafe extern "system" fn(
879    jvmti_env: *mut jvmtiEnv,
880    jni_env: *mut JNIEnv,
881    thread: jthread,
882    method: jmethodID,
883);
884
885pub type jvmtiEventMethodExit = unsafe extern "system" fn(
886    jvmti_env: *mut jvmtiEnv,
887    jni_env: *mut JNIEnv,
888    thread: jthread,
889    method: jmethodID,
890    was_popped_by_exception: jboolean,
891    return_value: jvalue,
892);
893
894pub type jvmtiEventMonitorContendedEnter = unsafe extern "system" fn(
895    jvmti_env: *mut jvmtiEnv,
896    jni_env: *mut JNIEnv,
897    thread: jthread,
898    object: jobject,
899);
900
901pub type jvmtiEventMonitorContendedEntered = unsafe extern "system" fn(
902    jvmti_env: *mut jvmtiEnv,
903    jni_env: *mut JNIEnv,
904    thread: jthread,
905    object: jobject,
906);
907pub type jvmtiEventMonitorWait = unsafe extern "system" fn(
908    jvmti_env: *mut jvmtiEnv,
909    jni_env: *mut JNIEnv,
910    thread: jthread,
911    object: jobject,
912    timeout: jlong,
913);
914
915pub type jvmtiEventMonitorWaited = unsafe extern "system" fn(
916    jvmti_env: *mut jvmtiEnv,
917    jni_env: *mut JNIEnv,
918    thread: jthread,
919    object: jobject,
920    timed_out: jboolean,
921);
922
923pub type jvmtiEventNativeMethodBind = unsafe extern "system" fn(
924    jvmti_env: *mut jvmtiEnv,
925    jni_env: *mut JNIEnv,
926    thread: jthread,
927    method: *mut c_void,
928    address: *mut c_void,
929    new_address_ptr: *mut *mut c_void,
930);
931
932pub type jvmtiEventObjectFree = unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, tag: jlong);
933pub type jvmtiEventResourceExhausted = unsafe extern "system" fn(
934    jvmti_env: *mut jvmtiEnv,
935    jni_env: *mut JNIEnv,
936    flags: JVMTI_RESOURCE_EXHAUSTED_FLAGS,
937    reserved: *const c_void,
938    description: *const c_char,
939);
940
941pub type jvmtiEventSampledObjectAlloc = unsafe extern "system" fn(
942    jvmti_env: *mut jvmtiEnv,
943    jni_env: *mut JNIEnv,
944    thread: jthread,
945    object: jobject,
946    object_class: jclass,
947    size: jlong,
948);
949
950pub type jvmtiEventSingleStep = unsafe extern "system" fn(
951    jvmti_env: *mut jvmtiEnv,
952    jni_env: *mut JNIEnv,
953    thread: jthread,
954    method: jmethodID,
955    location: jlocation,
956);
957
958pub type jvmtiEventThreadEnd =
959    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv, thread: jthread);
960
961pub type jvmtiEventThreadStart =
962    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv, thread: jthread);
963
964pub type jvmtiEventVirtualThreadStart =
965    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv, thread: jthread);
966
967pub type jvmtiEventVirtualThreadEnd =
968    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv, thread: jthread);
969
970pub type jvmtiEventVMDeath =
971    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv);
972
973pub type jvmtiEventVMInit =
974    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv, thread: jthread);
975
976pub type jvmtiEventVMObjectAlloc = unsafe extern "system" fn(
977    jvmti_env: *mut jvmtiEnv,
978    jni_env: *mut JNIEnv,
979    thread: jthread,
980    object: jobject,
981    object_klass: jclass,
982    size: jlong,
983);
984
985pub type jvmtiEventVMStart =
986    unsafe extern "system" fn(jvmti_env: *mut jvmtiEnv, jni_env: *mut JNIEnv);
987
988/* Event Callback Structure */
989
990#[jni_to_union]
991#[repr(C)]
992#[derive(Clone, Copy, Debug, Default)]
993pub struct jvmtiEventCallbacks {
994    /*   50 : VM Initialization Event */
995    #[jni_added("1.0")]
996    pub VMInit: Option<jvmtiEventVMInit>,
997    /*   51 : VM Death Event */
998    #[jni_added("1.0")]
999    pub VMDeath: Option<jvmtiEventVMDeath>,
1000    /*   52 : Thread Start */
1001    #[jni_added("1.0")]
1002    pub ThreadStart: Option<jvmtiEventThreadStart>,
1003    /*   53 : Thread End */
1004    #[jni_added("1.0")]
1005    pub ThreadEnd: Option<jvmtiEventThreadEnd>,
1006    /*   54 : Class File Load Hook */
1007    #[jni_added("1.0")]
1008    pub ClassFileLoadHook: Option<jvmtiEventClassFileLoadHook>,
1009    /*   55 : Class Load */
1010    #[jni_added("1.0")]
1011    pub ClassLoad: Option<jvmtiEventClassLoad>,
1012    /*   56 : Class Prepare */
1013    #[jni_added("1.0")]
1014    pub ClassPrepare: Option<jvmtiEventClassPrepare>,
1015    /*   57 : VM Start Event */
1016    #[jni_added("1.0")]
1017    pub VMStart: Option<jvmtiEventVMStart>,
1018    /*   58 : Exception */
1019    #[jni_added("1.0")]
1020    pub Exception: Option<jvmtiEventException>,
1021    /*   59 : Exception Catch */
1022    #[jni_added("1.0")]
1023    pub ExceptionCatch: Option<jvmtiEventExceptionCatch>,
1024    /*   60 : Single Step */
1025    #[jni_added("1.0")]
1026    pub SingleStep: Option<jvmtiEventSingleStep>,
1027    /*   61 : Frame Pop */
1028    #[jni_added("1.0")]
1029    pub FramePop: Option<jvmtiEventFramePop>,
1030    /*   62 : Breakpoint */
1031    #[jni_added("1.0")]
1032    pub Breakpoint: Option<jvmtiEventBreakpoint>,
1033    /*   63 : Field Access */
1034    #[jni_added("1.0")]
1035    pub FieldAccess: Option<jvmtiEventFieldAccess>,
1036    /*   64 : Field Modification */
1037    #[jni_added("1.0")]
1038    pub FieldModification: Option<jvmtiEventFieldModification>,
1039    /*   65 : Method Entry */
1040    #[jni_added("1.0")]
1041    pub MethodEntry: Option<jvmtiEventMethodEntry>,
1042    /*   66 : Method Exit */
1043    #[jni_added("1.0")]
1044    pub MethodExit: Option<jvmtiEventMethodExit>,
1045    /*   67 : Native Method Bind */
1046    #[jni_added("1.0")]
1047    pub NativeMethodBind: Option<jvmtiEventNativeMethodBind>,
1048    /*   68 : Compiled Method Load */
1049    #[jni_added("1.0")]
1050    pub CompiledMethodLoad: Option<jvmtiEventCompiledMethodLoad>,
1051    /*   69 : Compiled Method Unload */
1052    #[jni_added("1.0")]
1053    pub CompiledMethodUnload: Option<jvmtiEventCompiledMethodUnload>,
1054    /*   70 : Dynamic Code Generated */
1055    #[jni_added("1.0")]
1056    pub DynamicCodeGenerated: Option<jvmtiEventDynamicCodeGenerated>,
1057    /*   71 : Data Dump Request */
1058    #[jni_added("1.0")]
1059    pub DataDumpRequest: Option<jvmtiEventDataDumpRequest>,
1060    /*   72 */
1061    #[jni_added("reserved")]
1062    pub reserved72: Option<jvmtiEventReserved>,
1063    /*   73 : Monitor Wait */
1064    #[jni_added("1.0")]
1065    pub MonitorWait: Option<jvmtiEventMonitorWait>,
1066    /*   74 : Monitor Waited */
1067    #[jni_added("1.0")]
1068    pub MonitorWaited: Option<jvmtiEventMonitorWaited>,
1069    /*   75 : Monitor Contended Enter */
1070    #[jni_added("1.0")]
1071    pub MonitorContendedEnter: Option<jvmtiEventMonitorContendedEnter>,
1072    /*   76 : Monitor Contended Entered */
1073    #[jni_added("1.0")]
1074    pub MonitorContendedEntered: Option<jvmtiEventMonitorContendedEntered>,
1075    /*   77 */
1076    #[jni_added("reserved")]
1077    pub reserved77: Option<jvmtiEventReserved>,
1078    /*   78 */
1079    #[jni_added("reserved")]
1080    pub reserved78: Option<jvmtiEventReserved>,
1081    /*   79 */
1082    #[jni_added("reserved")]
1083    pub reserved79: Option<jvmtiEventReserved>,
1084    /*   80 : Resource Exhausted */
1085    #[jni_added("1.1")]
1086    pub ResourceExhausted: Option<jvmtiEventResourceExhausted>,
1087    /*   81 : Garbage Collection Start */
1088    #[jni_added("1.0")]
1089    pub GarbageCollectionStart: Option<jvmtiEventGarbageCollectionStart>,
1090    /*   82 : Garbage Collection Finish */
1091    #[jni_added("1.0")]
1092    pub GarbageCollectionFinish: Option<jvmtiEventGarbageCollectionFinish>,
1093    /*   83 : Object Free */
1094    #[jni_added("1.0")]
1095    pub ObjectFree: Option<jvmtiEventObjectFree>,
1096    /*   84 : VM Object Allocation */
1097    #[jni_added("1.0")]
1098    pub VMObjectAlloc: Option<jvmtiEventVMObjectAlloc>,
1099    #[jni_added("reserved")]
1100    pub reserved85: Option<jvmtiEventReserved>,
1101    /*   86 : Sampled Object Allocation */
1102    #[jni_added("11")]
1103    pub SampledObjectAlloc: Option<jvmtiEventSampledObjectAlloc>,
1104    /*   87 : Virtual Thread Start */
1105    #[jni_added("21")]
1106    pub VirtualThreadStart: Option<jvmtiEventVirtualThreadStart>,
1107    /*   88 : Virtual Thread End */
1108    #[jni_added("21")]
1109    pub VirtualThreadEnd: Option<jvmtiEventVirtualThreadEnd>,
1110}
1111
1112#[jni_to_union]
1113#[repr(C)]
1114#[derive(Debug, Clone, Copy)]
1115pub struct jvmtiInterface_1_ {
1116    #[jni_added("reserved")]
1117    pub reserved1: *mut c_void,
1118    #[jni_added("1.0")]
1119    pub SetEventNotificationMode: unsafe extern "C" fn(
1120        env: *mut jvmtiEnv,
1121        mode: jvmtiEventMode,
1122        event_type: jvmtiEvent,
1123        event_thread: jthread,
1124        ...
1125    ) -> jvmtiError,
1126    #[jni_added("9")]
1127    pub GetAllModules: unsafe extern "system" fn(
1128        env: *mut jvmtiEnv,
1129        module_count_ptr: *mut jint,
1130        modules_ptr: *mut *mut jthread,
1131    ) -> jvmtiError,
1132    #[jni_added("1.0")]
1133    pub GetAllThreads: unsafe extern "system" fn(
1134        env: *mut jvmtiEnv,
1135        threads_count_ptr: *mut jint,
1136        threads_ptr: *mut *mut jthread,
1137    ) -> jvmtiError,
1138    #[jni_added("1.0")]
1139    pub SuspendThread: unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread) -> jvmtiError,
1140    #[jni_added("1.0")]
1141    pub ResumeThread: unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread) -> jvmtiError,
1142    #[jni_added("1.0")]
1143    pub StopThread: unsafe extern "system" fn(
1144        env: *mut jvmtiEnv,
1145        thread: jthread,
1146        exception: jobject,
1147    ) -> jvmtiError,
1148    #[jni_added("1.0")]
1149    pub InterruptThread:
1150        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread) -> jvmtiError,
1151    #[jni_added("1.0")]
1152    pub GetThreadInfo: unsafe extern "system" fn(
1153        env: *mut jvmtiEnv,
1154        thread: jthread,
1155        info_ptr: *mut jvmtiThreadInfo,
1156    ) -> jvmtiError,
1157    #[jni_added("1.0")]
1158    pub GetOwnedMonitorInfo: unsafe extern "system" fn(
1159        env: *mut jvmtiEnv,
1160        thread: jthread,
1161        owned_monitor_count_ptr: *mut jint,
1162        owned_monitors_ptr: *mut *mut jobject,
1163    ) -> jvmtiError,
1164
1165    #[jni_added("1.0")]
1166    pub GetCurrentContendedMonitor: unsafe extern "system" fn(
1167        env: *mut jvmtiEnv,
1168        thread: jthread,
1169        monitor_ptr: *mut jobject,
1170    ) -> jvmtiError,
1171
1172    #[jni_added("1.0")]
1173    pub RunAgentThread: unsafe extern "system" fn(
1174        env: *mut jvmtiEnv,
1175        thread: jthread,
1176        _proc: jvmtiStartFunction,
1177        arg: *const c_void,
1178        priority: jint,
1179    ) -> jvmtiError,
1180    #[jni_added("1.0")]
1181    pub GetTopThreadGroups: unsafe extern "system" fn(
1182        env: *mut jvmtiEnv,
1183        group_count_ptr: *mut jint,
1184        groups_ptr: *mut *mut jthreadGroup,
1185    ) -> jvmtiError,
1186    #[jni_added("1.0")]
1187    pub GetThreadGroupInfo: unsafe extern "system" fn(
1188        env: *mut jvmtiEnv,
1189        group: jthreadGroup,
1190        info_ptr: *mut jvmtiThreadGroupInfo,
1191    ) -> jvmtiError,
1192    #[jni_added("1.0")]
1193    pub GetThreadGroupChildren: unsafe extern "system" fn(
1194        env: *mut jvmtiEnv,
1195        group: jthreadGroup,
1196        thread_count_ptr: *mut jint,
1197        threads_ptr: *mut *mut jthread,
1198        group_count_ptr: *mut jint,
1199        groups_ptr: *mut *mut jthreadGroup,
1200    ) -> jvmtiError,
1201    #[jni_added("1.0")]
1202    pub GetFrameCount: unsafe extern "system" fn(
1203        env: *mut jvmtiEnv,
1204        thread: jthread,
1205        count_ptr: *mut jint,
1206    ) -> jvmtiError,
1207    #[jni_added("1.0")]
1208    pub GetThreadState: unsafe extern "system" fn(
1209        env: *mut jvmtiEnv,
1210        thread: jthread,
1211        thread_state_ptr: *mut jint,
1212    ) -> jvmtiError,
1213    #[jni_added("1.1")]
1214    pub GetCurrentThread:
1215        unsafe extern "system" fn(env: *mut jvmtiEnv, thread_ptr: *mut jthread) -> jvmtiError,
1216    #[jni_added("1.0")]
1217    pub GetFrameLocation: unsafe extern "system" fn(
1218        env: *mut jvmtiEnv,
1219        thread: jthread,
1220        depth: jint,
1221        method_ptr: *mut jmethodID,
1222        location_ptr: *mut jlocation,
1223    ) -> jvmtiError,
1224    #[jni_added("1.0")]
1225    pub NotifyFramePop:
1226        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread, depth: jint) -> jvmtiError,
1227    #[jni_added("1.0")]
1228    pub GetLocalObject: unsafe extern "system" fn(
1229        env: *mut jvmtiEnv,
1230        thread: jthread,
1231        depth: jint,
1232        slot: jint,
1233        value_ptr: *mut jobject,
1234    ) -> jvmtiError,
1235    #[jni_added("1.0")]
1236    pub GetLocalInt: unsafe extern "system" fn(
1237        env: *mut jvmtiEnv,
1238        thread: jthread,
1239        depth: jint,
1240        slot: jint,
1241        value_ptr: *mut jint,
1242    ) -> jvmtiError,
1243    #[jni_added("1.0")]
1244    pub GetLocalLong: unsafe extern "system" fn(
1245        env: *mut jvmtiEnv,
1246        thread: jthread,
1247        depth: jint,
1248        slot: jint,
1249        value_ptr: *mut jlong,
1250    ) -> jvmtiError,
1251    #[jni_added("1.0")]
1252    pub GetLocalFloat: unsafe extern "system" fn(
1253        env: *mut jvmtiEnv,
1254        thread: jthread,
1255        depth: jint,
1256        slot: jint,
1257        value_ptr: *mut jfloat,
1258    ) -> jvmtiError,
1259    #[jni_added("1.0")]
1260    pub GetLocalDouble: unsafe extern "system" fn(
1261        env: *mut jvmtiEnv,
1262        thread: jthread,
1263        depth: jint,
1264        slot: jint,
1265        value_ptr: *mut jdouble,
1266    ) -> jvmtiError,
1267    #[jni_added("1.0")]
1268    pub SetLocalObject: unsafe extern "system" fn(
1269        env: *mut jvmtiEnv,
1270        thread: jthread,
1271        depth: jint,
1272        slot: jint,
1273        value: jobject,
1274    ) -> jvmtiError,
1275
1276    #[jni_added("1.0")]
1277    pub SetLocalInt: unsafe extern "system" fn(
1278        env: *mut jvmtiEnv,
1279        thread: jthread,
1280        depth: jint,
1281        slot: jint,
1282        value: jint,
1283    ) -> jvmtiError,
1284    #[jni_added("1.0")]
1285    pub SetLocalLong: unsafe extern "system" fn(
1286        env: *mut jvmtiEnv,
1287        thread: jthread,
1288        depth: jint,
1289        slot: jint,
1290        value: jlong,
1291    ) -> jvmtiError,
1292    #[jni_added("1.0")]
1293    pub SetLocalFloat: unsafe extern "system" fn(
1294        env: *mut jvmtiEnv,
1295        thread: jthread,
1296        depth: jint,
1297        slot: jint,
1298        value: jfloat,
1299    ) -> jvmtiError,
1300    #[jni_added("1.0")]
1301    pub SetLocalDouble: unsafe extern "system" fn(
1302        env: *mut jvmtiEnv,
1303        thread: jthread,
1304        depth: jint,
1305        slot: jint,
1306        value: jdouble,
1307    ) -> jvmtiError,
1308    #[jni_added("1.0")]
1309    pub CreateRawMonitor: unsafe extern "system" fn(
1310        env: *mut jvmtiEnv,
1311        name: *const c_char,
1312        monitor_ptr: *mut jrawMonitorID,
1313    ) -> jvmtiError,
1314
1315    #[jni_added("1.0")]
1316    pub DestroyRawMonitor:
1317        unsafe extern "system" fn(env: *mut jvmtiEnv, monitor: jrawMonitorID) -> jvmtiError,
1318    #[jni_added("1.0")]
1319    pub RawMonitorEnter:
1320        unsafe extern "system" fn(env: *mut jvmtiEnv, monitor: jrawMonitorID) -> jvmtiError,
1321    #[jni_added("1.0")]
1322    pub RawMonitorExit:
1323        unsafe extern "system" fn(env: *mut jvmtiEnv, monitor: jrawMonitorID) -> jvmtiError,
1324    #[jni_added("1.0")]
1325    pub RawMonitorWait: unsafe extern "system" fn(
1326        env: *mut jvmtiEnv,
1327        monitor: jrawMonitorID,
1328        millis: jlong,
1329    ) -> jvmtiError,
1330
1331    #[jni_added("1.0")]
1332    pub RawMonitorNotify:
1333        unsafe extern "system" fn(env: *mut jvmtiEnv, monitor: jrawMonitorID) -> jvmtiError,
1334    #[jni_added("1.0")]
1335    pub RawMonitorNotifyAll:
1336        unsafe extern "system" fn(env: *mut jvmtiEnv, monitor: jrawMonitorID) -> jvmtiError,
1337    #[jni_added("1.0")]
1338    pub SetBreakpoint: unsafe extern "system" fn(
1339        env: *mut jvmtiEnv,
1340        method: jmethodID,
1341        location: jlocation,
1342    ) -> jvmtiError,
1343    #[jni_added("1.0")]
1344    pub ClearBreakpoint: unsafe extern "system" fn(
1345        env: *mut jvmtiEnv,
1346        method: jmethodID,
1347        location: jlocation,
1348    ) -> jvmtiError,
1349    #[jni_added("9")]
1350    pub GetNamedModule: unsafe extern "system" fn(
1351        env: *mut jvmtiEnv,
1352        class_loader: jobject,
1353        package_name: *const c_char,
1354        module_ptr: *mut jobject,
1355    ) -> jvmtiError,
1356    #[jni_added("1.0")]
1357    pub SetFieldAccessWatch:
1358        unsafe extern "system" fn(env: *mut jvmtiEnv, klass: jclass, field: jfieldID) -> jvmtiError,
1359    #[jni_added("1.0")]
1360    pub ClearFieldAccessWatch:
1361        unsafe extern "system" fn(env: *mut jvmtiEnv, klass: jclass, field: jfieldID) -> jvmtiError,
1362    #[jni_added("1.0")]
1363    pub SetFieldModificationWatch:
1364        unsafe extern "system" fn(env: *mut jvmtiEnv, klass: jclass, field: jfieldID) -> jvmtiError,
1365    #[jni_added("1.0")]
1366    pub ClearFieldModificationWatch:
1367        unsafe extern "system" fn(env: *mut jvmtiEnv, klass: jclass, field: jfieldID) -> jvmtiError,
1368    #[jni_added("1.1")]
1369    pub IsModifiableClass: unsafe extern "system" fn(
1370        env: *mut jvmtiEnv,
1371        klass: jclass,
1372        is_modifiable_class_ptr: *mut jboolean,
1373    ) -> jvmtiError,
1374    #[jni_added("1.0")]
1375    pub Allocate: unsafe extern "system" fn(
1376        env: *mut jvmtiEnv,
1377        size: jlong,
1378        mem_ptr: *mut *mut c_uchar,
1379    ) -> jvmtiError,
1380    #[jni_added("1.0")]
1381    pub Deallocate: unsafe extern "system" fn(env: *mut jvmtiEnv, mem: *mut c_uchar) -> jvmtiError,
1382    #[jni_added("1.0")]
1383    pub GetClassSignature: unsafe extern "system" fn(
1384        env: *mut jvmtiEnv,
1385        klass: jclass,
1386        signature_ptr: *mut *mut c_char,
1387        generic_ptr: *mut *mut c_char,
1388    ) -> jvmtiError,
1389    #[jni_added("1.0")]
1390    pub GetClassStatus: unsafe extern "system" fn(
1391        env: *mut jvmtiEnv,
1392        klass: jclass,
1393        status_ptr: *mut jint,
1394    ) -> jvmtiError,
1395    #[jni_added("1.0")]
1396    pub GetSourceFileName: unsafe extern "system" fn(
1397        env: *mut jvmtiEnv,
1398        klass: jclass,
1399        source_name_ptr: *mut *mut c_char,
1400    ) -> jvmtiError,
1401    #[jni_added("1.0")]
1402    pub GetClassModifiers: unsafe extern "system" fn(
1403        env: *mut jvmtiEnv,
1404        klass: jclass,
1405        modifiers_ptr: *mut jint,
1406    ) -> jvmtiError,
1407    #[jni_added("1.0")]
1408    pub GetClassMethods: unsafe extern "system" fn(
1409        env: *mut jvmtiEnv,
1410        klass: jclass,
1411        method_count_ptr: *mut jint,
1412        methods_ptr: *mut *mut jmethodID,
1413    ) -> jvmtiError,
1414    #[jni_added("1.0")]
1415    pub GetClassFields: unsafe extern "system" fn(
1416        env: *mut jvmtiEnv,
1417        klass: jclass,
1418        field_count_ptr: *mut jint,
1419        fields_ptr: *mut *mut jfieldID,
1420    ) -> jvmtiError,
1421    #[jni_added("1.0")]
1422    pub GetImplementedInterfaces: unsafe extern "system" fn(
1423        env: *mut jvmtiEnv,
1424        klass: jclass,
1425        interface_count_ptr: *mut jint,
1426        interfaces_ptr: *mut *mut jclass,
1427    ) -> jvmtiError,
1428    #[jni_added("1.0")]
1429    pub IsInterface: unsafe extern "system" fn(
1430        env: *mut jvmtiEnv,
1431        klass: jclass,
1432        is_interface_ptr: *mut jboolean,
1433    ) -> jvmtiError,
1434    #[jni_added("1.0")]
1435    pub IsArrayClass: unsafe extern "system" fn(
1436        env: *mut jvmtiEnv,
1437        klass: jclass,
1438        is_array_class_ptr: *mut jboolean,
1439    ) -> jvmtiError,
1440    #[jni_added("1.0")]
1441    pub GetClassLoader: unsafe extern "system" fn(
1442        env: *mut jvmtiEnv,
1443        klass: jclass,
1444        classloader_ptr: *mut jobject,
1445    ) -> jvmtiError,
1446    #[jni_added("1.0")]
1447    pub GetObjectHashCode: unsafe extern "system" fn(
1448        env: *mut jvmtiEnv,
1449        object: jobject,
1450        hash_code_ptr: *mut jint,
1451    ) -> jvmtiError,
1452    #[jni_added("1.0")]
1453    pub GetObjectMonitorUsage: unsafe extern "system" fn(
1454        env: *mut jvmtiEnv,
1455        object: jobject,
1456        info_ptr: *mut jvmtiMonitorUsage,
1457    ) -> jvmtiError,
1458    #[jni_added("1.0")]
1459    pub GetFieldName: unsafe extern "system" fn(
1460        env: *mut jvmtiEnv,
1461        klass: jclass,
1462        field: jfieldID,
1463        name_ptr: *mut *mut c_char,
1464        signature_ptr: *mut *mut c_char,
1465        generic_ptr: *mut *mut c_char,
1466    ) -> jvmtiError,
1467    #[jni_added("1.0")]
1468    pub GetFieldDeclaringClass: unsafe extern "system" fn(
1469        env: *mut jvmtiEnv,
1470        klass: jclass,
1471        field: jfieldID,
1472        declaring_class_ptr: *mut jclass,
1473    ) -> jvmtiError,
1474    #[jni_added("1.0")]
1475    pub GetFieldModifiers: unsafe extern "system" fn(
1476        env: *mut jvmtiEnv,
1477        klass: jclass,
1478        field: jfieldID,
1479        modifiers_ptr: *mut jint,
1480    ) -> jvmtiError,
1481    #[jni_added("1.0")]
1482    pub IsFieldSynthetic: unsafe extern "system" fn(
1483        env: *mut jvmtiEnv,
1484        klass: jclass,
1485        field: jfieldID,
1486        is_synthetic_ptr: *mut jboolean,
1487    ) -> jvmtiError,
1488    #[jni_added("1.0")]
1489    pub GetMethodName: unsafe extern "system" fn(
1490        env: *mut jvmtiEnv,
1491        method: jmethodID,
1492        name_ptr: *mut *mut c_char,
1493        signature_ptr: *mut *mut c_char,
1494        generic_ptr: *mut *mut c_char,
1495    ) -> jvmtiError,
1496    #[jni_added("1.0")]
1497    pub GetMethodDeclaringClass: unsafe extern "system" fn(
1498        env: *mut jvmtiEnv,
1499        method: jmethodID,
1500        declaring_class_ptr: *mut jclass,
1501    ) -> jvmtiError,
1502    #[jni_added("1.0")]
1503    pub GetMethodModifiers: unsafe extern "system" fn(
1504        env: *mut jvmtiEnv,
1505        method: jmethodID,
1506        modifiers_ptr: *mut jint,
1507    ) -> jvmtiError,
1508    #[jni_added("25")]
1509    pub ClearAllFramePops:
1510        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread) -> jvmtiError,
1511    #[jni_added("1.0")]
1512    pub GetMaxLocals: unsafe extern "system" fn(
1513        env: *mut jvmtiEnv,
1514        method: jmethodID,
1515        max_ptr: *mut jint,
1516    ) -> jvmtiError,
1517    #[jni_added("1.0")]
1518    pub GetArgumentsSize: unsafe extern "system" fn(
1519        env: *mut jvmtiEnv,
1520        method: jmethodID,
1521        size_ptr: *mut jint,
1522    ) -> jvmtiError,
1523    #[jni_added("1.0")]
1524    pub GetLineNumberTable: unsafe extern "system" fn(
1525        env: *mut jvmtiEnv,
1526        method: jmethodID,
1527        entry_count_ptr: *mut jint,
1528        table_ptr: *mut *mut jvmtiLineNumberEntry,
1529    ) -> jvmtiError,
1530    #[jni_added("1.0")]
1531    pub GetMethodLocation: unsafe extern "system" fn(
1532        env: *mut jvmtiEnv,
1533        method: jmethodID,
1534        start_location_ptr: *mut jlocation,
1535        end_location_ptr: *mut jlocation,
1536    ) -> jvmtiError,
1537    #[jni_added("1.0")]
1538    pub GetLocalVariableTable: unsafe extern "system" fn(
1539        env: *mut jvmtiEnv,
1540        method: jmethodID,
1541        entry_count_ptr: *mut jint,
1542        table_ptr: *mut *mut jvmtiLocalVariableEntry,
1543    ) -> jvmtiError,
1544    #[jni_added("1.1")]
1545    pub SetNativeMethodPrefix:
1546        unsafe extern "system" fn(env: *mut jvmtiEnv, prefix: *const c_char) -> jvmtiError,
1547    #[jni_added("1.1")]
1548    pub SetNativeMethodPrefixes: unsafe extern "system" fn(
1549        env: *mut jvmtiEnv,
1550        prefix_count: jint,
1551        prefixes: *mut *mut c_char,
1552    ) -> jvmtiError,
1553    #[jni_added("1.0")]
1554    pub GetBytecodes: unsafe extern "system" fn(
1555        env: *mut jvmtiEnv,
1556        method: jmethodID,
1557        bytecode_count_ptr: *mut jint,
1558        bytecodes_ptr: *mut *mut c_uchar,
1559    ) -> jvmtiError,
1560    #[jni_added("1.0")]
1561    pub IsMethodNative: unsafe extern "system" fn(
1562        env: *mut jvmtiEnv,
1563        method: jmethodID,
1564        is_native_ptr: *mut jboolean,
1565    ) -> jvmtiError,
1566    #[jni_added("1.0")]
1567    pub IsMethodSynthetic: unsafe extern "system" fn(
1568        env: *mut jvmtiEnv,
1569        method: jmethodID,
1570        is_synthetic_ptr: *mut jboolean,
1571    ) -> jvmtiError,
1572    #[jni_added("1.0")]
1573    pub GetLoadedClasses: unsafe extern "system" fn(
1574        env: *mut jvmtiEnv,
1575        class_count_ptr: *mut jint,
1576        classes_ptr: *mut *mut jclass,
1577    ) -> jvmtiError,
1578    #[jni_added("1.0")]
1579    pub GetClassLoaderClasses: unsafe extern "system" fn(
1580        env: *mut jvmtiEnv,
1581        initiating_loader: jobject,
1582        class_count_ptr: *mut jint,
1583        classes_ptr: *mut *mut jclass,
1584    ) -> jvmtiError,
1585    #[jni_added("1.0")]
1586    pub PopFrame: unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread) -> jvmtiError,
1587    #[jni_added("1.1")]
1588    pub ForceEarlyReturnObject: unsafe extern "system" fn(
1589        env: *mut jvmtiEnv,
1590        thread: jthread,
1591        value: jobject,
1592    ) -> jvmtiError,
1593    #[jni_added("1.1")]
1594    pub ForceEarlyReturnInt:
1595        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread, value: jint) -> jvmtiError,
1596    #[jni_added("1.1")]
1597    pub ForceEarlyReturnLong:
1598        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread, value: jlong) -> jvmtiError,
1599    #[jni_added("1.1")]
1600    pub ForceEarlyReturnFloat:
1601        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread, value: jfloat) -> jvmtiError,
1602    #[jni_added("1.1")]
1603    pub ForceEarlyReturnDouble: unsafe extern "system" fn(
1604        env: *mut jvmtiEnv,
1605        thread: jthread,
1606        value: jdouble,
1607    ) -> jvmtiError,
1608    #[jni_added("1.1")]
1609    pub ForceEarlyReturnVoid:
1610        unsafe extern "system" fn(env: *mut jvmtiEnv, thread: jthread) -> jvmtiError,
1611    #[jni_added("1.0")]
1612    pub RedefineClasses: unsafe extern "system" fn(
1613        env: *mut jvmtiEnv,
1614        class_count: jint,
1615        class_definitions: *const jvmtiClassDefinition,
1616    ) -> jvmtiError,
1617    #[jni_added("1.0")]
1618    pub GetVersionNumber:
1619        unsafe extern "system" fn(env: *mut jvmtiEnv, version_ptr: *mut jint) -> jvmtiError,
1620    #[jni_added("1.0")]
1621    pub GetCapabilities: unsafe extern "system" fn(
1622        env: *mut jvmtiEnv,
1623        capabilities_ptr: *mut jvmtiCapabilities,
1624    ) -> jvmtiError,
1625    #[jni_added("1.0")]
1626    pub GetSourceDebugExtension: unsafe extern "system" fn(
1627        env: *mut jvmtiEnv,
1628        klass: jclass,
1629        source_debug_extension_ptr: *mut *mut c_char,
1630    ) -> jvmtiError,
1631    #[jni_added("1.0")]
1632    pub IsMethodObsolete: unsafe extern "system" fn(
1633        env: *mut jvmtiEnv,
1634        method: jmethodID,
1635        is_obsolete_ptr: *mut jboolean,
1636    ) -> jvmtiError,
1637    #[jni_added("1.0")]
1638    pub SuspendThreadList: unsafe extern "system" fn(
1639        env: *mut jvmtiEnv,
1640        request_count: jint,
1641        request_list: *const jthread,
1642        results: *mut jvmtiError,
1643    ) -> jvmtiError,
1644    #[jni_added("1.0")]
1645    pub ResumeThreadList: unsafe extern "system" fn(
1646        env: *mut jvmtiEnv,
1647        request_count: jint,
1648        request_list: *const jthread,
1649        results: *mut jvmtiError,
1650    ) -> jvmtiError,
1651    #[jni_added("9")]
1652    pub AddModuleReads: unsafe extern "system" fn(
1653        env: *mut jvmtiEnv,
1654        module: jobject,
1655        to_module: jobject,
1656    ) -> jvmtiError,
1657    #[jni_added("9")]
1658    pub AddModuleExports: unsafe extern "system" fn(
1659        env: *mut jvmtiEnv,
1660        module: jobject,
1661        pkg_name: *const c_char,
1662        to_module: jobject,
1663    ) -> jvmtiError,
1664    #[jni_added("9")]
1665    pub AddModuleOpens: unsafe extern "system" fn(
1666        env: *mut jvmtiEnv,
1667        module: jobject,
1668        pkg_name: *const c_char,
1669        to_module: jobject,
1670    ) -> jvmtiError,
1671    #[jni_added("9")]
1672    pub AddModuleUses: unsafe extern "system" fn(
1673        env: *mut jvmtiEnv,
1674        module: jobject,
1675        service: jclass,
1676    ) -> jvmtiError,
1677    #[jni_added("9")]
1678    pub AddModuleProvides: unsafe extern "system" fn(
1679        env: *mut jvmtiEnv,
1680        module: jobject,
1681        service: jclass,
1682        impl_class: jclass,
1683    ) -> jvmtiError,
1684    #[jni_added("9")]
1685    pub IsModifiableModule: unsafe extern "system" fn(
1686        env: *mut jvmtiEnv,
1687        module: jobject,
1688        is_modifiable_module_ptr: *mut jboolean,
1689    ) -> jvmtiError,
1690    #[jni_added("1.0")]
1691    pub GetAllStackTraces: unsafe extern "system" fn(
1692        env: *mut jvmtiEnv,
1693        max_frame_count: jint,
1694        stack_info_ptr: *mut *mut jvmtiStackInfo,
1695        thread_count_ptr: *mut jint,
1696    ) -> jvmtiError,
1697    #[jni_added("1.0")]
1698    pub GetThreadListStackTraces: unsafe extern "system" fn(
1699        env: *mut jvmtiEnv,
1700        thread_count: jint,
1701        thread_list: *const jthread,
1702        max_frame_count: jint,
1703        stack_info_ptr: *mut *mut jvmtiStackInfo,
1704    ) -> jvmtiError,
1705    #[jni_added("1.0")]
1706    pub GetThreadLocalStorage: unsafe extern "system" fn(
1707        env: *mut jvmtiEnv,
1708        thread: jthread,
1709        data_ptr: *mut *mut c_void,
1710    ) -> jvmtiError,
1711    #[jni_added("1.0")]
1712    pub SetThreadLocalStorage: unsafe extern "system" fn(
1713        env: *mut jvmtiEnv,
1714        thread: jthread,
1715        data: *const c_void,
1716    ) -> jvmtiError,
1717    #[jni_added("1.0")]
1718    pub GetStackTrace: unsafe extern "system" fn(
1719        env: *mut jvmtiEnv,
1720        thread: jthread,
1721        start_depth: jint,
1722        max_frame_count: jint,
1723        frame_buffer: *mut jvmtiFrameInfo,
1724        count_ptr: *mut jint,
1725    ) -> jvmtiError,
1726    #[jni_added("reserved")]
1727    pub reserved105: *mut c_void,
1728    #[jni_added("1.0")]
1729    pub GetTag: unsafe extern "system" fn(
1730        env: *mut jvmtiEnv,
1731        object: jobject,
1732        tag_ptr: *mut jlong,
1733    ) -> jvmtiError,
1734    #[jni_added("1.0")]
1735    pub SetTag:
1736        unsafe extern "system" fn(env: *mut jvmtiEnv, object: jobject, tag: jlong) -> jvmtiError,
1737    #[jni_added("1.0")]
1738    pub ForceGarbageCollection: unsafe extern "system" fn(env: *mut jvmtiEnv) -> jvmtiError,
1739    #[jni_added("1.0")]
1740    pub IterateOverObjectsReachableFromObject: unsafe extern "system" fn(
1741        env: *mut jvmtiEnv,
1742        object: jobject,
1743        object_reference_callback: jvmtiObjectReferenceCallback,
1744        user_data: *const c_void,
1745    ) -> jvmtiError,
1746    #[jni_added("1.0")]
1747    pub IterateOverReachableObjects: unsafe extern "system" fn(
1748        env: *mut jvmtiEnv,
1749        heap_root_callback: jvmtiHeapRootCallback,
1750        stack_ref_callback: jvmtiStackReferenceCallback,
1751        object_ref_callback: jvmtiObjectReferenceCallback,
1752        user_data: *const c_void,
1753    ) -> jvmtiError,
1754    #[jni_added("1.0")]
1755    pub IterateOverHeap: unsafe extern "system" fn(
1756        env: *mut jvmtiEnv,
1757        object_filter: jvmtiHeapObjectFilter,
1758        heap_object_callback: jvmtiHeapObjectCallback,
1759        user_data: *const c_void,
1760    ) -> jvmtiError,
1761    #[jni_added("1.0")]
1762    pub IterateOverInstancesOfClass: unsafe extern "system" fn(
1763        env: *mut jvmtiEnv,
1764        klass: jclass,
1765        object_filter: jvmtiHeapObjectFilter,
1766        heap_object_callback: jvmtiHeapObjectCallback,
1767        user_data: *const c_void,
1768    ) -> jvmtiError,
1769    #[jni_added("reserved")]
1770    pub reserved113: *mut c_void,
1771    #[jni_added("1.0")]
1772    pub GetObjectsWithTags: unsafe extern "system" fn(
1773        env: *mut jvmtiEnv,
1774        tag_count: jint,
1775        tags: *const jlong,
1776        count_ptr: *mut jint,
1777        object_result_ptr: *mut *mut jobject,
1778        tag_result_ptr: *mut *mut jlong,
1779    ) -> jvmtiError,
1780    #[jni_added("1.1")]
1781    pub FollowReferences: unsafe extern "system" fn(
1782        env: *mut jvmtiEnv,
1783        heap_filter: jint,
1784        klass: jclass,
1785        initial_object: jobject,
1786        callbacks: *const jvmtiHeapCallbacks,
1787        user_data: *const c_void,
1788    ) -> jvmtiError,
1789    #[jni_added("1.1")]
1790    pub IterateThroughHeap: unsafe extern "system" fn(
1791        env: *mut jvmtiEnv,
1792        heap_filter: jint,
1793        klass: jclass,
1794        callbacks: *const jvmtiHeapCallbacks,
1795        user_data: *const c_void,
1796    ) -> jvmtiError,
1797    #[jni_added("reserved")]
1798    pub reserved117: *mut c_void,
1799    #[jni_added("21")]
1800    pub SuspendAllVirtualThreads: unsafe extern "system" fn(
1801        env: *mut jvmtiEnv,
1802        except_count: jint,
1803        except_list: *const jthread,
1804    ) -> jvmtiError,
1805    #[jni_added("21")]
1806    pub ResumeAllVirtualThreads: unsafe extern "system" fn(
1807        env: *mut jvmtiEnv,
1808        except_count: jint,
1809        except_list: *const jthread,
1810    ) -> jvmtiError,
1811    #[jni_added("1.0")]
1812    pub SetJNIFunctionTable: unsafe extern "system" fn(
1813        env: *mut jvmtiEnv,
1814        function_table: *const JNINativeInterface_,
1815    ) -> jvmtiError,
1816    #[jni_added("1.0")]
1817    pub GetJNIFunctionTable: unsafe extern "system" fn(
1818        env: *mut jvmtiEnv,
1819        function_table: *mut *mut JNINativeInterface_,
1820    ) -> jvmtiError,
1821
1822    #[jni_added("1.0")]
1823    pub SetEventCallbacks: unsafe extern "system" fn(
1824        env: *mut jvmtiEnv,
1825        callbacks: *const jvmtiEventCallbacks,
1826        size_of_callbacks: jint,
1827    ) -> jvmtiError,
1828    #[jni_added("1.0")]
1829    pub GenerateEvents:
1830        unsafe extern "system" fn(env: *mut jvmtiEnv, event_type: jvmtiEvent) -> jvmtiError,
1831    #[jni_added("1.0")]
1832    pub GetExtensionFunctions: unsafe extern "system" fn(
1833        env: *mut jvmtiEnv,
1834        extension_count_ptr: *mut jint,
1835        extensions: *mut *mut jvmtiExtensionFunctionInfo,
1836    ) -> jvmtiError,
1837    #[jni_added("1.0")]
1838    pub GetExtensionEvents: unsafe extern "system" fn(
1839        env: *mut jvmtiEnv,
1840        extension_count_ptr: *mut jint,
1841        extensions: *mut *mut jvmtiExtensionEventInfo,
1842    ) -> jvmtiError,
1843    #[jni_added("1.0")]
1844    pub SetExtensionEventCallback: unsafe extern "system" fn(
1845        env: *mut jvmtiEnv,
1846        extension_event_index: jint,
1847        callback: jvmtiExtensionEvent,
1848    ) -> jvmtiError,
1849    #[jni_added("1.0")]
1850    pub DisposeEnvironment: unsafe extern "system" fn(env: *mut jvmtiEnv) -> jvmtiError,
1851    #[jni_added("1.0")]
1852    pub GetErrorName: unsafe extern "system" fn(
1853        env: *mut jvmtiEnv,
1854        error: jvmtiError,
1855        name_ptr: *mut *mut c_char,
1856    ) -> jvmtiError,
1857    #[jni_added("1.0")]
1858    pub GetJLocationFormat: unsafe extern "system" fn(
1859        env: *mut jvmtiEnv,
1860        format_ptr: *mut jvmtiJlocationFormat,
1861    ) -> jvmtiError,
1862    #[jni_added("1.0")]
1863    pub GetSystemProperties: unsafe extern "system" fn(
1864        env: *mut jvmtiEnv,
1865        count_ptr: *mut jint,
1866        property_ptr: *mut *mut *mut c_char,
1867    ) -> jvmtiError,
1868    #[jni_added("1.0")]
1869    pub GetSystemProperty: unsafe extern "system" fn(
1870        env: *mut jvmtiEnv,
1871        property: *const c_char,
1872        value_ptr: *mut *mut c_char,
1873    ) -> jvmtiError,
1874    #[jni_added("1.0")]
1875    pub SetSystemProperty: unsafe extern "system" fn(
1876        env: *mut jvmtiEnv,
1877        property: *const c_char,
1878        value: *const c_char,
1879    ) -> jvmtiError,
1880    #[jni_added("1.0")]
1881    pub GetPhase:
1882        unsafe extern "system" fn(env: *mut jvmtiEnv, phase_ptr: *mut jvmtiPhase) -> jvmtiError,
1883    #[jni_added("1.0")]
1884    pub GetCurrentThreadCpuTimerInfo:
1885        unsafe extern "system" fn(env: *mut jvmtiEnv, info_ptr: *mut jvmtiTimerInfo) -> jvmtiError,
1886    #[jni_added("1.0")]
1887    pub GetCurrentThreadCpuTime:
1888        unsafe extern "system" fn(env: *mut jvmtiEnv, nanos_ptr: *mut jlong) -> jvmtiError,
1889    #[jni_added("1.0")]
1890    pub GetThreadCpuTimerInfo:
1891        unsafe extern "system" fn(env: *mut jvmtiEnv, info_ptr: *mut jvmtiTimerInfo) -> jvmtiError,
1892    #[jni_added("1.0")]
1893    pub GetThreadCpuTime: unsafe extern "system" fn(
1894        env: *mut jvmtiEnv,
1895        thread: jthread,
1896        nanos_ptr: *mut jlong,
1897    ) -> jvmtiError,
1898    #[jni_added("1.0")]
1899    pub GetTimerInfo:
1900        unsafe extern "system" fn(env: *mut jvmtiEnv, info_ptr: *mut jvmtiTimerInfo) -> jvmtiError,
1901    #[jni_added("1.0")]
1902    pub GetTime: unsafe extern "system" fn(env: *mut jvmtiEnv, nanos_ptr: *mut jlong) -> jvmtiError,
1903    #[jni_added("1.0")]
1904    pub GetPotentialCapabilities: unsafe extern "system" fn(
1905        env: *mut jvmtiEnv,
1906        capabilities_ptr: *mut jvmtiCapabilities,
1907    ) -> jvmtiError,
1908    #[jni_added("reserved")]
1909    pub reserved141: *mut c_void,
1910    #[jni_added("1.0")]
1911    pub AddCapabilities: unsafe extern "system" fn(
1912        env: *mut jvmtiEnv,
1913        capabilities_ptr: *const jvmtiCapabilities,
1914    ) -> jvmtiError,
1915    #[jni_added("1.0")]
1916    pub RelinquishCapabilities: unsafe extern "system" fn(
1917        env: *mut jvmtiEnv,
1918        capabilities_ptr: *const jvmtiCapabilities,
1919    ) -> jvmtiError,
1920    #[jni_added("1.0")]
1921    pub GetAvailableProcessors:
1922        unsafe extern "system" fn(env: *mut jvmtiEnv, processor_count_ptr: *mut jint) -> jvmtiError,
1923    #[jni_added("1.1")]
1924    pub GetClassVersionNumbers: unsafe extern "system" fn(
1925        env: *mut jvmtiEnv,
1926        klass: jclass,
1927        minor_version_ptr: *mut jint,
1928        major_version_ptr: *mut jint,
1929    ) -> jvmtiError,
1930    #[jni_added("1.1")]
1931    pub GetConstantPool: unsafe extern "system" fn(
1932        env: *mut jvmtiEnv,
1933        klass: jclass,
1934        constant_pool_count_ptr: *mut jint,
1935        constant_pool_byte_count_ptr: *mut jint,
1936        constant_pool_bytes_ptr: *mut *mut c_uchar,
1937    ) -> jvmtiError,
1938    #[jni_added("1.0")]
1939    pub GetEnvironmentLocalStorage:
1940        unsafe extern "system" fn(env: *mut jvmtiEnv, data_ptr: *mut *mut c_void) -> jvmtiError,
1941    #[jni_added("1.0")]
1942    pub SetEnvironmentLocalStorage:
1943        unsafe extern "system" fn(env: *mut jvmtiEnv, data: *const c_void) -> jvmtiError,
1944    #[jni_added("1.0")]
1945    pub AddToBootstrapClassLoaderSearch:
1946        unsafe extern "system" fn(env: *mut jvmtiEnv, segment: *const c_char) -> jvmtiError,
1947    #[jni_added("1.1")]
1948    pub SetVerboseFlag: unsafe extern "system" fn(
1949        env: *mut jvmtiEnv,
1950        flag: jvmtiVerboseFlag,
1951        value: jboolean,
1952    ) -> jvmtiError,
1953    #[jni_added("1.1")]
1954    pub AddToSystemClassLoaderSearch:
1955        unsafe extern "system" fn(env: *mut jvmtiEnv, segment: *const c_char) -> jvmtiError,
1956    #[jni_added("1.1")]
1957    pub RetransformClasses: unsafe extern "system" fn(
1958        env: *mut jvmtiEnv,
1959        class_count: jint,
1960        classes: *const jclass,
1961    ) -> jvmtiError,
1962    #[jni_added("1.1")]
1963    pub GetOwnedMonitorStackDepthInfo: unsafe extern "system" fn(
1964        env: *mut jvmtiEnv,
1965        thread: jthread,
1966        monitor_info_count_ptr: *mut jint,
1967        monitor_info_ptr: *mut *mut jvmtiMonitorStackDepthInfo,
1968    ) -> jvmtiError,
1969    #[jni_added("1.0")]
1970    pub GetObjectSize: unsafe extern "system" fn(
1971        env: *mut jvmtiEnv,
1972        object: jobject,
1973        size_ptr: *mut jlong,
1974    ) -> jvmtiError,
1975    #[jni_added("1.2")]
1976    pub GetLocalInstance: unsafe extern "system" fn(
1977        env: *mut jvmtiEnv,
1978        thread: jthread,
1979        depth: jint,
1980        value_ptr: *mut jobject,
1981    ) -> jvmtiError,
1982    #[jni_added("11")]
1983    pub SetHeapSamplingInterval:
1984        unsafe extern "system" fn(env: *mut jvmtiEnv, sampling_interval: jint) -> jvmtiError,
1985}
1986
1987#[repr(C)]
1988#[derive(Copy, Debug)]
1989pub struct _jvmtiEnv {
1990    pub functions: *const jvmtiInterface_1_,
1991}
1992
1993impl Clone for _jvmtiEnv {
1994    fn clone(&self) -> Self {
1995        *self
1996    }
1997}