关于xv6(riscv)调试的问题-来自MIT 6.S081/6.828 2019 OS课程
Questions about debugging in xv6(riscv) -from MIT 6.S081/6.828 2019 OS course
我正在尝试调试用户程序,但是当我这样做时:
open a terminal:make qemu-gdb
another terminal:
riscv64-unknown-elf-gdb
file wc(or any other user programs)
it says:
(gdb) file wc
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default riscv settings.
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default riscv settings.
Reading symbols from wc...
(No debugging symbols found in wc)
我编辑了 Makefile,并在 CFLAGS 和 LDFLAGS 中都添加了 -g,但是它不起作用
我想知道如何调试用户程序
如果你能回复并帮助我,我将不胜感激
ps:这里是MakeFile和项目树
树:https://paste.ubuntu.com/p/s9JGY8d4Z9/
生成文件:https://paste.ubuntu.com/p/Zp6HXcF4Vq/
我终于想通了:
文件命令后应跟可执行文件的路径
所以作为树 suggests:if 我想调试 wc,我应该输入:
file user/_wc
然后设置断点,然后继续
然后 运行 在 qemu 中 wc
我正在尝试调试用户程序,但是当我这样做时:
open a terminal:make qemu-gdb
another terminal:
riscv64-unknown-elf-gdb
file wc(or any other user programs)
it says:
(gdb) file wc
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default riscv settings.
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default riscv settings.
Reading symbols from wc...
(No debugging symbols found in wc)
我编辑了 Makefile,并在 CFLAGS 和 LDFLAGS 中都添加了 -g,但是它不起作用 我想知道如何调试用户程序
如果你能回复并帮助我,我将不胜感激
ps:这里是MakeFile和项目树
树:https://paste.ubuntu.com/p/s9JGY8d4Z9/ 生成文件:https://paste.ubuntu.com/p/Zp6HXcF4Vq/
我终于想通了:
文件命令后应跟可执行文件的路径
所以作为树 suggests:if 我想调试 wc,我应该输入:
file user/_wc
然后设置断点,然后继续
然后 运行 在 qemu 中 wc