简体   繁体   中英

How to dump function parameter values of stack trace on Android dalvik JVM?

When exception is caught, we can call Throwable.printStackTrace() to dump the stack trace. But I'd like to also dump each frame's parameters' value on the stack trace. Is this possible on Android's dalvik JVM? Exception stack example:

java.lang.NullPointerException
    at com.xxxx.activity.OperationActivity.showError(OperationActivity.java:879)
    at com.xxxx.activity.SearchActivity.showList(SearchActivity.java:611)
    at com.xxxx.activity.OperationActivity.checkState(OperationActivity.java:756)
    at com.xxxx.activity.SearchActivity$14.handleMessage(SearchActivity.java:627)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4898)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
    at dalvik.system.NativeStart.main(Native Method)

I want to print all the function parameter values for each frame on stack trace, for example: the parameter values of com.xxxx.activity.OperationActivity.showError() function.

Thanks a lot.

查看StackTraceElement Android dalvik不存储此信息,它仅在调试模式下可用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM