Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell. I am only producing software for 64-bit ARM, because none of the customers want 32-bit code.
I would like to be able to print the call stack from my test harness' signal handler. This is not vital - I can get them easily enough using GDB - but if I can get stack tracebacks into my test harness' log file (this goes nowhere near logcat) it makes it easier to tell if multiple problems have related causes.
On Linux, macOS and iOS, I can use backtrace() and backtrace_symbol() to do this. I can't find anything quite so straightforward on Android, but I may be missing something.
The closest thing I've found is an example at
https://github.com/alexeikh/android-ndk-backtrace-test, but my Linux NDK 21b doesn't seem to have a libunwind.a for 64-bit ARM, only for 32-bit. That's at../android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/libunwind.a.
I have a ../android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/include/unwind.h, but no __unwind_config.h.
Help?
Thanks,
John Dallman