QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 8825|回复: 27

skyeye1.3.2 gdb远程调试:段错误

[复制链接]
发表于 2011-7-28 08:30:38 | 显示全部楼层 |阅读模式
我用的是 skyeye-1.3.2_rc1_CP

(skyeye)start
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
In do_mach_option, mach info: name s3c2410x, mach_init addr 0xb5f4ff60

ethmod num=1, mac addr=8:0:3e:26:a:5b, hostip=10.0.0.1
uart_mod:3, desc_in:, desc_out:, converter:
In create_uart_console
SKYEYE: use arm920t mmu ops
exec file "hello"'s format is elf32-i386.
load section .text: addr = 0x31000000  size = 0x00000064.
load section .data: addr = 0x31002000  size = 0x00000010.
not load section .comment: addr = 0x00000000  size = 0x0000002a .
not load section .debug_abbrev: addr = 0x00000000  size = 0x0000009a .
not load section .debug_info: addr = 0x00000000  size = 0x000000ee .
not load section .debug_line: addr = 0x00000000  size = 0x00000084 .
not load section .debug_pubnames: addr = 0x00000000  size = 0x0000001c .
not load section .debug_aranges: addr = 0x00000000  size = 0x00000040 .
not load section .ARM.attributes: addr = 0x00000000  size = 0x00000025 .
not load section .debug_frame: addr = 0x00000000  size = 0x00000020 .
not load section .debug_loc: addr = 0x00000000  size = 0x0000001e .
not load section .debug_str: addr = 0x00000000  size = 0x00000061 .
In SIM_start, Set PC to the address 0x31000000

(skyeye)remote-gdb
(skyeye)Remote debugging using host:1000
段错误


debian:/opt/skyeye/testsuite/test_hello# gdb hello
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
(gdb) target remote 10.0.0.1:1000
Remote debugging using 10.0.0.1:1000
Remote connection closed

请帮忙解决,谢谢

[ 本帖最后由 tenthplanet 于 2011-7-28 08:32 编辑 ]
 楼主| 发表于 2011-7-29 10:35:48 | 显示全部楼层
段错误它是哪里 报出来的,指的是代码段 吗
回复

使用道具 举报

发表于 2011-7-29 17:37:31 | 显示全部楼层
Hi,tenthplanet

       Please refer to this document:
       https://sourceforge.net/apps/med ... C%E9%97%AE%E9%A2%98

Thanks
XiaoQiao
回复

使用道具 举报

 楼主| 发表于 2011-7-30 11:40:29 | 显示全部楼层
我的是gdb6.8,是不是也需要打这个补丁呢,

谢谢
回复

使用道具 举报

发表于 2011-7-31 22:36:31 | 显示全部楼层
您能提供一下您的环境吗?我在我的机器(ubuntu1004)上测试了gdb6.8,没有错误。
回复

使用道具 举报

 楼主| 发表于 2011-8-1 08:33:11 | 显示全部楼层
vmvare6.0   上装的 debian5.0

谢谢
回复

使用道具 举报

 楼主| 发表于 2011-8-1 10:49:51 | 显示全部楼层
gdb  6.8,7.1  调试都是这个:段错误

是不是skyeye的源码中有什么需要改动的,

不知道是读到哪个不存在的 内存段还是不允许访问的内存段了

请帮忙解决,万分感谢
回复

使用道具 举报

发表于 2011-8-2 13:27:03 | 显示全部楼层
您能不能gdb跟一下skyeye,然后trace给我们看一下?
谢谢
回复

使用道具 举报

 楼主| 发表于 2011-8-2 15:29:17 | 显示全部楼层
我的skyeye本身运行是没有问题的,就是gdb调试有问题.
我不太了解您的具体意思。麻烦您具体跟说解释下,是不是 gcc -g一遍 skyeye的源码.

我用gdb skyeye
       run
      就会跑进skyeye命令模式下,跑gdb的命令都是提示 skyeye没有该命令

[ 本帖最后由 tenthplanet 于 2011-8-2 15:38 编辑 ]
回复

使用道具 举报

发表于 2011-8-3 09:45:34 | 显示全部楼层
回复

使用道具 举报

 楼主| 发表于 2011-8-4 10:13:00 | 显示全部楼层
终端1
Starting program: /opt/skyeye/bin/skyeye -e u-boot
[Thread debugging using libthread_db enabled]
SkyEye 1.3.2
SkyEye is an Open Source project under GPL. All rights of different parts or modules are reserved by their author. Any modification or redistributions of SkyEye should not remove or modify the annoucement of SkyEye copyright.
Get more information about it, please visit the homepage http://www.skyeye.org.
Type "help" to get command list.
[New Thread 0xb71b06b0 (LWP 5723)]
[New Thread 0xb71afb90 (LWP 5724)]

(skyeye)start
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
In do_mach_option, mach info: name s3c2410x, mach_init addr 0xb5f62f60

ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
nandflash: dump ./nand.dump
file size:69206016
Loaded RAM   ./u-boot
SKYEYE: use arm920t mmu ops
exec file "u-boot"'s format is elf32-i386.
load section .text: addr = 0x33f80000  size = 0x00011450.
load section .rodata: addr = 0x33f91450  size = 0x00000788.
load section .rodata.str1.1: addr = 0x33f91bd8  size = 0x000037f2.
load section .data: addr = 0x33f953cc  size = 0x00000894.
load section .u_boot_cmd: addr = 0x33f95c60  size = 0x00000438.
not load section .bss: addr = 0x33f96098  size = 0x00004724 .
not load section .ARM.attributes: addr = 0x00000000  size = 0x00000010 .
not load section .debug_line: addr = 0x00000000  size = 0x00004de7 .
not load section .debug_info: addr = 0x00000000  size = 0x000122f3 .
not load section .debug_abbrev: addr = 0x00000000  size = 0x0000599b .
not load section .debug_aranges: addr = 0x00000000  size = 0x00000760 .
not load section .debug_frame: addr = 0x00000000  size = 0x00002950 .
not load section .debug_loc: addr = 0x00000000  size = 0x0000d02f .
not load section .debug_pubnames: addr = 0x00000000  size = 0x00001da7 .
not load section .debug_str: addr = 0x00000000  size = 0x00003873 .
not load section .comment: addr = 0x00000000  size = 0x000008dc .
not load section .debug_ranges: addr = 0x00000000  size = 0x00000a30 .
In SIM_start, Set PC to the address 0x33f80000

[New Thread 0xac893b90 (LWP 5729)]
(skyeye)remote-gdb
[New Thread 0xac092b90 (LWP 5734)]
(skyeye)Remote debugging using host:1000

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xac092b90 (LWP 5734)]
0xffffffff in ?? ()
(gdb) trace
trace command requires an argument
(gdb) backtrace
#0  0xffffffff in ?? ()
#1  0xb57870fe in sim_debug () at debugger/gdbserver.c:1225
#2  0xb73394c0 in start_thread () from /lib/i686/cmov/libpthread.so.0
#3  0xb729284e in clone () from /lib/i686/cmov/libc.so.6


(gdb) l
495        in utils/main/skyeye.c


终端2
debian:~# gdb
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu".
(gdb) target remote 10.0.0.1:1000
Remote debugging using 10.0.0.1:1000
Ignoring packet error, continuing...
Reply contains invalid hex digit 116
(gdb)

[ 本帖最后由 tenthplanet 于 2011-8-4 15:52 编辑 ]
回复

使用道具 举报

 楼主| 发表于 2011-8-4 10:18:20 | 显示全部楼层
上面是我debug以后的图示,错误的提示我用红字了,在  495        in utils/main/skyeye.c  出错。 请您帮我检查一下,谢谢。
我只要 remote target 10.0.0.1:1000 任何程序,都会出现上述的段错误(不管这个程序是不是可以跑通的)

[ 本帖最后由 tenthplanet 于 2011-8-4 15:54 编辑 ]
回复

使用道具 举报

发表于 2011-8-5 10:46:16 | 显示全部楼层
您好,
对不起,回复有点晚了,您能利用下面文档打开远程调试的调式开关,然后分享一下您的调试信息吗?
http://sourceforge.net/apps/trac/skyeye/wiki/SkyEyeRdiDebug

上面的文档,提及到的RDI协议是gdb和skyeye之间远程调试所遵循的通信协议。
关于RDI协议的介绍如下:
http://davis.lbl.gov/Manuals/GDB/gdb_31.html#SEC630

您也可以参照下面文档上的patch,自己调试一下。这个patch主要是屏蔽了gdb向skyeye发送过来的qTfV and qTfp 两个包(qTfv和qTfp都是基于RDI协议的).
https://sourceforge.net/apps/med ... C%E9%97%AE%E9%A2%98
回复

使用道具 举报

 楼主| 发表于 2011-8-5 14:52:07 | 显示全部楼层
xq2537,ksh 您们真是好人,一直不懈的帮助我解决问题。
这2天台风梅花要从宁波这边登陆了,我们有点忙.
稍微等下我,等台风过去了,我马上就去调试。然后把调试信息发出来.

虽然我家里有一块板子,但我还是觉得这个仿真很有意思。
真心感谢你们。
回复

使用道具 举报

 楼主| 发表于 2011-8-7 10:11:57 | 显示全部楼层
把开关打开以后,把skyeye源码打上patch补丁之后的调试信息:

终端1
Starting program: /opt/skyeye/bin/skyeye -e hello
[Thread debugging using libthread_db enabled]
SkyEye 1.3.2
SkyEye is an Open Source project under GPL. All rights of different parts or modules are reserved by their author. Any modification or redistributions of SkyEye should not remove or modify the annoucement of SkyEye copyright.
Get more information about it, please visit the homepage http://www.skyeye.org.
Type "help" to get command list.
[New Thread 0xb71fc6b0 (LWP 3654)]
[New Thread 0xb71fbb90 (LWP 3657)]
(skyeye)start
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
In do_mach_option, mach info: name s3c2410x, mach_init addr 0xb5faef60

ethmod num=1, mac addr=8:0:3e:26:a:5b, hostip=10.0.0.1
uart_mod:3, desc_in:, desc_out:, converter:
[New Thread 0xb5561b90 (LWP 3674)]
In create_uart_console
SKYEYE: use arm920t mmu ops
exec file "hello"'s format is elf32-i386.
load section .text: addr = 0x31000000  size = 0x00000064.
load section .data: addr = 0x31002000  size = 0x00000010.
not load section .comment: addr = 0x00000000  size = 0x0000002a .
not load section .debug_abbrev: addr = 0x00000000  size = 0x0000009a .
not load section .debug_info: addr = 0x00000000  size = 0x000000ee .
not load section .debug_line: addr = 0x00000000  size = 0x00000084 .
not load section .debug_pubnames: addr = 0x00000000  size = 0x0000001c .
not load section .debug_aranges: addr = 0x00000000  size = 0x00000040 .
not load section .ARM.attributes: addr = 0x00000000  size = 0x00000025 .
not load section .debug_frame: addr = 0x00000000  size = 0x00000020 .
not load section .debug_loc: addr = 0x00000000  size = 0x0000001e .
not load section .debug_str: addr = 0x00000000  size = 0x00000061 .
In SIM_start, Set PC to the address 0x31000000

[New Thread 0xacc44b90 (LWP 3680)]
(skyeye)remote-gdb
[New Thread 0xac443b90 (LWP 3686)]
(skyeye)Remote debugging using host:12345
getpkt ("qSupported");  [sending ack]
[sent ack]
putpkt ("$#00"); [looking for ack]
[received '+' (0x2b)]
[getpkt: discarding char '+']
getpkt ("?");  [sending ack]
[sent ack]
putpkt ("$S05#b8"); [looking for ack]
[received '+' (0x2b)]
getpkt ("Hc-1");  [sending ack]
[sent ack]
�(���U5��U5��U5��U5��U5��U5��U5��U5�putpkt ("$#00"); [looking for ack]
[received '+' (0x2b)]
getpkt ("qC");  [sending ack]
[sent ack]
putpkt ("$#00"); [looking for ack]
[received '+' (0x2b)]
getpkt ("Hg0");  [sending ack]
[sent ack]
�(���U5��U5��U5��U5��U5��U5��U5��U5�putpkt ("$#00"); [looking for ack]
[received '+' (0x2b)]
getpkt ("g");  [sending ack]
[sent ack]
putpkt ("$00000000c10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031000000000d0000005cc0b00900000000000000000000000000000000000000001000000000000000000000000100000000000000000000000000000000000000100000000f0000000000000018270000000000000000000000000000000000000000000000000000#5d"); [looking for ack]
[received '+' (0x2b)]
getpkt ("m0,8");  [sending ack]
[sent ack]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xac443b90 (LWP 3686)]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xb57d225e in sim_debug () at debugger/gdbserver.c:1243
#2  0xb73854c0 in start_thread () from /lib/i686/cmov/libpthread.so.0
#3  0xb72de84e in clone () from /lib/i686/cmov/libc.so.6


终端2:
(gdb) set debug remote 1
(gdb) target remote 10.0.0.1:12345
Remote debugging using 10.0.0.1:12345
Sending packet: $qSupported#37...Ack
Packet received:
Packet qSupported (supported-packets) is NOT supported
Sending packet: $?#3f...Ack
Packet received: S05
Sending packet: $Hc-1#09...Ack
Packet received:
Sending packet: $qC#b4...Ack
Packet received:
Sending packet: $Hg0#df...Ack
Packet received:
Sending packet: $g#67...Ack
Packet received: 00000000c100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sending packet: $m0,8#01...Ack
Timed out.
Timed out.
Timed out.
Ignoring packet error, continuing...
Reply contains invalid hex digit 116

[ 本帖最后由 tenthplanet 于 2011-8-7 21:19 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-3-29 08:01 , Processed in 0.131214 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表