46 callinfo = callinfo->
prev;
78 if( *(
const char *)message == 0 ) {
79 ex->
message = (
const uint8_t *)
"";
92 uint8_t *buf = mrbc_alloc( vm, len+1 );
94 memcpy( buf, message, len );
154 const char msg_len = msg ? strlen(msg) : 0;
175 static const int MESSAGE_INI_LEN = 32;
177 va_start( ap, fstr );
180 if( vm ) buf = mrbc_alloc( vm, MESSAGE_INI_LEN );
263static void c_exception_new(
struct VM *vm,
mrbc_value v[],
int argc)
281static void c_exception_message(
struct VM *vm,
mrbc_value v[],
int argc)
285 if( v[0].exception->message ) {
286 value =
mrbc_string_new( vm, v[0].exception->message, v[0].exception->message_size );
356#include "_autogen_class_exception.h"
void mrbc_raw_free(void *ptr)
mrbc_value mrbc_string_new(struct VM *vm, const void *src, int len)
static char * mrbc_string_cstr(const mrbc_value *v)
static mrbc_value mrbc_string_new_cstr(struct VM *vm, const char *src)
static int mrbc_string_size(const mrbc_value *str)
void mrbc_printf(const char *fstr,...)
void mrbc_vprintf(const char *fstr, va_list ap)
void mrbc_vasprintf(char **buf, int bufsiz, const char *fstr, va_list ap)
void mrbc_print_exception(const mrbc_value *v)
void mrbc_raise(struct VM *vm, struct RClass *exc_cls, const char *msg)
void mrbc_print_vm_exception(const struct VM *vm)
void mrbc_exception_delete(mrbc_value *value)
static mrbc_exception * sub_exception_new(struct VM *vm, struct RClass *exc_cls)
mrbc_value mrbc_exception_new_alloc(struct VM *vm, struct RClass *exc_cls, const void *message, int len)
mrbc_value mrbc_exception_new(struct VM *vm, struct RClass *exc_cls, const void *message, int len)
void mrbc_raisef(struct VM *vm, struct RClass *exc_cls, const char *fstr,...)
void mrbc_clear_exception(struct VM *vm)
#define MRBC_EXCEPTION_CALL_NEST_LEVEL
struct RException mrbc_exception
Exception object.
Include at once the necessary header files.
mrbc_sym method_id
called method ID.
struct CALLINFO * prev
previous linked list.
mrbc_sym sym_id
class name's symbol ID
mrbc_sym call_nest[MRBC_EXCEPTION_CALL_NEST_LEVEL]
struct RClass * cls
exception class.
const uint8_t * message
to heap or ROM.
mrbc_sym method_id
raised method, if it is known.
uint16_t message_size
message length.
struct RException * exception
mrbc_callinfo * callinfo_tail
Last point of CALLINFO link.
uint8_t vm_id
vm_id : 1..MAX_VM_COUNT
volatile int8_t flag_preemption
mrbc_value exception
Raised exception or nil.
const char * mrbc_symid_to_str(mrbc_sym sym_id)
static void mrbc_decref(mrbc_value *v)
#define MRBC_INIT_OBJECT_HEADER(p, t)
@ MRBC_TT_EXCEPTION
Exception.
struct RObject mrbc_value
struct CALLINFO mrbc_callinfo
Call information.
Global configuration of mruby/c VM's.