Here is my problem : I'm learning how to debug native code using gdb
and I found this article :
http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/
It's a little application with a big button which, when pressed,
called a native function containing something like :
int * badptr = 0x00000000;
*badptr = 1;
(you can download the sample, that's what I did)
Everything works perfectly, I can compile this, debug it with gdb, set
a breakpoint and step once I hit it, etc. (I didn't even had to do the
part about modifying the ndk (step 2 of the article))
Now I want to start playing with C++ (class and method debugging. I
never used gdb, so I need to get used to it before trying to use it in
my project) So what i did is change the extension of the native file
to .cpp, and updated the Android.mk file like this :
- change the LOCAL_SRC_FILES to use the .cpp file
- changed the LOCAL_CFLAGS to LOCAL_CPPFLAGS
But now, gdb doesn't seem to work correctly anymore ! When I launch
it, there's nothing different, I can even set breakpoints, but as soon
as I continue and press the button which makes the application crash,
I get a popup on my device saying : "The application has stopped
unexpectedly. Please try again." with a "Force close" button.
And gdb doesn't reach the breakpoint I set ! When I press the "Force
close" button, gdb simply prints this :
"
Child terminated with signal = 9
Program terminated with signal SIGKILL, Killed.
she program no longer exist
Child terminated with signal = 0x9 (SIGKILL)
GDBserver exiting
"
I've search for hours, but I didn't find anything ... I don't even
know it this is something gdb related, something related to the
makefile (an option needed to make C++ debuggable ?) or something else
...
Any help would be greatly appreciated !
Thanks in advance.
--
http://blog.pcitron.fr (blog)
http://gallery.pcitron.fr (photos)
http://profiles.bleau.info/damien.courtois (profil bleau.info)
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
