I've setup my Eclipse to debug the Native side of my application using Eclipse & Seqoyah and added the appropriate C/C++ Application Debug Configuration.
The problem is it seems that Eclipse is trying to initiate a connection with the applications GDB server even before it launches it. I'm not to sure how to change the order in which Eclipse tries to d开发者_StackOverflow社区o things with Debug Configurations. Any help would be appreciated (as always).
http://wiki.eclipse.org/Sequoyah/ndk_guide
31-gdb-set confirm off
31^done
(gdb)
32-gdb-set width 0
32^done
(gdb)
33-gdb-set height 0
33^done
(gdb)
34-interpreter-exec console echo
34^done
(gdb)
35-gdb-show prompt
35^done,value="(gdb) "
(gdb)
36-gdb-set auto-solib-add on
36^done
(gdb)
37-gdb-set stop-on-solib-events 0
37^done
(gdb)
38-gdb-set stop-on-solib-events 1
38^done
(gdb)
39-target-select remote localhost:5039
&"Remote communication error: Connection reset by peer.\n"
39^error,msg="Remote communication error: Connection reset by peer."
(gdb)
40-gdb-exit
40^exit
Remote communication error: Connection reset by peer.
I managed to solve this one.
There should be two Debug Configurations available to your Java / C++ Native project. The first is for the Java side of things and the second is for the C++ side of things.
Make sure you have setup your environment according to: http://wiki.eclipse.org/Sequoyah/ndk_guide
Set a breakpoint just after the JNI Shared library is added or in your Activities onCreate.
Debug your application using its default debug configuration.
In a shell navigate to your project directory and issue $NDK/ndk-gdb (where $NDK is the location of your Android Native Development Kit).
Debug your application using its Native debugger that you created in the Sequoyah guide.
If all goes well you should be able to step into JNI code and when your application crashes, see where in your source it crashed.
I've not yet found a way to setup through the actual source yet, if anyone does please post here.
精彩评论