tenthplanet 发表于 2011-7-28 08:30:38

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

我用的是 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 = 0x31000000size = 0x00000064.
load section .data: addr = 0x31002000size = 0x00000010.
not load section .comment: addr = 0x00000000size = 0x0000002a .
not load section .debug_abbrev: addr = 0x00000000size = 0x0000009a .
not load section .debug_info: addr = 0x00000000size = 0x000000ee .
not load section .debug_line: addr = 0x00000000size = 0x00000084 .
not load section .debug_pubnames: addr = 0x00000000size = 0x0000001c .
not load section .debug_aranges: addr = 0x00000000size = 0x00000040 .
not load section .ARM.attributes: addr = 0x00000000size = 0x00000025 .
not load section .debug_frame: addr = 0x00000000size = 0x00000020 .
not load section .debug_loc: addr = 0x00000000size = 0x0000001e .
not load section .debug_str: addr = 0x00000000size = 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 编辑 ]

tenthplanet 发表于 2011-7-29 10:35:48

段错误它是哪里 报出来的,指的是代码段 吗

xq2537 发表于 2011-7-29 17:37:31

Hi,tenthplanet

       Please refer to this document:
       https://sourceforge.net/apps/mediawiki/skyeye/index.php?title=Skyeye%E8%BF%9C%E7%A8%8B%E8%B0%83%E8%AF%95%E4%BB%A5%E5%8F%8Agdb%E7%89%88%E6%9C%AC%E9%97%AE%E9%A2%98

Thanks
XiaoQiao

tenthplanet 发表于 2011-7-30 11:40:29

我的是gdb6.8,是不是也需要打这个补丁呢,

谢谢

xq2537 发表于 2011-7-31 22:36:31

您能提供一下您的环境吗?我在我的机器(ubuntu1004)上测试了gdb6.8,没有错误。

tenthplanet 发表于 2011-8-1 08:33:11

vmvare6.0   上装的 debian5.0

谢谢

tenthplanet 发表于 2011-8-1 10:49:51

gdb6.8,7.1调试都是这个:段错误

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

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

请帮忙解决,万分感谢

xq2537 发表于 2011-8-2 13:27:03

您能不能gdb跟一下skyeye,然后trace给我们看一下?
谢谢

tenthplanet 发表于 2011-8-2 15:29:17

我的skyeye本身运行是没有问题的,就是gdb调试有问题.
我不太了解您的具体意思。麻烦您具体跟说解释下,是不是 gcc -g一遍 skyeye的源码.

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

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

ksh 发表于 2011-8-3 09:45:34

https://sourceforge.net/apps/mediawiki/skyeye/index.php?title=UseGdbToDebugSkyEye

tenthplanet 发表于 2011-8-4 10:13:00

终端1
Starting program: /opt/skyeye/bin/skyeye -e u-boot

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.



(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 = 0x33f80000size = 0x00011450.
load section .rodata: addr = 0x33f91450size = 0x00000788.
load section .rodata.str1.1: addr = 0x33f91bd8size = 0x000037f2.
load section .data: addr = 0x33f953ccsize = 0x00000894.
load section .u_boot_cmd: addr = 0x33f95c60size = 0x00000438.
not load section .bss: addr = 0x33f96098size = 0x00004724 .
not load section .ARM.attributes: addr = 0x00000000size = 0x00000010 .
not load section .debug_line: addr = 0x00000000size = 0x00004de7 .
not load section .debug_info: addr = 0x00000000size = 0x000122f3 .
not load section .debug_abbrev: addr = 0x00000000size = 0x0000599b .
not load section .debug_aranges: addr = 0x00000000size = 0x00000760 .
not load section .debug_frame: addr = 0x00000000size = 0x00002950 .
not load section .debug_loc: addr = 0x00000000size = 0x0000d02f .
not load section .debug_pubnames: addr = 0x00000000size = 0x00001da7 .
not load section .debug_str: addr = 0x00000000size = 0x00003873 .
not load section .comment: addr = 0x00000000size = 0x000008dc .
not load section .debug_ranges: addr = 0x00000000size = 0x00000a30 .
In SIM_start, Set PC to the address 0x33f80000


(skyeye)remote-gdb

(skyeye)Remote debugging using host:1000

Program received signal SIGSEGV, Segmentation fault.

0xffffffff in ?? ()
(gdb) trace
trace command requires an argument
(gdb) backtrace
#00xffffffff in ?? ()
#10xb57870fe in sim_debug () at debugger/gdbserver.c:1225
#20xb73394c0 in start_thread () from /lib/i686/cmov/libpthread.so.0
#30xb729284e 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 编辑 ]

tenthplanet 发表于 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 编辑 ]

xq2537 发表于 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/mediawiki/skyeye/index.php?title=SkyEye%E8%BF%9C%E7%A8%8B%E8%B0%83%E8%AF%95%E4%BB%A5%E5%8F%8Agdb%E7%89%88%E6%9C%AC%E9%97%AE%E9%A2%98

tenthplanet 发表于 2011-8-5 14:52:07

xq2537,ksh 您们真是好人,一直不懈的帮助我解决问题。
这2天台风梅花要从宁波这边登陆了,我们有点忙.
稍微等下我,等台风过去了,我马上就去调试。然后把调试信息发出来.

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

tenthplanet 发表于 2011-8-7 10:11:57

把开关打开以后,把skyeye源码打上patch补丁之后的调试信息:

终端1
Starting program: /opt/skyeye/bin/skyeye -e hello

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.


(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:

In create_uart_console
SKYEYE: use arm920t mmu ops
exec file "hello"'s format is elf32-i386.
load section .text: addr = 0x31000000size = 0x00000064.
load section .data: addr = 0x31002000size = 0x00000010.
not load section .comment: addr = 0x00000000size = 0x0000002a .
not load section .debug_abbrev: addr = 0x00000000size = 0x0000009a .
not load section .debug_info: addr = 0x00000000size = 0x000000ee .
not load section .debug_line: addr = 0x00000000size = 0x00000084 .
not load section .debug_pubnames: addr = 0x00000000size = 0x0000001c .
not load section .debug_aranges: addr = 0x00000000size = 0x00000040 .
not load section .ARM.attributes: addr = 0x00000000size = 0x00000025 .
not load section .debug_frame: addr = 0x00000000size = 0x00000020 .
not load section .debug_loc: addr = 0x00000000size = 0x0000001e .
not load section .debug_str: addr = 0x00000000size = 0x00000061 .
In SIM_start, Set PC to the address 0x31000000


(skyeye)remote-gdb

(skyeye)Remote debugging using host:12345
getpkt ("qSupported");

putpkt ("$#00");


getpkt ("?");

putpkt ("$S05#b8");

getpkt ("Hc-1");

�(���U5��U5��U5��U5��U5��U5��U5��U5�putpkt ("$#00");

getpkt ("qC");

putpkt ("$#00");

getpkt ("Hg0");

�(���U5��U5��U5��U5��U5��U5��U5��U5�putpkt ("$#00");

getpkt ("g");

putpkt ("$00000000c10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031000000000d0000005cc0b00900000000000000000000000000000000000000001000000000000000000000000100000000000000000000000000000000000000100000000f0000000000000018270000000000000000000000000000000000000000000000000000#5d");

getpkt ("m0,8");


Program received signal SIGSEGV, Segmentation fault.

0x00000000 in ?? ()
(gdb) bt
#00x00000000 in ?? ()
#10xb57d225e in sim_debug () at debugger/gdbserver.c:1243
#20xb73854c0 in start_thread () from /lib/i686/cmov/libpthread.so.0
#30xb72de84e 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 编辑 ]
页: [1] 2
查看完整版本: skyeye1.3.2 gdb远程调试:段错误