- 论坛徽章:
- 0
|
目的:
使用GDB调试。有以下几种需求:
A gdb+gdb server调试应用程序。
B gdb+gdb stub通过uboot调试内核。
C kdb调试内核。
问题:
B和C暂时不考虑,使用从http://www.gnu.org/software/gdb/下载gdb-7.tat.gz,调试无法进行,总是发现报如下错误:
Remote 'g' packet reply is too long:
00000000e43ebebe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ebebe000000006081000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
而且arm-linux-gdb启动的时候总是报如下的警告错误:
warning: Can not parse XML target description; XML support was disabled at compile time
0x00008160 in ?? ()
问题原因的初步分析:
Gdb不支持arnv6的architechture。而s3c6410为ARM1176JZF-S是基于armv6的。
证据是在GDB命令行中输入show architechture没有armv6:
(gdb) set architecture armv6
Undefined item: "armv6".
(gdb) set architecture armv5
The target architecture is assumed to be armv5
(gdb) set architecture
Requires an argument. Valid arguments are arm, armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5t, armv5te, xscale, ep9312, iwmmxt, iwmmxt2, auto.
(可是armv6在2001年就出来了,GDB不支持说不过去)
另外可能的原因是,PC是64位的,开发板是32位的。联调时会不会有问题?
具体原因请高手请教......
问题引入的详细记录:
PC环境:虚拟机+ubuntu9.10(信息如下)
*@ubuntu: $ cat /proc/cpuinfo (flag字段有lm(long mode)说明CPU的数据总线是64位)
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 107
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
stepping : 2
cpu MHz : 2705.760
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc up tsc_reliable pni cx16 hypervisor lahf_lm extapic 3dnowprefetch
bogomips : 5411.52
clflush size : 64
power management: ts fid vid ttp tm stc 100mhzsteps
*@ubuntu: $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"
*@ubuntu: $ uname -a
Linux ubuntu 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
安装步骤:
*@ubuntu: $tar –xzvf gdb-7.2.tar.gz
*@ubuntu: $cd gdb-7.2
*@ubuntu: $sudu mkdir –p /opt/gdb
//编译PC上运行的arm-linux-gdb
*@ubuntu: $./configure –target=arm-linux –prefix=/opt/gdb
*@ubuntu: $make
*@ubuntu: $make install
*@ubuntu: $export PATH=$PATH:/opt/gdb/bin
//编译板子上运行的gdbserver,注意gdb-7.2目录下有gdb/gdbserver子目录
*@ubuntu: $ cd gdb/gdbserver/
*@ubuntu: $./configure –target=arm-linux –host=arm-linux
*@ubuntu: $make
*@ubuntu: $cp gdbserver */nfs-root
通过nfs在板子上进行如下操作:
[root@FriendlyARM /home]# ./gdbserver 172.16.46.3:3 /mnt/app_work/sample/fruit/app/helloWorld.elf
Process /mnt/app_work/sample/fruit/app/helloWorld.elf created; pid = 950
Listening on port 3
在主机端运行如下操作:
*@ubuntu: $ arm-linux-gdb /home/wangfeifeiwc/project/work/app_work/sample/fruit/app/helloWorld.elf
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-pc-linux-gnu --target=arm-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/wangfeifeiwc/project/work/app_work/sample/fruit/app/helloWorld.elf...done.
(gdb) target remote 172.16.46.5:666
Remote debugging using 172.16.46.5:666
warning: Can not parse XML target description; XML support was disabled at compile time
0x00008160 in _start ()
(gdb) list
Remote 'g' packet reply is too long: 00000000e40e95be0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e95be000000006081000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
(gdb) |
|