fwsGonzo / libriscv

The fastest RISC-V sandbox
BSD 3-Clause "New" or "Revised" License
526 stars 46 forks source link

libtcc does not forward exception due to lack of unwinding tables #104

Closed fwsGonzo closed 3 weeks ago

fwsGonzo commented 7 months ago

There are some possible steps:

  1. Handle exceptions immediately, get return value from opaque calls that can throw
  2. Change the API calls that throw exceptions to instead indicate that an exception was thrown.
  3. Instead of calling api.exception(cpu), simply return a non-zero value, indicating an exception.

In all cases, we will need to return a value or the current state from libtcc to libriscv. We may want to forward the current exception too. It's definitely possible.

fwsGonzo commented 3 weeks ago

Solved with https://github.com/fwsGonzo/libriscv/pull/150