-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
### Nim RISC-V program example | ||
## Nim RISC-V program example | ||
|
||
The program is designed to print a JSON structure and then crash. | ||
The signal handlers will show the backtrace as long as debug info is added. | ||
|
||
## Requirements | ||
### Requirements | ||
|
||
You will need to have Nim in your PATH. | ||
|
||
Install gcc-10-riscv64-linux-gnu to be able build the Nim program for RISC-V. | ||
|
||
### Debugging | ||
|
||
Run `bash debug.sh` to start remotely debugging with GDB. You will need to build the RISC-V GDB from the RISC-V GNU toolchain, as it is not provided by any distro that I know of. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
file riscv64-linux-gnu/hello | ||
target remote localhost:2159 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export DEBUG=1 | ||
source build.sh | ||
echo "==================================" | ||
echo " Start emulator with DEBUG=1 now. " | ||
echo "==================================" | ||
riscv64-unknown-linux-gnu-gdb -x debug.gdb |