免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2912 | 回复: 4
打印 上一主题 下一主题

vbox kgdb 源码调试失败 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-06-20 16:42 |只看该作者 |倒序浏览
我用的是fedora12的guest,内核是2.6.15.5,
我打完kgdb补丁,
make bzImage  ,
拷贝vmlinuz和System.map到目标机,
修改grub.conf
启动时显示Uncompressing Linux... Ok, booting the kernel

到这里好像一切都正常,但是在开发机里用gdb链接的时候:
  1. [root@ggjd linux-2.6.15.5]# gdb vmlinux
  2. GNU gdb (GDB) Fedora (7.0-3.fc12)
  3. Copyright (C) 2009 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "i686-redhat-linux-gnu".
  9. For bug reporting instructions, please see:
  10. <http://www.gnu.org/software/gdb/bugs/>...
  11. Reading symbols from /home/bjn/linux-2.6.15.5/vmlinux...done.
  12. (gdb) set remotebaud 115200
  13. (gdb) target remote /dev/ttyS0
  14. Remote debugging using /dev/ttyS0
  15. 0xc0145027 in ?? ()
  16. (gdb)
复制代码
0xc0145027 in ?? ()
是什么意思呀??????????,有错误吧,,弄了一天了,还请多多指教,
先谢过了。。。。。

论坛徽章:
0
2 [报告]
发表于 2010-06-20 20:10 |只看该作者
回复 1# bijianing


    你可以bt一下,看看执行栈,你会发现栈中的几个函数都没有名字,记得以前在一个论坛上面看过,好像这个是kgdb的局限,是server和stub的不同步导致的,如果可以停下来的话,会进入到kgdb的函数中去。
    另外:利用vbox调试,我失败过N次,最后发现还是vmware7比较强大,可以摆脱kgdb。

论坛徽章:
0
3 [报告]
发表于 2010-06-20 20:57 |只看该作者
这位兄台所说的摆脱kgdb是,论坛里那个精华贴吗?
http://linux.chinaunix.net/bbs/v ... 3Ddigest&page=1

能否简单说明一下,谢谢。。

下面是,完整一点的输出
[root@ggjd linux-2.6.15.5]# gdb vmlinux
GNU gdb (GDB) Fedora (7.0-3.fc12)
Copyright (C) 2009 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 "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/bjn/linux-2.6.15.5/vmlinux...done.
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
0xc01409f7 in ?? ()
(gdb) c
Continuing.
Linux version 2.6.15.5 (bjn@ggjd) (gcc version 4.4.2 20091027 (Red Hat 4.4.2-7) (GCC) ) #1 SMP Sun Jun 20 10:32:14 JST 2010
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
BIOS-e820: 000000003fff0000 - 0000000040000000 (ACPI data)
BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
Waiting for connection from remote gdb...
127MB HIGHMEM available.
896MB LOWMEM available.
NX (Execute Disable) protection: active
DMI 2.5 present.
ACPI: PM-Timer IO Port: 0x4008
Allocating PCI resources starting at 50000000 (gap: 40000000:bffc0000)
Built 1 zonelists
Kernel command line: ro root=UUID=ccbb5fd7-fdfe-4ad6-8a10-e8c8ffc2acf5 kgdbwait kgdboc=0,115200
Found and enabled local APIC!
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 65536 bytes)
PM-Timer running at invalid rate: 120% of normal - aborting.
Detected 3209.515 MHz processor.
Using tsc for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)

Program received signal SIGILL, Illegal instruction.
0xc0145027 in ?? ()
(gdb) bt
#0  0xc0145027 in ?? ()
#1  0xc0145553 in ?? ()
#2  0xc014556e in ?? ()
#3  0xc0145c2a in ?? ()
#4  0xc0417d44 in free_all_bootmem_core (pgdat=<value optimized out>)
    at mm/bootmem.c:324
#5  0xc0417e7e in free_all_bootmem () at mm/bootmem.c:393
#6  0xc0415eff in mem_init () at arch/i386/mm/init.c:601
#7  0xc0406531 in start_kernel () at init/main.c:512
#8  0xc0100210 in ?? ()
#9  0x0001b855 in ?? ()
#10 0xe5890000 in ?? ()
#11 0x1e8505c6 in ?? ()
#12 0x5d00c040 in ?? ()
#13 0x01b855c3 in ?? ()
#14 0x89000000 in ?? ()
#15 0x0405c7e5 in ?? ()
#16 0x01c04471 in ?? ()
#17 0x5d000000 in ?? ()
#18 0xe58955c3 in ?? ()
#19 0x1e8605c6 in ?? ()
#20 0x0f00c040 in ?? ()
#21 0xc883c020 in ?? ()
---Type <return> to continue, or q <return> to quit---
#22 0xc0220f0e in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

论坛徽章:
0
4 [报告]
发表于 2010-06-20 20:59 |只看该作者
我想,会不会跟gcc的版本太高有关系?

论坛徽章:
0
5 [报告]
发表于 2010-06-20 23:54 |只看该作者
回复 4# bijianing


    这就不知道了,我当时也是折腾了一个礼拜,查了N久,也不知道到底为什么,这个如果不了解编译器,估计怎么折腾也没用吧,我是,最后换成vmware7,马上搞定,最起码可以调试内核了,我的方案是vmware7+2.6.30.10+cygwin+insight。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP