After searching this mailing list (and stackoverflow etc), it seems that there are many ways to get the stack backtrace in android NDK.
However, I found none of these works.
ndk-gdb can't seem to even attach to my process, giving a "Application GL2JNI (process com.android.gl2jni) is waiting for the debugger to attach
ndk-stack doesn't do it, because somehow the stack trace is incomplete and only really shows the last two lines
I/DEBUG ( 179): backtrace:
I/DEBUG ( 179): #00 pc 00021f90 /system/lib/libc.so (tgkill+12)
I/DEBUG ( 179): #01 pc 00012fe1 /system/lib/libc.so (pthread_kill+48)
I/DEBUG ( 179): #02 pc 000131f5 /system/lib/libc.so (raise+10)
I/DEBUG ( 179): #03 pc 00d7c674 /data/app-lib/com.android.gl2jni-2/libgl2jni.so (Shing::reportAssert(char const*, int, char const*, char const*, char const*, std::string const&)+2956)
there are mentions of "CallStack" but I can't really find the headers anywhere in the android r9 distribution I have. Is that some sort of external code?
Thanks in advance if anybody could point me to the right direction. My head have been melting trying to find the solution, unfortunately I don't think I'm striking gold anytime soon.
Cheers