jni 打印堆栈方法

一、jni 打印java 层堆栈。
    jclass  throwable_class = env->FindClass("java/lang/Throwable");
    jmethodID  throwable_init = env->GetMethodID(throwable_class, "", "(Ljava/lang/String;)V");
    jobject throwable_obj = env->NewObject(throwable_class, throwable_init, env->NewStringUTF("hecheng"));


    jmethodID throwable_mid = env->GetMethodID(throwable_class, "printStackTrace", "()V");
    env->CallVoidMethod(throwable_obj, throwable_mid);
--------------------- 
作者:程立001 
来源:CSDN 
原文:https://blog.csdn.net/xiaolli/article/details/52849462 
版权声明:本文为博主原创文章,转载请附上博文链接!

你可能感兴趣的:(JNI)