jvmti_rs/wrapper/jvmtifns/
mod.rs

1
2mod breakpoint;
3mod breakpoint_instance;
4mod breakpoint_static;
5mod capability;
6mod class;
7mod class_jni;
8mod class_loader_search;
9mod event_management;
10mod extension_mechanism;
11mod field;
12mod field_instance;
13mod field_static;
14mod force_early_return;
15mod general;
16mod heap;
17mod heap_1_0;
18mod heap_1_0_jni;
19mod heap_jni;
20mod jni_function_interception;
21mod local_variable;
22mod memory_management;
23mod method;
24mod method_instance;
25mod method_jni;
26mod method_static;
27mod object;
28mod raw_monitor;
29mod stack_frame;
30mod system_properties;
31mod thread;
32mod thread_group;
33mod timers;
34mod watched_field;
35
36#[macro_export]
37macro_rules! jvmti_catch {
38    ($jvmti:expr, $name:tt, |$e:ident:$type:ty| $callback:block) => {
39        debug!("looking up JVMTIEnv method {}", stringify!($name));
40        let call = |$e:$type| $callback;
41        match &$jvmti.$name() {
42            Ok(val) => call(val),
43            Err(e) => error!("call jvmti an exception occurs: {}", e)
44        }
45    };
46    ($jvmti:expr, $name:tt, |$e:ident:$type:ty| $callback:block $(, $args:expr )* ) => {
47        debug!("looking up JVMTIEnv method {}", stringify!($name));
48        let call = |$e:$type| $callback;
49        match &$jvmti.$name($($args),*,) {
50            Ok(val) => call(val),
51            Err(e) => error!("call jvmti an exception occurs: {}", e)
52        }
53    };
54}