【发布时间】:2020-09-25 00:35:19
【问题描述】:
我正在尝试使用 gdb 从 vmlinux 读取内存。确切的语法是
sudo gdb vmlinux-4.18.0-rc1+ /proc/kcore
我使用这个文件是因为 vmlinux 是这个文件的符号链接。 结果如下
Reading symbols from vmlinux-4.18.0-rc1+...(no debugging symbols found)...done.
warning: core file may not match specified executable file.
[New process 1]
Core was generated by `root=/dev/mapper/rcs--power9--talos--vg-root ro console=hvc0 quiet'.
#0 0x0000000000000000 in ?? ()
(gdb) x/4xb 0xfffffff0
0xfffffff0: Cannot access memory at address 0xfffffff0
(gdb) print &sys_call_table
No symbol table is loaded. Use the "file" command.
(gdb)
文件 vmlinux-4.18.0-rc1+ 位于 /boot。文件类型如下:
root@rcs-power9-talos:/boot# 文件 vmlinux-4.18.0-rc1+ vmlinux-4.18.0-rc1+:ELF 64 位 LSB 可执行文件,64 位 PowerPC 或 cisco 7500,版本 1 (SYSV),静态链接,BuildID[sha1]=a1c9f3fe22ff5cbf419787657c878c8a07e559b2,剥离
我修改了 config-4.18.0-rc1+ 文件,使得每个 CONFIG_DEBUG 选项都设置为 yes。然后我重新启动了系统。我的问题是:
- 是否需要执行其他任何操作才能使我对 /boot/config-4.18.0-rc1+ 所做的更改生效?
- 根据 vmlinux-4.18.0-rc1+ 的文件类型,这个文件是否应该可以用于调试?
我没有自己构建内核。它是 Raptor Computer Systems 的定制版本。
【问题讨论】:
标签: linux-kernel gdb kernel elf procfs