【编程】记录一次gdb coredump 调试经历

记录一次gdb coredump 调试经历

在板子上有个进程反复挂掉重启。把coredump文件下载回开发环境。
命令形式:
gdb xxx cored-xxx

 /projects/hnd/tools/linux/hndtools-mips-linux-uclibc-4.9.3/usr/bin/mips-ugw-linux-uclibc-gdb netctrl core-netctrl-2044-1304208015-11 
GNU gdb (GDB) 7.9.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=mips-ugw-linux-uclibc".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from netctrl...done.
[New LWP 2044]

warning: `/lib/libpthread.so.0': Shared library architecture unknown is not compatible with target architecture mips:isa32.

warning: `/lib/libgcc_s.so.1': Shared library architecture unknown is not compatible with target architecture mips:isa32.

warning: Could not load shared library symbols for 14 libraries, e.g. /lib/libcommon.so.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `netctrl'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x77bd7bc8 in ?? ()

(gdb) set sysroot ../../../targets/O2V1.0/romfs/  ### 最重要的命令!!!!
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libcommon.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libm.so.0...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libz.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libpthread.so.0...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libapcommon.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libssdk_us_km.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libiofdrv.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libkm.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libenv.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libcm.so...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libwshared.so...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libc.so.0...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/ld-uClibc.so.0...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libdl.so.0...(no debugging symbols found)...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libgcc_s.so.1...done.
Reading symbols from ../../../targets/O2V1.0/romfs/lib/libutil.so.0...(no debugging symbols found)...done.
(gdb) 
(gdb) 
(gdb) bt
#0  0x77bd7bc8 in km_mac_filter_set_mode () from ../../../targets/O2V1.0/romfs/lib/libkm.so
#1  0x0041daa4 in mac_filter_apply_global_option () at api/src/behavior_manager/mac_filter_api.c:635
#2  0x0041e67c in mac_filter_init () at api/src/behavior_manager/mac_filter_api.c:862
#3  0x0040ba58 in netctrl_module_init_entry () at netctrl_module.c:530
#4  0x0040b084 in netctrl_init () at netctrl_main.c:2072
#5  0x0040b4b8 in mode_common () at netctrl_main.c:2148
#6  0x0040b724 in main (argc=1, argv=0x7faa7554) at netctrl_main.c:2181
(gdb) 


你可能感兴趣的:(linux,c,shell,gdb)