I’m trying to execute small pieces of assembler code that, when finished, exit back to the debugger. I’m using SiFive’s openocd in the usual way. (Except that I’m not using GDB - more on this later.
After reading thru both debug specs (0.11 and 0.13) and eyeballing and grepping the code in openocd/src/target/riscv/ I’m coming to the conclusion that I can simply use an EBREAK instruction to exit back to the debugger. Is this right? It seems like openocd is setting all the EBREAK{M,H,S,U} bits in the DCSR register before re-starting the target, and this suggests that EBREAK will halt the core and return the debugger. I just wanted to ping folks here to see if my thinking (and understanding) is correct.
Thanks!