To show you how to debug RISC-V program in VS Code.
There is a simple project with .vscode
, including launch.json
and tasks.json
.
- riscv64-unknown-linux-gnu toolchain
- QEMU-6.2.0
- C/C++ VS Code extension
- riscv64-unknown-linux-gnu, toolchain
- qemu-riscv64, QEMU
Simply, replace ${RISCV} and ${QEMU} with real paths in two json file.
args
forRun Qemu Server(RISC-V)
intasks.json
,sysroot
to real path.- All commands in
command
to real paths. port
, i.e. 65501 in project, to custom one but the same in two json files.
- Copy configuration files in
.vscode
to your project and modify the paths. - Terminal -> Run Task -> C/C++(RISC-V): Build active file
- Terminal -> Run Task -> Run Qemu Server(RISC-V)
- F5 to start debugging
This project is licensed under the GPLv2 - see the LICENSE file for details