我正在尝试调试用户程序,但是当我执行以下操作时:
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/
我终于想通了:
文件命令后应跟可执行文件的路径
如树所示:如果我想调试wc,我应该输入:
file user/_wc
然后设置断点,然后继续
然后在qemu中运行wc