diff options
author | Tim Newsome <tim@sifive.com> | 2019-02-19 14:48:46 -0800 |
---|---|---|
committer | Andrew Waterman <aswaterman@gmail.com> | 2019-02-19 14:48:46 -0800 |
commit | da8ab7d18d79a921ccf00b4793eac9124d7b4a75 (patch) | |
tree | 48ebef1cd2e1166953e5c9c3276894fe2c8a3b52 | |
parent | 1916b185e25f9e99f192633eadeac592d64d35c4 (diff) | |
download | riscv-isa-sim-da8ab7d18d79a921ccf00b4793eac9124d7b4a75.zip riscv-isa-sim-da8ab7d18d79a921ccf00b4793eac9124d7b4a75.tar.gz riscv-isa-sim-da8ab7d18d79a921ccf00b4793eac9124d7b4a75.tar.bz2 |
Fix small bug in debug example. (#277)
23 is the wrong line number. Avoid future problems by using a label.
-rw-r--r-- | README.md | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -151,6 +151,7 @@ int main() i++; } +done: while (!wait) ; } @@ -199,8 +200,8 @@ riscv.cpu: target state: halted In yet another shell, start your gdb debug session: ``` tnewsome@compy-vm:~/SiFive/spike-test$ riscv64-unknown-elf-gdb rot13-64 -GNU gdb (GDB) 7.12.50.20170505-git -Copyright (C) 2016 Free Software Foundation, Inc. +GNU gdb (GDB) 8.0.50.20170724-git +Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" @@ -216,21 +217,22 @@ Type "apropos word" to search for commands related to "word"... Reading symbols from rot13-64...done. (gdb) target remote localhost:3333 Remote debugging using localhost:3333 -0x000000001001000a in main () at rot13.c:8 -8 while (wait) +0x0000000010010004 in main () at rot13.c:8 +8 while (wait) (gdb) print wait $1 = 1 (gdb) print wait=0 $2 = 0 (gdb) print text $3 = "Vafgehpgvba frgf jnag gb or serr!" -(gdb) b 23 -Breakpoint 1 at 0x10010064: file rot13.c, line 23. +(gdb) b done +Breakpoint 1 at 0x10010064: file rot13.c, line 22. (gdb) c Continuing. +Disabling abstract command writes to CSRs. Breakpoint 1, main () at rot13.c:23 -23 while (!wait) +23 while (!wait) (gdb) print wait $4 = 0 (gdb) print text |