
Debugging terminal TUI for RISC-V microcontroller forth
I've been working on a forth for RISC-V microcontrollers, and made this special TUI application for debugging. The forth is fully useable with a normal serial comms tool like minicom but this is supposed to augment it's useability with debugging features, sending and parsing the plain-text response from certain forth words in the background.
It first needs to read the startup message from the serial port, then, knowing the microcontroller is present and initialized it sends the "showWords" word which prints the memory contents of all words, which the forth_shell application parses and annotates with what certain pointers point to.
Then when a new word is added it will send "showLastWord" which will print the memory of only the last word created, which is parsed and added to the list. This is imperfect - right now it just detects when an ";" is included in the last line when enter is pressed, but for some instances like "42 const bar" in the video I need to press f5 to manually add the new word.
Eventually I will add the ability to set breakpoints (at least on words in RAM and not flash).
My first attempt at rust, which I still don't understand too well, It's a lot of libraries hacked together that allocate memory all over the place.