symbol_file_command=>:symbol_file_add_main_1=>symbol_file_add =>symbol_file_add_with_addrs_or_offsets symbol_file_add_with_addrs_or_offsets主要流程如下 ð abfd = symfile_bfd_open (name); ð objfile = allocate_objfile (abfd, flags); ð syms_from_objfile (objfile, addrs, offs...
(gdb) info functions All defined functions: File example.c: 24: int main(); 19: void task(void *); File thpool.c: 182: int thpool_add_work(thpool_ *, void (*)(void *), void *); 213: void thpool_destroy(thpool_ *); 127: struct thpool_ *thpool_init(int); ... Non-debuggi...
显示问号,就是说 gdb 完全找不到接近的符号,这时候,我们通过 info symbol [address] 指令也是得不到地址对应的符号信息的。 尝试手动加载调试符号文件 gdb 需要知道 [symbol] -> [address] 的映射信息,而 gdb 正好提供了 symbol-file 和 add-symbol-file 指令来手动添加这个信息。因此,我们要做的就是把 .deb...
(gdb) add-symbol-file /home/zy/debuginfo/debug_infos/test.debug add symbol table from file "/home/zy/debuginfo/debug_infos/test.debug" (y or n) y Reading symbols from /home/zy/debuginfo/debug_infos/test.debug... (gdb) b liba_func Breakpoint 1 at 0x401030 (gdb) b main Breakpoint...
Another quetion : I can follow the kernel source with gdb but after __primary_switched, I cannot see the source. The debugger doesn't show the correct source location according to the now kernel virtual PC value. Should I tell the debugger to use correct offset using add-symbol-file again...
cat gdb.setup|grep add-symbol-file } 在远端启动gdbserver,attach app function attach_app(){ echo "killing launched gdbserver if any..." kill_gdbserver echo "starting gdbserver attaching $PACKAGE_NAME..." APP_PID=`adb shell "ps | grep -v ' Z ' |grep $PACKAGE_NAME" | awk '{print...
gdb 需要知道 [symbol] -> [address] 的映射信息,而 gdb 正好提供了 symbol-file 和 add-symbol-file 指令来手动添加这个信息。因此,我们要做的就是把 .debug 文件内的符号信息告诉 gdb 。先看下 .debug 文件内保存的符号信息: 其中_start 符号是个特殊的符号,一般是 ELF 文件的入口。通过 readelf -h 命...
如果程序的调试符号文件不在默认路径中,GDB可能无法找到并加载调试符号。解决方法是使用GDB的symbol-file命令手动指定调试符号文件的路径。 总之,确保程序编译时生成调试符号文件,禁用优化编译选项,确保动态链接库的调试符号文件可用,并正确设置调试符号文件的路径,可以帮助解决难以让GDB加载调试符号的问题。
add symbol table from file "/home/wei/workspace/learning/kernel_module/scull_debug/scull.ko" at .text_addr = 0xf9df8000 .bss_addr = 0xf9dfaa00 .data_addr = 0xf9df9720 (y or n) y Reading symbols from /workspace/wei/learning/kernel_module/scull_debug/scull.ko...done. ...
add-symbol-file-from-memory -- Load the symbols out of memory from a dynamically loaded object file cd -- Set working directory to DIR for debugger and program being debugged core-file -- Use FILE as core dump for examining memory and registers ...