Chinaunix首页 | 论坛 | 博客
  • 博客访问: 167848
  • 博文数量: 69
  • 博客积分: 2627
  • 博客等级: 少校
  • 技术积分: 715
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-24 22:37
文章分类

全部博文(69)

文章存档

2017年(3)

2014年(1)

2013年(4)

2012年(6)

2011年(21)

2010年(15)

2009年(19)

我的朋友

分类: LINUX

2012-12-27 14:49:21

在skyeye-1.2.6_rc1上使用gdb调试u-boot

os: redhat 9, gcc: 3.2.2

1. 下载安装arm-elf-tools20040427.sh, 基于gcc-2.95.3, 这个工具没有arm-elf-gdb,已试过,可以编译u-boot.
   

2. 安装arm-elf-gdb:

  首先上ftp://ftp.gnu.org/gnu/gdb/下载gdb,我用的是gdb-6.0a
  解压tar zvxf, 新建一个目录,比如在gdb-6.0a里建一个make_gdb,在这个目录里运行gdb-6.0a/configure
  参数至少要有一个target --target=arm-elf --prefix=/usr/local/arm-elf-gdb/
  然后make, 再make install,
  这样就在/usr/local下生成arm-elf-gdb目录,但里面的bin目录的可执行文件
  (只有两个文件: arm-elf-gdb arm-elf-run),没有被加入搜索路径,可以COPY到/usr/local/bin里.

3. skyeye.conf

#skyeye config file for S3C44B0X
cpu: arm7tdmi

mach: s3c44b0x

# physical memory
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00200000, file=u-boot.bin
mem_bank: map=M, type=RW, addr=0x0c000000, size=0x00800000

# peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x01c00000, size=0x00400000

# uart 0
uart: mod=stdio

# uart 1
#uart: mod=pipe, desc=/dev/ttyS1

# LCD
#lcd: type=s3c44b0x, mod=gtk

#net: ethmod=tuntap, hostip=10.0.0.1
#dbct: state=on



4. 进入u-boot顶层目录,也就是有u-boot,u-boot.bin的那个目录,运行skyeye(因为skyeye安装后,可以在任意目录运行,但skyeye.conf放在u-boot顶层目录).
  skyeye -d 这样启动调试模式
 
[root@rh3 u-boot]# skyeye -d
 
**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************
 
Your elf file is little endian.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name s3c44b0x, mach_init addr 0x8076798
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded RAM   u-boot.bin
debugmode= 1, filename = skyeye.conf, server TCP port is 12345

...


5. # arm-elf-gdb u-boot
   (gdb) target remote 127.0.0.1:12345
   (gdb) b start_armboot
   (gdb) c
   ...

至此,可以调试了。

最后: arm-elf-gcc 的编译标志要加 -ggdb, -g和-gstabs都找不到C源代码文件.
       这个标志只要加在u-boot/config.mk里就行了。

# arm-elf-as --gstabs  -o start.o start.s
# arm-elf-ld -Tmy-boot.lds -o start start.o lowlevel_init.o
这两行可以调试arm汇编


阅读(887) | 评论(0) | 转发(0) |
0

上一篇:sip hold

下一篇:关于宏list_entry

给主人留下些什么吧!~~