embedded linux system gdb 调试

17 篇文章 0 订阅
7 篇文章 0 订阅

refs:

http://liu1227787871.blog.163.com/blog/static/205363197201261204950218/




一)在ARM板上:
1. ulimit -c unlimited
2. 执行应用程序 : 程序出错时会在当前目录下生成名为core的文件

在PC上:
3、首先将core文件拷贝到pc机上
     然后:/bin/arm-linux-gdb ./test_debug ./core

二)用gdb server调试

1、编译要调试的应用程序:必须要加-g选项,

   按如下编译它:arm-linux-gcc -g -o test_debug test_debug.c


2、运行时出现错误:
/mnt/code/28th_app_debug # ./test_debug
a = 0x12
Segmentation fault
下面就开始进行调试


3、在开发板上:gdbserver 192.168.183.127:2345 ./test_debug
 
打印出如下信息:
Process ./test_debug created; pid = 751
Listening on port 2345
 
其中 192.168.183.127:本开发板的ip
       123:端口号,自己随便写的
        ./test_debug:要调试的程序
 
4、在PC上:/bin/arm-linux-gdb ./test-debug
                     target remote 192.168.183.127:2345

5、下面就可以正式调试了!我们先来说一下几个常用的命令
     run,backtrace
(1)l:列出所有源代码
(2)break main:在main处打断点
         break test_debug.c:11:在test_debug.c的11行打断点
(3)c:运行到断点处
(4)step:单步执行
(5)next:单步执行,但是step会进入函数里面,但是next不会
(6)print a:打印a这个变量的值
(6)quit:退出,输入此命令则开发板上的gdbserver也退出
更详细的命令,我们在下一节里面会进一步来讲讲的!







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
xxv Introduction The text is divided into ten chapters and two appendices. Chapter 1, “Introduction,” gives a brief history of embedded Linux and what the benefits of embedded Linux are over other RTOSs. It discusses in detail the features of various open source and commercial embedded Linux distributions available. The chapter concludes by presenting a transition roadmap from a traditional RTOS to embedded Linux. Chapter 2, “Getting Started,” explains the architecture of embedded Linux and compares it with traditional RTOS and microkernel architectures. In brief various Linux kernel subsystems such as the hardware abstraction layer, memory management, scheduler, file system, and so on are given. A small description of the user-space Linux programming model is also given. The second half of the chapter explains the Linux start-up sequence, from bootloaders to kernel start-up and user-space start-up scripts. The last section explains the steps involved in building a GNU cross-platform toolchain. Chapter 3, “Board Support Package,” explains bootloader architecture followed by a discussion on the system memory map, both hardware and software memory maps. The second half of the chapter explains interrupt management, the PCI subsystem, timers, UART, and power management in detail. Chapter 4, “Embedded Storage,” explains the MTD subsystem architecture for accessing flash devices. The second half of the chapter discusses various embedded file systems such as RAMFS, CRAMFS, JFFS2, NFS, and so on. The chapter also discusses various methods for optimizing storage space in an embedded system, both kernel and user-space optimizations. A discussion of various applications designed for embedded Linux such as Busybox is given. Finally some steps for tuning the kernel memory are given. Chapter 5, “Embedded Drivers,” discusses in detail various embedded drivers such as the Serial driver, Ethernet driver, I2C subsystem, and USB gadgets.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值