0-Linux coredump捕获分析

本文介绍了如何在OpenWrt系统中创建debug-root目录,保存调试信息,配置coredump选项,并详细解释了procd核心参数设置以及在线gdb调试方法。重点讲解了如何在没有debug-root时进行调试和使用gdb工具处理coredump文件。
1.制作debug-root
commit a4a3b5ba5a7bdb3fb98028793d62f37788c0790a
config: CONFIG_DEBUG use debug rootfs, sstrip real rootfs


9ad4d66b7aa27f7ee42281466662d51044001278
 debug: add debug-root for debug coredump and panicVIM 

系统编译加上-g3,在strip之前,将这些文文件存放到debug-root下,strip之后的为正常文文件系统。

vim 14.07/config/Config-build.in

    config DEBUG
        bool
        prompt "Compile packages with debugging info"
        default n
        help
          Adds -g3 to the CFLAGS

    config USE_SSTRIP
        bool "sstrip"
        depends on !USE_GLIBC
        depends on !USE_EGLIBC
        help
          This will install binaries stripped using sstrip


在strip之前保存debug固件

vim 14.07/include/package-ipkg.mk

    # save to debug root, before strip
    @mkdir -p $(TARGET_DEBUG_DIR)
    $(CP) $$(IDIR_$(1))/* $(TARGET_DEBUG_DIR)

TARGET_DEBUG_DIR使用的几个地方:

linye@linye-ubuntu:~/ziroom/ZMAX/ZHA0107/zrouter/14.07$ grep -rn TARGET_DEBUG_DIR ./
./rules.mk:109:TARGET_DEBUG_DIR:=$(TARGET_ROOTFS_DIR)/root-debug-$(BOARD)
./include/kernel-defaults.mk:141:	$(CP) $(LINUX_DIR)/vmlinux $(TARGET_DEBUG_DIR)/vmlinux.debug
./include/package-ipkg.mk:155:	@mkdir -p $(TARGET_DEBUG_DIR)
./include/package-ipkg.mk:156:	$(CP) $$(IDIR_$(1))/* $(TARGET_DEBUG_DIR)
匹配到二进制文件 ./include/.package-ipkg.mk.swp
./include/image.mk:251:	(cd $(TARGET_DEBUG_DIR);tar -czf $(1) *)

root-mtk和root-debug-mtk

linye@linye-ubuntu:~/ziroom/ZMAX/ZHA0107/zrouter/14.07$ ls build_dir/target-mipsel_1004kc_uClibc-0.9.33.2/root-*
build_dir/target-mipsel_1004kc_uClibc-0.9.33.2/root-debug-mtk:
bin      dev  init  mnt      proc  root  sys  usr  vmlinux.debug  zgateway
CONTROL  etc  lib   overlay  rom   sbin  tmp  var  www

build_dir/target-mipsel_1004kc_uClibc-0.9.33.2/root-mtk:
bin  dev  etc  lib  mnt  overlay  proc  rom  root  sbin  sys  tmp  usr  var  www  zgateway

2.添加core dump选项
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Creator_Ly

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值