Chinaunix首页 | 论坛 | 博客
  • 博客访问: 580294
  • 博文数量: 353
  • 博客积分: 1104
  • 博客等级: 少尉
  • 技术积分: 1457
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-23 23:02
个人简介

1、刚工作时做Linux 流控;后来做安全操作系统;再后来做操作系统加固;现在做TCP 加速。唉!没离开过类Unix!!!但是水平有限。。

文章存档

2015年(80)

2013年(4)

2012年(90)

2011年(177)

2010年(1)

2009年(1)

分类: LINUX

2011-10-26 20:38:29

Gdb串口调试内核,/boot/boot.cfg文件如何配置(特别好)

  • 编辑GRUB

这里需要注意,网上有些关于KGDB的资料上面的GRUB引导参数在新版本kernel下不工作(例如我用的2.6.32.4),正确的配置如下:

/boot/vmlinuz-2.6.32.4-xm-1.0-kgdb root=/dev/hda1 ro kgdb=ttyS0,9600 kgdboc=ttyS0,9600 kgdbwait


说明:一定要有kgdbwait,gdb调试内核一定要在target marchine(我调试的是龙芯内核)进入系统之前,启用gdb调试,不然等到target machine进入系统之后,再进行gdb调试就会出现下面的错误:

root@lijun-HP-Compaq-dx2308-Microtower:/home/lijun/kernel_Compile/linux-2.6.35_Loongson/linux-2.6.35_patched# mips-linux-gdb vmlinux
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=mips-linux"...
(gdb) set remotebaud 9600
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
(gdb) 
总结:总之出现上面错误的原因就是因为没有在target machine进入系统之前,启动gdb调试内核导致的!

解决办法:按照上面的进行配置,然后重启target machine,即可!

阅读(1547) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~