我正在学习使用/proc/kcore调试内核
我构建了最新稳定的4.19Linux版本,并将其安装在我的虚拟机上。
然后,我进入编译linux源代码的文件夹,并运行以下命令。
sudo gdb vmlinux /proc/kcore它给了我以下错误
Core was generated by `BOOT_IMAGE=/boot/vmlinuz-4.19.6 root=UUID=c17d5f82-e020-4ded-a082-89fd7e54d893'.
#0 0x0000000000000000 in irq_stack_union ()
warning: File "/home/jamal/linux/linux-4.19.6/scripts/gdb/vmlinux-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /home/jamal/linux/linux-4.19.6/scripts/gdb/vmlinux-gdb.py
line to your configuration file "/home/jamal/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/jamal/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"所以,我补充说
$ cat /home/jamal/.gdbinit
add-auto-load-safe-path /home/jamal/linux/linux-4.19.6/scripts/gdb/vmlinux-gdb.py然后,当我尝试刷新kcore文件并打印'jiffies‘值时,它一次又一次地打印相同的值。我在这里犯的错误是什么?
Reading symbols from vmlinux...done.
[New process 1]
Core was generated by `BOOT_IMAGE=/boot/vmlinuz-4.19.6 root=UUID=c17d5f82-e020-4ded-a082-89fd7e54d893'.
#0 0x0000000000000000 in irq_stack_union ()
(gdb) print jiffies
$1 = 4294892296
(gdb) core-file /proc/kcore
[New process 1]
Core was generated by `BOOT_IMAGE=/boot/vmlinuz-4.19.6 root=UUID=c17d5f82-e020-4ded-a082-89fd7e54d893'.
#0 0x0000000000000000 in irq_stack_union ()
(gdb) print jiffies
$2 = 4294892296
(gdb)
$3 = 4294892296
(gdb) q发布于 2019-06-16 00:34:13
您应该在.gdbinit中设置以下内容
set auto-load safe-path /然后启动或重新启动您的计算机以使其生效。
https://stackoverflow.com/questions/53623870
复制相似问题