I'm working on a C++ application, that I debug on Android; as it happens, on some devices this app crashes. I've sort of narrowed it down to one function, which I try to debug with a breakpoint in ndk-gdb
. The first time, at start, the function runs and it breaks fine, e.g.:
Breakpoint 1, MyApp::MyFunc (this=0xb8541c40, curel=0xb8cb7e68, doShow=false)
at /path/to/src/MyApp.cpp:1600
1600 myObj.clear();
(gdb) c
Continuing.
Here, I've obviously typed c
and ENTER myself; but then, upon a user action, the function runs for a second time, and I get this:
Breakpoint 1, MyApp::MyFunc (this=0xb8541c40, curel=0xb8cb7e68, doShow=true)
at /path/to/src/MyApp.cpp:1600
1600 myObj.clear();
(gdb)
Continuing.
Program received signal SIGABRT, Aborted.
0xb6f7b1b0 in tgkill ()
from /path/to/obj/local/armeabi-v7a/libc.so
(gdb)
Continuing.
Program received signal SIGABRT, Aborted.
0xb6f7b1b0 in tgkill ()
from /path/to/obj/local/armeabi-v7a/libc.so
(gdb)
Continuing.
Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
So, here the breakpoint does hit, but it doesn't break - and even if I didn't press c
, it goes on with "Continuing", hitting SIGABRT twice and again "Continuing", and finally the program terminates.
From the limited information here, would anyone have an idea of why does this happen, and how to remedy it? For instance, could this be due to optimization (the app is compiled in what should be debug mode, but possibly some optimization is still there)? Btw this is GNU gdb (GDB) 7.7, android-ndk-r10e.