I am trying to debug user programs,but when I do as follows:
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)
I edit the Makefile,and add -g in both CFLAGS and LDFLAGS,but it just don't work I wonder how can I debug user programs
I'd appreciate it if you could reply and helpe me
ps:here is the MakeFile and the project tree
tree:https://paste.ubuntu.com/p/s9JGY8d4Z9/ makefile:https://paste.ubuntu.com/p/Zp6HXcF4Vq/
I finally figured it out:
file command should be followed with path of the executable
so as the tree suggests:if I want to debug wc,I should type:
file user/_wc
and then set breakpoints,and then continue
then run wc in qemu