我在使用 qemu-gdb 时遇到问题。我在一个选项卡中执行了
make qemu-gdb
,在另一个选项卡中执行了riscv64-unknown-elf-gdb
。然后我得到这个:
riscv64-unknown-elf-gdb kernel/kernel
GNU gdb (GDB) 10.1
Copyright (C) 2020 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 "--host=x86_64-apple-darwin21.5.0 --target=riscv64-unknown-elf".
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"...
/Users/lichenglong/.gdbinit:1: Error in sourced command file:
No symbol table is loaded. Use the "file" command.
Reading symbols from kernel/kernel...
warning: File "/Users/username/cs_study/os/6S081/labs/xv6-labs-2022/.gdbinit" 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 /Users/username/cs_study/os/6S081/labs/xv6-labs-2022/.gdbinit
line to your configuration file "/Users/username/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/Users/username/.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
根据提示,我在文件
add-auto-load-safe-path /Users/username/cs_study/os/6S081/labs/xv6-labs-2022/.gdbinit
中添加/Users/username/.gdbinit
行。当我执行source /Users/username/.gdbinit
时,提示command not found: add-auto-load-safe-path
。
然后我将set auto-load safe-path /
行添加到文件并获取它。但是当我运行 riscv64-unknown-elf-gdb
. 时,我得到了相同的结果