parrotcode: Exceptions | |
Contents | C |
src/exceptions.c - Exceptions
Define the the core subsystem for exceptions.
PMC *Parrot_ex_build_exception
void die_from_exception
exception
,
a message if there is one,
and then exit.
void Parrot_ex_add_c_handler
opcode_t *Parrot_ex_throw_from_op
void Parrot_ex_throw_from_c
exit_fatal()
,
which signals fatal errors,
and Parrot_ex_throw_from_op
.The 'invoke' vtable function doesn't actually execute a sub/continuation/handler,
it only sets up the environment for invocation and returns the address of the start of the sub's code.
That address then becomes the next op in the runloop.Exceptions thrown from C and caught by a continuation-based handler are resumable at the level of a C instruction.
When handled,
they return the exception object.
Any values returned from the handler to the C code that threw the exception can be stored in the exception's payload.
opcode_t *Parrot_ex_throw_from_op_args
Parrot_ex_throw_from_c
,
Parrot_ex_throw_from_op
,
and exit_fatal()
.
void Parrot_ex_throw_from_c_args
ret_addr
is the address from which to resume,
if some handler decides that is appropriate,
or zero to make the error non-resumable.
exitcode
is a exception_type_enum
value.See also Parrot_ex_throw_from_c
,
Parrot_ex_throw_from_op
,
and exit_fatal()
.
opcode_t *Parrot_ex_rethrow_from_op
void Parrot_ex_rethrow_from_c
new_c_exception
.
void Parrot_ex_mark_unhandled
size_t Parrot_ex_calc_handler_offset
void Parrot_assert
void Parrot_confess
void Parrot_print_backtrace
Parrot_confess
.
void exit_fatal
exit
to exit the process with the given exitcode.
It is not possible for Parrot bytecode to intercept a fatal error (for that,
use Parrot_ex_throw_from_c_args
).
exit_fatal
does not call Parrot_exit
to invoke exit handlers (that would require an interpreter).
void do_panic
include/parrot/exceptions.h.
|