Use kgdb debug ARM versatile

HOST: vmware Ubuntu 9.04

Target: ARM versatile PB board

CROSS_COMPILE: arm-2007q1

Linux kernel: 2.6.24 with arm2 patch from ARM

 

Prepare HOST ttyS0

 

- Configure VMWare to have serial port connect to PHY COM1

- Open minicom to set 115200, no flow control

 

Get kgdb from

http://kgdb.cvs.sourceforge.net/viewvc/kgdb/kgdb-2/?pathrev=linux2_6_24_uprev

checkout the code:

>cvs -d:pserver:anonymous@kgdb.cvs.sourceforge.net:/cvsroot/kgdb login

>cvs -z3 -d:pserver:anonymous@kgdb.cvs.sourceforge.net:/cvsroot/kgdb co -P kgdb-2

>cd kgdb-2

>cvs up -r linux2_6_24_uprev

 

 

Put on the patch

 

$ tar jxf linux-<base_kernel_version>.tar.bz2

$ cd linux-<base_kernel_version>

$ for p in $(grep patch ../kgdb-2/series);do patch -p1 -si ../kgdb-2/$p;done

Note: mismatch exists, manually apply the patches

 

 

Make menuconfig

Kernel hacking  --->
[*] Compile the kernel with debug info
[*] KGDB: kernel debugging with remote gdb                                             
[*] KGDB: Console messages through gdb                                    
 Method for KGDB communication (KGDB: On
ARM AMBA PL011 serial)  --->
[0x101f1000] AMBA PL011 serial Port Base Address      
(24000000) AMBA PL011 serial UART clock Frequency (
NEW)        
(12) AMBA PL011 serial port IRQ

 

 

Set bootarg

 

add kgdbwait to the bootargs

 

Boot target

 

target> tftp MEM uImage

target> bootm MEM

System waits at ‘booting kernel’

 

GDB setting at HOST

 

HOST> arm-none-linux-gnueabi-gdb ./vmlinux  (this is from arm-2007q1 cross compiler)

gdb> remote target /dev/ttyS0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值