欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

addr2line工具调试so库

程序员文章站 2024-01-13 19:47:52
...

错误日志:adb logcat > log.txt 可以抓取查看崩溃信息, 搜关键字backtrace:
arm-linux-androideabi-addr2line工具路径:ndk安装目录下可以找到
so库路径:在Android-studio intermediates/cmake/debug/obj/目录下

调试命令
arm-linux-androideabi-addr2line -C -f -e ${SOPATH} ${Address}

示例:

我的addr2line.exe工具在
/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin/目录,切换至该目录下执行:

./aarch64-linux-android-addr2line.exe -C -f -e /c/Users/80284746/Desktop//Server/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnativeEngine_jni.so 0000000000040d38 0000000000040d10 0000000000040bf4 0000000000040af0 0000000000044078

显示结果:

std::__ndk1::__function::__value_func<int (unsigned char*, int)>::operator bool() const
C:/Users/80284746/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/functional:1909
std::__ndk1::function<int (unsigned char*, int)>::operator bool() const
C:/Users/80284746/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/functional:2325
bool std::__ndk1::operator!=<int, unsigned char*, int>(std::__ndk1::function<int (unsigned char*, int)> const&, decltype(nullptr))
C:/Users/80284746/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/functional:2516
Task::run()
C:/Users/80284746/Desktop/Server/app/src/main/native/vision/video/framework/task.cc:47
ThreadPool::runInWorkThread(ThreadPool::WorkThread*)
C:/Users/80284746/Desktop/Server/app/src/main/native/vision/video/framework/threadpool.cc:109
相关标签: C++ 调试工具