Get function names from call stack

后端 未结 3 1429
醉梦人生
醉梦人生 2020-11-30 06:49

I am working on an Android program which calls in to native code. That native code is segfaulting, and since getting debugging working through the android NDK is not really

相关标签:
3条回答
  • 2020-11-30 07:30

    You need to generate a map file. The map file contains the function address and memory locations in your executable. Have your build system modified to generate a map file.

    From the map file, you can use a text editor and search for addresses. I once wrote a program to find the two symbols bounding a given address. Worked great for environments like yours.

    0 讨论(0)
  • 2020-11-30 07:39

    You can use the ndk-stack script included in the latest ndks. The usage is simple: ndk-stack -sym "dir to objects with symbols" -dump "location to the logfile"

    0 讨论(0)
  • 2020-11-30 07:41

    You should have a copy of arm-eabi-addr2line available in the NDK bin directory. You can use this with a command like:

    arm-eabi-addr2line -f -e /path/to/lib/with/symbols.so 0x001fb18a

    That will crawl through the debug symbols in the shared lib to get file and line number information. For best results hand it a library that hasn't had the debugging stuff stripped out.

    0 讨论(0)
提交回复
热议问题