jni - JVMTI get <clinit> location -


in project want location of method in java class, , set breakpoint there. here code task:

void jnicall classprepare(jvmtienv *jvmti_env, jnienv* jni_env, jthread thread,         jclass klass) {     ... code ...      getmethodname(methods_ptr, &methodname, &methodsignature, &generic_ptr));     if (strcmp(methodname, "<clinit>") == 0) {         jlocation* start;         jlocation* end;          checkjvmtierror(jvmti_env->getmethodlocation(methods_ptr, start, end));          //checkjvmtierror(jvmti_env->setbreakpoint(methods_ptr, *start));     }     ... code ... 

}

at point line numbers of <clinit> method , jvmtierror 100 (null pointer) , cannot understand how resolve , nor know why appear in first place.

so there wrong in how line numbers? allowed line numbers of method?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -