You can find the source code in bsp/env/freedom-e300-arty/init.c in the function handle_trap. Exit is called with 1+mcause. You can find mcause values in the privilege spec in the machine cause register section.
I don’t have an arty or hifive1, so I don’t know much about working with them, I just happened to have seen the handle_trap stuff before. Maybe there is a way to get the value of the trapping PC and then map it back to the instruction that failed?