Open kiedtl opened 1 month ago
Really this is an issue with the underlying emulator rather than the test harness.
In addition to printing a stack trace, the instruction should be identified properly, as part of the backtrace:
at Instruction: Orot <sk>
at foo:12
at bar:84
Right after creating this issue, ran into another backtrace-related problem:
This happens because the current function is pushing stuff onto the return stack, so when backtrace unwinds it can't handle RST size not being even.
I've patched this for now with a "paranoid mode" for backtrace-printing that decrements ptr
by 1 if the RST size isn't event, effectively treating every possible pair of bytes as if it were an address (yes, this results in a lot of junk data in the trace), but ideally if the return stack state is known at time of panic then the VM should simply skip those bytes that aren't addresses.
Panic'ing was good placeholder behavior (so not technically a bug), but ideally this should print a backtrace and continue on with testing.