lx-symbols:Python 异常 <class 'gdb.MemoryError'> 无法访问地址 0xff 处的内存

per*_*lex 7 gdb remote-debugging linux-kernel

我正在尝试从内核加载lx 符号。但它一直向我显示以下错误:

(gdb) lx-symbols
loading vmlinux
Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 0xffffffff824fb470: 
Error occurred in Python command: Cannot access memory at address 0xffffffff824fb470
Run Code Online (Sandbox Code Playgroud)

现在我成功地能够从同一版本加载lx 符号(不确定这是否是正确的术语),但不知道为什么我可以再加载它。

现在,当我第一次通过 gdb 连接到远程计算机时,它通常显示构建跟踪,如下所示:

GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 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-linux-gnu".
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 ./vmlinux...done.
(gdb) target remote: 1235
Remote debugging using : 1235
native_safe_halt ()
    at /build/linux-hwe-22QmxS/linux-hwe-5.3.0/arch/x86/include/asm/irqflags.h:61
61    /build/linux-hwe-22QmxS/linux-hwe-5.3.0/arch/x86/include/asm/irqflags.h: No such file or directory.
Run Code Online (Sandbox Code Playgroud)

现在,当我连接到远程内核时,它会向我显示以下内容:

(gdb) target remote :1235
Remote debugging using :1235
0xffffffff81a98522 in __irqentry_text_end ()
Run Code Online (Sandbox Code Playgroud)

我注意到构建跟踪 /build/linux-hwe-22QmxS/linux-hwe-5.3.0/arch/x86/include/asm/irqflags.h:61 61消失了(我没有对配置或设置进行任何更改)。

这是我第二次面临同样的问题。第一次,我以为我可能不小心做了一些更改,但随着问题再次出现,这次我很确定我没有做任何更改。

我的.gdbinit文件具有正确的路径。

add-auto-load-safe-path /../../ubuntu-bionic/debian/build/build-generic/vmlinux-gdb.py
Run Code Online (Sandbox Code Playgroud)

我使用以下命令检查源是否正确加载:

(gdb) source /home/../../ubuntu-bionic/debian/build/build-generic/vmlinux-gdb.py
Run Code Online (Sandbox Code Playgroud)

它没有给我带来任何错误。所以,我猜源加载正确。我只是不知道还能做什么。请帮忙。

小智 2

尝试添加到内核启动参数“nokaslr”和/或使用 CONFIG_RANDOMIZE_BASE=n 进行构建