mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
feat: Implement MethodEntry and MethodExit callbacks with event posting
This commit is contained in:
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;
|
||||
|
||||
@@ -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);
|
||||
Reference in new issue
Block a user