U-boot下进行gdb 调试
1、编译选项设置添加调试选项-g 保留调试信息,否则不能使用GDB进行调试。例如,对test.c 文件进行调试编译test.c :int main(){ return 0;};gcc test.c -o test -g在 u-boot 中需要在Makefile 中打开 -g 编译选项生成的debug 信息如下, 可以通过 readelf -S u-boot|grep debug来查看。其中 .debug_xxxx 存放的就是调试信息, .rela.debug_xxxx 是记