feat: Implement MethodEntry and MethodExit callbacks with event posting

This commit is contained in:
xiaozhou233 committed 2026-04-24 15:50:43 +08:00
1 parent 4c940c848b
commit 5b253ddd5d
4 files changed
+67 -1

No files matched your search

@@ -16,6 +16,24 @@ struct EventClassFileLoadHook {
unsigned char** new_classbytes;
};
// MethodEntry
struct EventMethodEntry {
jvmtiEnv* jvmti_env;
JNIEnv* jni_env;
jthread thread;
jmethodID method;
};
// MethodExit
struct EventMethodExit {
jvmtiEnv* jvmti_env;
JNIEnv* jni_env;
jthread thread;
jmethodID method;
jboolean was_popped_by_exception;
jvalue return_value;
};
// JuiceAgent PreLoad/PostLoad
struct EventPreLoad {
JavaVM* jvm;
+15 -1
View File
@@ -23,4 +23,18 @@ void JNICALL ClassFileLoadHook(
jint class_data_len,
const unsigned char* classbytes,
jint* new_class_data_len,
unsigned char** new_classbytes);
unsigned char** new_classbytes);
// See https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#MethodEntry
void JNICALL MethodEntry(jvmtiEnv *jvmti_env,
JNIEnv* jni_env,
jthread thread,
jmethodID method);
// See https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#MethodExit
void JNICALL MethodExit(jvmtiEnv *jvmti_env,
JNIEnv* jni_env,
jthread thread,
jmethodID method,
jboolean was_popped_by_exception,
jvalue return_value);