NDK调试,R9工作在W7 / 64,但给我的问题在XP [英] NDK debugging with r9 works on W7/64 but gives me issues in XP
问题描述
我最近加载了全新的Android开发工具,SDK 20130717和NDK R9。
到现在为止,我有previous版本,在Eclipse上我的两个系统,一个XP和W7的工作和调试就好/ 64。
现在,W7 / 64的新工具做的工作和调试我的应用程序的新工具的安装和所需的路径环境变化后确定。
当我选择调试为+Android原生应用它工作正常。
然而,XP中,虽然它们在文件夹的角度的确切配置/在cygwin等,安装后的新的工具和必要的路径的env改变,它看起来它不能启动NDK-dbg的和它氏卡住在明确守候在启动MyApp的(1)(100%)。
出现这种情况后,我选择了调试为+Android原生应用。
这是什么可能是它的原因任何提示?要么
有没有在XP和R9调试任何已知的问题,我错过?
谢谢,
克里斯托
*修改
试图启动手动NDK-GDB,这是我所得到的,任何提示,欢迎
块引用
$ NDK-GDB --start --verbose --force
的Android NDK安装路径为:/ cygdrive / E / Android的NDK-R9
使用默认ADB命令:/ cygdrive / E / ADT-束Windows的x86-20130717 / SDK /平台的工具/亚行
找到ADB版本:Android的调试桥版本1.0.31
使用亚行标志:
使用JDB命令:/cygdrive/e/Android/Java/jdk1.7.0_21/bin/jdb
使用自动检测到的项目路径:
找到包的名字:myndkpackage
按应用针对性的ABI:armeabi-V7A
设备API等级:17
设备CPU的ABI:armeabi-V7A armeabi
兼容设备ABI:armeabi-V7A
用gdb设置初始化:./libs/armeabi-v7a/gdb.setup
使用工具链preFIX: /cygdrive/e/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/windows/bin/arm-linux-androideabi-
使用App out目录:./obj/local/armeabi-v7a
找到调试的标志:真
找到的设备gdbserver的:/数据/数据/ myndkpackage / lib目录/ gdbserver的
发现数据目录:/数据/数据/ myndkpackage
找到第一可启动的活动:myndkpackage.MainActivity
下水活动:myndkpackage / myndkpackage.MainActivity
命令:adb_cmd外壳上午开始-D -n myndkpackage / myndkpackage.MainActivity
开始:意向{CMP = myndkpackage / .MainActivity}
命令:adb_cmd外壳睡2
找到运行PID:2787
杀死现有调试会话
命令:adb_cmd外壳杀-9 2753
gdbserver的推出成功地
设置网络重定向
命令:adb_cmd shell中运行,如LIB myndkpackage / gdbserver的调试+插座--attach 2787
命令:adb_cmd转发TCP:5039 localfilesystem:/数据/数据/ myndkpackage /调试插槽
附; PID = 2787
在Unix套接字调试插座听力
命令:adb_cmd拉/系统/斌/ app_process OBJ /本地/ armeabi-V7A / app_process
599 KB /秒(在0.015s 9588字节)
拉app_process从设备/仿真器。
命令:adb_cmd拉/系统/斌/连接器OBJ /本地/ armeabi-V7A /连接器
658 KB /秒(在0.093s 63244字节)
拉连接从设备/仿真器。
命令:adb_cmd拉/system/lib/libc.so OBJ /本地/ armeabi-V7A / libc.so
744 KB /秒(在0.390s 297608字节)
从设备/仿真器libc.so拉动。
设置JDB连接
命令:adb_cmd转发TCP:65534 JDWP:2787
java.io.IOException异常:握手失败 - 连接prematurally关闭
在com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:136)
在com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:232)
在com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
在com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
在com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:519)
在com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:328)
在com.sun.tools.example.debug.tty.Env.init(Env.java:63)
在com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)
致命错误:
无法附加到目标VM。
/ cygdrive / E / Android的NDK-R9 / NDK-GDB:行742:4636段错误$ GDBCLIENT -x
native_path $ GDBSETUP
块引用
块引用>解决方案好吧,
据我了解,其在新的R9版本的一个问题,特别是在名为
android-ndk-r9/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/windows/bin/arm-linux-androideabi-gdb
这可执行使分段错误。
因此,看起来,在发行它尚未正确地从开始产生,从机器人的开发者本身谁上传它在主机器人站点
我试过和重新下载R9分配和重新安装,但同样的事情发生,所以还不是偶然的东西如一个坏解压。
我试过R8E相同的文件上了年纪,并没有给段错误,它工作正常。
所以,我做了一件让我说的话一个概念证明,并采取了previous版本文件(从R8E),并覆盖新R9文件,然后再次尝试运行失败的NDK-DBG和。
.. IT工程..
现在我有一个新的R9 NDK,但是从R8E一个文件,旧臂Linux的androideabi-gdb.exe,一切工作就好了!
所以我想在Android开发者不得不重新做的编译
- > android-ndk-r9/toolchains/arm-linux-androideabi-4.6/$p$pbuilt/windows/bin/arm-linux-androideabi-gdb.exe
工具,适当的这个时候。
至少我希望有人会发现这很有用,避免我有这么长的时间的无奈。
克里斯托
I've recently loaded the new Android dev tools, SDK 20130717 and NDK r9.
Up to now I had the previous versions, working and debugging from within Eclipse just fine on both of my systems, a XP and a W7/64.
Now, the W7/64 with the new tools does work and debug my apps ok after the new tools installation and the required path environment changes.
It works ok when I select the "Debug As" + "Android Native Application".
Yet the XP, although they have the exact configuration in terms of folders/cygwin etc, after the new tools installed and the necessary path env changed, it looks that it can't start the ndk-dbg and it;s stuck waiting in definitively at "Launching MyApp(1): (100%)". That happens after I select the "Debug As" + "Android Native Application".
Any hints on what might be the cause of it? or is there any known issue on XP and r9 debugging that I miss?
thanks, Christos
*edit
Tried to start manually the ndk-gdb and this is what I get, any hints are welcome
Blockquote
$ ndk-gdb --start --verbose --force
Android NDK installation path: /cygdrive/e/android-ndk-r9
Using default adb command: /cygdrive/e/adt-bundle-windows-x86-20130717/sdk/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.31
Using ADB flags:
Using JDB command: /cygdrive/e/Android/Java/jdk1.7.0_21/bin/jdb
Using auto-detected project path: .
Found package name: myndkpackage
ABIs targetted by application: armeabi-v7a
Device API Level: 17
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi-v7a
Using gdb setup init: ./libs/armeabi-v7a/gdb.setup
Using toolchain prefix: /cygdrive/e/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-
Using app out directory: ./obj/local/armeabi-v7a
Found debuggable flag: true
Found device gdbserver: /data/data/myndkpackage/lib/gdbserver
Found data directory: '/data/data/myndkpackage'
Found first launchable activity: myndkpackage.MainActivity
Launching activity: myndkpackage/myndkpackage.MainActivity
COMMAND: adb_cmd shell am start -D -n myndkpackage/myndkpackage.MainActivity
Starting: Intent { cmp=myndkpackage/.MainActivity }
COMMAND: adb_cmd shell sleep 2
Found running PID: 2787
Killing existing debugging session
COMMAND: adb_cmd shell kill -9 2753
Launched gdbserver succesfully.
Setup network redirection
COMMAND: adb_cmd shell run-as myndkpackage lib/gdbserver +debug-socket --attach 2787
COMMAND: adb_cmd forward tcp:5039 localfilesystem:/data/data/myndkpackage/debug-socket
Attached; pid = 2787
Listening on Unix socket debug-socket
COMMAND: adb_cmd pull /system/bin/app_process obj/local/armeabi-v7a/app_process
599 KB/s (9588 bytes in 0.015s)
Pulled app_process from device/emulator.
COMMAND: adb_cmd pull /system/bin/linker obj/local/armeabi-v7a/linker
658 KB/s (63244 bytes in 0.093s)
Pulled linker from device/emulator.
COMMAND: adb_cmd pull /system/lib/libc.so obj/local/armeabi-v7a/libc.so
744 KB/s (297608 bytes in 0.390s)
Pulled libc.so from device/emulator.
Setup JDB connection
COMMAND: adb_cmd forward tcp:65534 jdwp:2787
java.io.IOException: handshake failed - connection prematurally closed
at com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:136)
at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:232)
at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:519)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:328)
at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)
Fatal error:
Unable to attach to target VM.
/cygdrive/e/android-ndk-r9/ndk-gdb: line 742: 4636 Segmentation fault $GDBCLIENT -x
native_path $GDBSETUP
Blockquote
解决方案Ok,
From what I understand, its a problem in the new r9 release, specifically in the file named
android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gdb
This executable gives the segmentation fault.
So it looks that in the distro it has not been generated correctly from the start, from the android devs themselves who uploaded it on the main android site.
I tried and re-downloaded the r9 distribution and re-installed, yet the same thing happens so it was not something accidental eg a bad unzip.
I tried the older r8e same file and it does not give the segmentation fault, it works ok.
So, I did something to get a proof of concept of what I say and took the previous version file (from r8e) and overwrite the new r9 file, then tried again to run the failing ndk-dbg and..
..IT WORKS..
Now I have a new r9 NDK but with one file from the r8e, the old arm-linux-androideabi-gdb.exe and everything works just fine!
So I guess the android devs have to re-do the compilation of the
-> android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gdb.exe
tool, properly this time.
At least I hope someone will find this useful and avoid the frustration that I had all this time.
Christos
这篇关于NDK调试,R9工作在W7 / 64,但给我的问题在XP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!