46 callinfo = callinfo->
prev;
77 if( *(
const char *)message == 0 ) {
78 ex->
message = (
const uint8_t *)
"";
91 uint8_t *buf = mrbc_alloc( vm, len+1 );
93 memcpy( buf, message, len );
149 const char msg_len = msg ? strlen(msg) : 0;
170 static const int MESSAGE_INI_LEN = 32;
172 va_start( ap, fstr );
175 if( vm ) buf = mrbc_alloc( vm, MESSAGE_INI_LEN );
258static 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 );
363#include "_autogen_class_exception.h"
void mrbc_raw_free(void *ptr)
static void mrbc_set_nil(mrbc_value *p)
#define mrbc_immediate_value(...)
struct RObject mrbc_value
Value object. Default version.
mrbc_value mrbc_string_new(mrbc_vm *vm, const void *src, int len)
static char * mrbc_string_cstr(const mrbc_value *v)
static mrbc_value mrbc_string_new_cstr(mrbc_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 CALLINFO mrbc_callinfo
Call information.
Global configuration of mruby/c VM's.