java调用栈中行号
Posted lin-0410
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java调用栈中行号相关的知识,希望对你有一定的参考价值。
java stacktrace line numer
java调用栈中行号:
行号表:https://book.51cto.com/art/201701/528010.htm
行号获取:https://docs.oracle.com/javase/10/docs/api/java/lang/StackTraceElement.html#getLineNumber()
行号是负数的情况:
https://stackoverflow.com/questions/49070987/why-some-stack-trace-have-negative-line-number
A value of -2 indicates that the method containing the execution point is a native method
-1 means that the line number information is not available, for some reason. As you already noticed this is usually a case for classes from libs.
附录:
Adb root ;adb remount; adb shell debuggerd64/32 -b pid //保存所有线程(包括native线程)堆栈
Adb shell kill -3 pid // 保存java线程堆栈,就是执行了ANR
Thread.getAllStackTraces();
以上是关于java调用栈中行号的主要内容,如果未能解决你的问题,请参考以下文章