Android 2.2 ndk-gdb on real hardware target

104 views
Skip to first unread message

Jerry Yin

unread,
Oct 25, 2010, 3:49:40 PM10/25/10
to android-ndk
Hi All,
 
I followed these steps to use the ndk-gdb.
 
I could debug on the Android emulator (or simulator). When I debug on my hardware target, I could attach the Java debug configuration. But I can't attach the C debug configuration. The Eclipse gave this error message:
 
Target selection failed.
Remote communication error: Software caused connection abort.
Remote communication error: Software caused connection abort.
Remote communication error: Software caused connection abort.
 
The Console give these error info:
 
(no debugging symbols found)
91-gdb-set confirm off
91^done
(gdb)
92-gdb-set width 0
92^done
(gdb)
93-gdb-set height 0
93^done
(gdb)
94-interpreter-exec console echo
94^done
(gdb)
95-gdb-show prompt
95^done,value="(gdb) "
(gdb)
96-gdb-set auto-solib-add on
96^done
(gdb)
97-gdb-set stop-on-solib-events 0
97^done
98-gdb-set stop-on-solib-events 1
(gdb)
98^done
(gdb)
99-target-select remote localhost:5039
&"Remote communication error: Software caused connection abort.\n"
99^error,msg="Remote communication error: Software caused connection abort."
(gdb)
100-gdb-exit
100^exit
Remote communication error: Software caused connection abort.
 
Can someone help me out?
 
thanks,
Jerry
 

Jerry Yin

unread,
Oct 26, 2010, 11:13:58 AM10/26/10
to android-ndk
Maybe I ask this question in a different way, how to configure the gdb target IP address? Specifically I saw this line in the Eclipse console:
 
(gdb)
99-target-select remote localhost:5039
 
How do I change the "localhost" to the target IP address?
 
thanks,
Jerry

David Turner

unread,
Oct 26, 2010, 3:08:57 PM10/26/10
to andro...@googlegroups.com
On Tue, Oct 26, 2010 at 8:13 AM, Jerry Yin <jerry...@gmail.com> wrote:
Maybe I ask this question in a different way, how to configure the gdb target IP address? Specifically I saw this line in the Eclipse console:
 
(gdb)
99-target-select remote localhost:5039
 
How do I change the "localhost" to the target IP address?
 
Edit ndk-gdb? It's a shell script. In the end, it's only a convenience script that does a lot of checks and a little of setup for you. It shouldn't be difficult to modify, or to reproduce its features in a different script/program.
 
thanks,
Jerry

--
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.

Jerry Yin

unread,
Oct 27, 2010, 12:02:04 PM10/27/10
to andro...@googlegroups.com
 
Edit ndk-gdb? It's a shell script. In the end, it's only a convenience script that does a lot of checks and a little of setup for you. It shouldn't be difficult to modify, or to reproduce its features in a different script/program.
 
 
Hi David,
 
Thanks for your response. I could set the configuration from the Debugger -->connection -->"Host name or IP address" of this parameter. But it does not solve the problem.
 
I then compared with the simulator case and I found that the "gdbserver" is not runing in my hardware target. Then I manually run the gdbserver. Unfortunately the Eclipse still complain "Target Select Failed". My question is how and when the "gdbserver" is launched when run the ndk-gdb?
 
thanks,
Jerry

Jerry Yin

unread,
Oct 27, 2010, 12:25:04 PM10/27/10
to andro...@googlegroups.com
Now, I narrow down to these two lines in the ndk-gdb,
 
# Launch gdbserver now
DEBUG_SOCKET=debug-socket
run $ADB_CMD shell run-as $PACKAGE_NAME lib/gdbserver +$DEBUG_SOCKET --attach $PID &
 
 
When I run this from the adb shell, it gives this error message:
 
# run-as com.myapps lib/gdbserver localhost:5039 --attach 6953
[1]   Illegal instruction     run-as com.myapps lib/gdbserver localhost:5039 --attach 6953
 
Any idea?
 
thanks,
Jerry

Jerry Yin

unread,
Oct 27, 2010, 3:23:54 PM10/27/10
to andro...@googlegroups.com
Further on this issue. if I run the emulator, I saw the "debug-socket" is under the /data/data/com.myapps directory. But when I run the apps in the hardware target, I don't see the "debug-socket" device. That's the problem that I can't launch the "gdbserver".
 
How does the "debug-socket" is created?
 
thanks,
Jerry

David Turner

unread,
Oct 27, 2010, 11:06:42 PM10/27/10
to andro...@googlegroups.com
On Wed, Oct 27, 2010 at 12:23 PM, Jerry Yin <jerry...@gmail.com> wrote:
Further on this issue. if I run the emulator, I saw the "debug-socket" is under the /data/data/com.myapps directory. But when I run the apps in the hardware target, I don't see the "debug-socket" device. That's the problem that I can't launch the "gdbserver".
 
How does the "debug-socket" is created?
 

It's created by the "adb forward" forward command before the gdbserver launch.

David Turner

unread,
Oct 27, 2010, 11:07:50 PM10/27/10
to andro...@googlegroups.com
What platform are you running this in? The gdbserver is built for armeabi (i.e. it's an ARMv5TE binary)

 
thanks,
Jerry

--

Jerry Yin

unread,
Oct 28, 2010, 9:32:17 AM10/28/10
to andro...@googlegroups.com
Hi David,
 
thanks for your response.
 
The target I am using is the TI's Blaze. I just found that the gdbserver is started after running the ndk-gdb. It is the C debug configuration that killed the gdbserver when I launched the C debug process. I got this error message from the cygwin window.
 
[1]   Segmentation fault      run-as com.examp...
 
Regards,
Jerry
Reply all
Reply to author
Forward
0 new messages