eval_error.c File Reference

Go to the source code of this file.

## Macros

#define | warn_print(x) rb_write_error(x)
#define | warn_print2(x, l) rb_write_error2((x),(l))
#define | TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
#define | TRACE_HEAD 8
#define | TRACE_TAIL 5

## Functions

static void | warn_printf (const char *fmt,...)
static void | error_pos (void)
static VALUE | get_backtrace (VALUE info)
VALUE | rb_get_backtrace (VALUE info)
static void | set_backtrace (VALUE info, VALUE bt)
static void | error_print (void)
void | ruby_error_print (void)
void | rb_print_undef (VALUE klass, ID id, int scope)
static int | sysexit_status (VALUE err)
static int | error_handle (int ex)

## Macro Definition Documentation

#define TRACE_HEAD 8

Referenced by error_print().

#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)

Referenced by error_print().

#define TRACE_TAIL 5

Referenced by error_print().

#define warn_print | ( |  | x | ) | rb_write_error(x)

Definition at line 18 of file eval_error.c.

Referenced by error_handle(), and error_print().

#define warn_print2 | ( |  | x,
|  |  | l
| ) |  | rb_write_error2((x),(l))

Definition at line 19 of file eval_error.c.

Referenced by error_print().

## Function Documentation

static int error_handle | ( | int | ex | ) |

static

Definition at line 217 of file eval_error.c.

References error_pos(), error_print(), EXIT_FAILURE, EXIT_SUCCESS, GET_THREAD, rb_bug(), rb_eSignal, rb_eSystemExit, rb_obj_is_instance_of(), rb_obj_is_kind_of(), rb_threadptr_reset_raised(), rb_threadptr_set_raised(), sysexit_status(), TAG_BREAK, TAG_FATAL, TAG_MASK, TAG_NEXT, TAG_RAISE, TAG_REDO, TAG_RETRY, TAG_RETURN, TAG_THROW, warn_print, and warn_printf().

Referenced by rb_exec_end_proc(), ruby_cleanup(), and ruby_options().

static void error_pos | ( | void |  | ) |

static

Definition at line 22 of file eval_error.c.

References rb_frame_callee(), rb_id2name(), rb_sourcefile, rb_sourceline(), and warn_printf().

Referenced by error_handle(), and error_print().

static void error_print | ( | void |  | ) |

static

Definition at line 65 of file eval_error.c.

References CLASS_OF, rb_thread_struct::errinfo, error_pos(), EXEC_TAG, get_backtrace(), GET_THREAD, i, len, NIL_P, POP_TAG, PUSH_TAG, Qnil, rb_thread_struct::raised_flag, RARRAY_LEN, RARRAY_PTR, rb_class_name(), rb_eRuntimeError, rb_eSysStackError, rb_funcall(), rb_intern, rb_sourcefile, rb_sourceline(), rb_thread_raised_clear, rb_thread_raised_set, RSTRING_LEN, RSTRING_PTR, StringValue, T_STRING, TRACE_HEAD, TRACE_MAX, TRACE_TAIL, TYPE, warn_print, warn_print2, and warn_printf().

Referenced by error_handle(), ruby_error_print(), and ruby_init().

static VALUE get_backtrace | ( | VALUE | info | ) |

static

Definition at line 42 of file eval_error.c.

References NIL_P, Qnil, rb_check_backtrace(), rb_funcall(), and rb_intern.

Referenced by errat_getter(), error_print(), rb_get_backtrace(), and setup_exception().

VALUE rb_get_backtrace | ( | VALUE | info | ) |

Definition at line 53 of file eval_error.c.

References get_backtrace().

Referenced by eval_string_with_cref().

void rb_print_undef | ( | VALUE | klass,
|  | ID | id,
|  | int | scope
| ) |  |

Definition at line 193 of file eval_error.c.

References NOEX_PRIVATE, NOEX_PROTECTED, NOEX_PUBLIC, rb_class2name(), rb_id2name(), rb_name_error(), T_MODULE, TYPE, and v.

Referenced by mnew(), rb_alias(), rb_export_method(), and rb_mod_modfunc().

void ruby_error_print | ( | void |  | ) |

Definition at line 187 of file eval_error.c.

References error_print().

Referenced by rb_f_abort().

static void set_backtrace | ( | VALUE | info,
|  | VALUE | bt
| ) |  |

static

Definition at line 59 of file eval_error.c.

References rb_funcall(), and rb_intern.

Referenced by errat_setter(), make_exception(), and setup_exception().

static int sysexit_status | ( | VALUE | err | ) |

static

Definition at line 210 of file eval_error.c.

References NUM2INT, and rb_iv_get().

Referenced by error_handle(), and ruby_cleanup().

static void warn_printf | ( | const char * | fmt,
|  |  | ...
| ) |  |

static

Definition at line 7 of file eval_error.c.

References args, buf, rb_write_error(), va_init_list, and vsnprintf.

Referenced by error_handle(), error_pos(), error_print(), and setup_exception().