gdb远程交叉调试失败,“远程”g“数据包应答太长” [英] gdb remote cross debugging fails with "Remote 'g' packet reply is too long"

查看:1571
本文介绍了gdb远程交叉调试失败,“远程”g“数据包应答太长”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个远程调试问题。主机:笔记本电脑intel i5与ubuntu 10.10 x86
目标:飞思卡尔iMX35(iMX35 PDK)arm 11
开发环境:Qt Creator 2.1RC和Qt4.7.1库。
路径中的Arm编译器:/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin



arm-none-linux-gnueabi-gcc-4.1.2 arm-none-linux-gnueabi-objdump
arm-none-linux-gnueabi-addr2line arm-none-linux-gnueabi-gccbug

arm-none-linux-gnueabi-ranlib arm-none-linux-gnueabi-ar

arm-none-linux-gnueabi-gcov arm-none-linux-gnueabi-readelf
arm-none-linux-gnueabi-as

arm-none-linux-gnueabi-run arm-none-linux-gnueabi-c ++

arm-none-linux -gnueabi-size arm-none-linux-gnueabi-c ++ filt

arm-none-linux-gnueabi-gprof arm-none-linux-gnueabi-strings
arm-none-linux -gnueabi-cpp arm-none-linux-gnueabi-ld

arm-none-linux-gnueabi-strip arm-none-linux-gnueabi-g ++

arm-none-linux -gnueabi-nm arm-none-linux-gnueabi-gcc

arm-none-linux-gnueabi-objcopy



目标是调试用Qt创建的项目。
所以我只是创建一个Qt快速项目 - > Qt快速应用程序
创建一个简单的Hello World应用程序(C ++ / Qml)
我交叉编译它(在调试或发布),它的工作罚款
在目标。所以我很确定交叉编译
与我会显示的问题无关。



我下载了gdb 7.2并执行了以下操作:


$ export PATH = / opt / freescale / usr / local / gcc-4.1.2-glibc-2.5-nptl-3 / arm-none-linux-gnueabi / bin:$ PATH

$ cd / home / iMX35 / gdb-7.2 /

$ ./configure --target = arm-none-linux-gnueabi --build = i686

$ make

$ sudo make install



$ export CC = arm-none-linux-gnueabi-gcc

$ export LD = arm-none-linux-gnueabi- ld

$ cd gdb / gdbserver /

$ ./configure --build = i386 --host = arm-none-linux-gnueabi --target = arm-none-linux -
gnueabi

$ make



$ sudo cp gdbserver / home / elux / MX35 / ltib / rootfs / usr / bin /(将gdbserver复制到目标)


然后在目标上:


$ gdbserver 10.10.10.1:4000测试

创建过程测试; pid = 2194

在端口4000上收听


在目标上:


$ arm-none-linux-gnueabi-gdb测试(测试是交叉编译的Qt Creator在调试模式)
GNU gdb(GDB)7.2

版权所有(C)2010免费软件基金会,

许可证GPLv3 +:GNU GPL版本3或更高版本 http://gnu.org/licenses/gpl.html

这是免费软件:您可以随意更改并重新分发。

在法律允许的范围内,没有任何担保。键入显示复制

和显示保修的详细信息。

此GDB配置为--host = i686 --target = arm-none-linux-gnueabi 。

有关错误报告说明,请参阅:

http://www.gnu.org/software/gdb/bugs/ ...

从/ home / elux / iMX35 / ltib / rpm / BUILD / qt- everywhere-opensource-src-4.7.1 /platform/Test-build-arm/Test...done。

(gdb)target remote 10.10.10.2:4000

远程调试使用10.10.10.2:4000

警告:无法解析XML目标描述;编译时禁用XML支持

警告:无法找到动态链接器断点功能。

GDB将无法调试共享库初始化程序

并跟踪显式加载的动态代码。

0x400007e0在?? ()

(gdb)



(gdb)set solib-absolute-prefix / home / elux / iMX35 / ltib / rootfs /

从/ home / elux / iMX35 / ltib / rootfs / lib读取符号/ld-linux.so.3...done。

/home/elux/iMX35/ltib/rootfs/lib/ld-linux.so.3的加载符号



(gdb)设置架构armv5te

中的目标结构被假定为用于ARMv5TE结果,
遥控的 'g' 数据包应答过长:00000000a7ee8ebe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0ed8ebe00000000e007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000



(GDB)b主<无线电通信>
远程G包应答太长:00000000a7ee8ebe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0ed8ebe00000000e007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000




你有任何想法,这是什么问题,是关系到?我如何解决它?

解决方案

最近我在Ubuntu 12.04(x86_64)上遇到过,并以另一种方式解决了我以为我会评论。在这种情况下,踢球者是Ubuntu似乎有启用了libexpat的gdb。一些修补后,这解决了我:


设置架构i386:x86-64:intel


所以看起来这可能会导致架构不匹配。


I have a problem with remote debugging.

Host: laptop intel i5 with ubuntu 10.10 x86 Target: Freescale iMX35 (iMX35 PDK) arm 11 Development environment: Qt Creator 2.1RC and Qt4.7.1 libraries. Arm compiler in path: /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin

arm-none-linux-gnueabi-gcc-4.1.2 arm-none-linux-gnueabi-objdump arm-none-linux-gnueabi-addr2line arm-none-linux-gnueabi-gccbug
arm-none-linux-gnueabi-ranlib arm-none-linux-gnueabi-ar
arm-none-linux-gnueabi-gcov arm-none-linux-gnueabi-readelf arm-none-linux-gnueabi-as
arm-none-linux-gnueabi-run arm-none-linux-gnueabi-c++
arm-none-linux-gnueabi-size arm-none-linux-gnueabi-c++filt
arm-none-linux-gnueabi-gprof arm-none-linux-gnueabi-strings arm-none-linux-gnueabi-cpp arm-none-linux-gnueabi-ld
arm-none-linux-gnueabi-strip arm-none-linux-gnueabi-g++
arm-none-linux-gnueabi-nm arm-none-linux-gnueabi-gcc
arm-none-linux-gnueabi-objcopy

The goal is to debug a project created with Qt. So I simply created a Qt Quick Project -> Qt Quick Application which creates a simple Hello World application (C++/Qml) I cross compile it (in debug or release) and it works fine on the target. So I'm quite sure that cross compilation is not related to the problem I'll show you.

I downloaded gdb 7.2 and performed the following operation:

$ export PATH=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin:$PATH
$ cd /home/elux/iMX35/gdb-7.2/
$ ./configure --target=arm-none-linux-gnueabi --build=i686
$ make
$ sudo make install

$ export CC=arm-none-linux-gnueabi-gcc
$ export LD=arm-none-linux-gnueabi-ld
$ cd gdb/gdbserver/
$ ./configure --build=i386 --host=arm-none-linux-gnueabi --target=arm-none-linux- gnueabi
$ make

$ sudo cp gdbserver /home/elux/MX35/ltib/rootfs/usr/bin/ (to copy gdbserver to target)

Then on the target:

$ gdbserver 10.10.10.1:4000 Test
Process Test created; pid = 2194
Listening on port 4000

On the target:

$ arm-none-linux-gnueabi-gdb Test (Test is cross-compiled it Qt Creator in debug mode) GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686 --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/elux/iMX35/ltib/rpm/BUILD/qt-everywhere-opensource-src-4.7.1 /platform/Test-build-arm/Test...done.
(gdb) target remote 10.10.10.2:4000
Remote debugging using 10.10.10.2:4000
warning: Can not parse XML target description; XML support was disabled at compile time
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x400007e0 in ?? ()
(gdb)

and

(gdb) set solib-absolute-prefix /home/elux/iMX35/ltib/rootfs/
Reading symbols from /home/elux/iMX35/ltib/rootfs/lib/ld-linux.so.3...done.
Loaded symbols for /home/elux/iMX35/ltib/rootfs/lib/ld-linux.so.3

but

(gdb) set architecture armv5te
The target architecture is assumed to be armv5te
Remote 'g' packet reply is too long: 00000000a7ee8ebe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0ed8ebe00000000e007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

(gdb) b main
Remote 'g' packet reply is too long: 00000000a7ee8ebe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0ed8ebe00000000e007004010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Have you got any idea what this problem is related to? How can I resolve it?

解决方案

As I ran into this recently on Ubuntu 12.04 (x86_64) and solved it in a different way, I thought I'd comment. The kicker in this case is that Ubuntu seems to have gdb with libexpat enabled. Some tinkering later and this solved it for me:

set architecture i386:x86-64:intel

So it appears this can result when there is a mismatch of architectures as well.

这篇关于gdb远程交叉调试失败,“远程”g“数据包应答太长”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆