[liode@liodePC:60:linux-5.15.79]$ file vmlinux vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=34e258a3ee6609b274e448f3dc6e61a02ac2971e, with debug_info, not stripped [liode@liodePC:63:linux-5.15.79]$ cat System.map |head -n 5 0000000000000000 D __per_cpu_start 0000000000000000 D fixed_percpu_data 00000000000001de A kexec_control_code_size 0000000000001000 D cpu_debug_store 0000000000002000 D irq_stack_backing_store
[liode@liodePC:69:linux-5.15.79]$ gdb vmlinux GNU gdb (GDB) Fedora Linux 12.1-6.fc37 Copyright (C) 2022 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 "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://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 vmlinux... (gdb)
这个时候,就可以和qemu那边建立关系了,配置同样的端口
1 2 3 4 5 6 7 8 9
(gdb) target remote : 9000 Remote debugging using : 9000 warning: Remote gdbserver does not support determining executable automatically. RHEL <=6.8 and <=7.2 versions of gdbserver do not support such automatic executable detection. The following versions of gdbserver support it: - Upstream version of gdbserver (unsupported) 7.10 or later - Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64) - RHEL-7.3 versions of gdbserver (on any architecture) 0x000000000000fff0 in exception_stacks ()