gdbserver静态编译-调试失败的原来
来源:互联网 发布:铃声合并软件 编辑:程序博客网 时间:2024/06/06 13:20
打算调试,zyote。众所周知,android的lib不是glibc.所以要个静态编译的gdbserver.
./configure --help
CFLAGS=-static ./configure --host=arm-none-linux-gnueabi
然后make当前目录下就gdbserver出来了。readelf -d结果为静态文件。
用自己编译的gdbserver+arm-none-linux-gnueabi-gdb调度时。follow-fork-mode和detach-on-fork死都不管用.
info inferiors只显示一个进程。
人品很好,在下面的地方找到了答案。(http://code.google.com/p/android/issues/detail?id=15894)
The 'gdbserver' that comes in NDK r5b is stripped of symbols, so I cannot confirm that what I'm about to say is absolutely the cause of this particular segfault, but I do have an interesting data-point to share:Back in early February I discovered that the AOSP's prebuilt 'gdbserver' for Gingerbread had been statically linked against a libc from Cupcake. This caused an impedance mismatch between libc and the kernel, causing segfaults. (During this time I was unaware of the 'ndk-build' and 'ndk-gdb' scripts, and was doing things "the hard way".)My solution was to rebuild my own gdbserver (from 7.2 gdb,) applying Google's 7.1.x libthread_db patches. The result was a usable gdbserver. I now find that I can also work around this new segfault (with NDK r5b's "ndk-gdb script") by again using that self-built gdbserver.See below for details captured in February.This brings up an interesting point: It makes sense for gdbserver to be statically linked to libc, for the purpose of minimizing gdbserver's dependence on the system being debugged. But at the same time, I think maybe it makes it a little risky to use the same gdbserver binary for all Android OS versions, particularly when there are kernel differences? If my concern has merit, then perhaps the NDK should come supplied with multiple copies of gdbserver, and then the appropriate one should get used for a given target device. rbissell@rvb-android-dev0:~/src/android$ nm -a ./gdbserver | grep fork 0003c460 T fork 00000000 a fork.c rbissell@rvb-android-dev0:~/src/android$ addr2line -e ./gdbserver 0003c460 /opt/digit/android/main/cupcake/android/bionic/libc/bionic/fork.c:34 (Again, the was the gdbserver taken from the Gingerbread AOSP tree, back in early February 2011.)Hope that helps in some way.
gdb调试多进程
http://sourceware.org/gdb/onlinedocs/gdb/Forks.html
- gdbserver静态编译-调试失败的原来
- gdbserver 静态编译
- 编译MIPS平台的远程调试工器gdb/gdbserver
- arm-linux-gdb和gdbserver调试交叉编译的程序
- 交叉编译gdb+gdbserver实现远程调试
- gdbserver调试
- arm-linux-gdb调试工具的安装与交叉编译gdbserver
- Linux下交叉编译gdb,gdbserver+gdb的使用以及通过gdb调试core文件
- JLink-GDBServer + eclipse 的调试环境
- 实用技巧:Gdbserver远程调试的具体实现
- gdbserver远程调试的具体实现
- JLink-GDBServer + eclipse 的调试环境
- 实用技巧:Gdbserver远程调试的具…
- 实用技巧:Gdbserver远程调试的具…
- gdb+gdbserver调试android的so文件
- gdb和gdbserver的安装和调试
- GDB 与GDBserver交叉调试的总结
- 编译安装gdb+insight和gdbserver远程调试
- android SharedFerence使用
- android SharedFerence使用
- android SharedFerence使用
- PETSc 使用VecGetArray() 访问并行向量出错memory access out of range
- iphone
- gdbserver静态编译-调试失败的原来
- OpenScales入门教程:第二节 : 创建第一张地图
- 【转】 “由于应用程序配置不正确,程序未能启动”--原因及解决方法 vc2008, VC2005
- getFieldInfo_Func
- vc小游戏的第五篇
- TCP 三次握手分析
- free()
- java连接oracle数据库的各种方法及java在数据库中的含义
- jquery 坦克大战游戏