温馨提示:本文翻译自stackoverflow.com,查看原文请点击:linux - Questions about debugging in xv6(riscv) -from MIT 6.S081/6.828 2019 OS course
gdb linux riscv xv6

linux - 有关在xv6(riscv)中进行调试的问题-来自MIT 6.S081 / 6.828 2019操作系统课程

发布于 2020-11-05 13:32:02

我正在尝试调试用户程序,但是当我执行以下操作时:

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/ makefile:https : //paste.ubuntu.com/p/Zp6HXcF4Vq/

查看更多

提问者
Red
被浏览
132
Red 2020-06-19 16:04

我终于想通了:

文件命令后应跟可执行文件的路径

如树所示:如果我想调试wc,我应该输入:

file user/_wc

然后设置断点,然后继续

然后在qemu中运行wc