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