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

本文介绍了如何在OpenWrt系统中创建debug-root目录,保存调试信息,配置coredump选项,并详细解释了procd核心参数设置以及在线gdb调试方法。重点讲解了如何在没有debug-root时进行调试和使用gdb工具处理coredump文件。
最低0.47元/天 解锁文章
5865

被折叠的 条评论
为什么被折叠?



