diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-05-23 23:41:12 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-05-23 23:50:42 +0900 |
| commit | 9644ad51b4a63d8db46d7918ec5e89a547236c56 (patch) | |
| tree | 12c3265c8c71d9b26ff544f2e0f0768bc64cf7c7 /include | |
| parent | d2458e66c26bac5e9db98c22dc6910cb45971b85 (diff) | |
| download | mruby-9644ad51b4a63d8db46d7918ec5e89a547236c56.tar.gz mruby-9644ad51b4a63d8db46d7918ec5e89a547236c56.zip | |
Simplify backtrace mechanism; fix #3633 #3634 #3644
Instead of preserving a backtrace in `mrb_state`, `mrb_exc_set`
keeps packed backtrace in an exception object. `#backtrace` unpacks
it to an array of strings.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby.h | 14 | ||||
| -rw-r--r-- | include/mruby/error.h | 1 |
2 files changed, 1 insertions, 14 deletions
diff --git a/include/mruby.h b/include/mruby.h index 4e2e4ae41..29e8ddc79 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -152,12 +152,6 @@ struct mrb_context { struct mrb_jmpbuf; -typedef struct { - const char *filename; - int lineno; - mrb_sym method_id; -} mrb_backtrace_entry; - typedef void (*mrb_atexit_func)(struct mrb_state*); #define MRB_STATE_NO_REGEXP 1 @@ -172,15 +166,9 @@ typedef struct mrb_state { struct mrb_context *c; struct mrb_context *root_c; + struct iv_tbl *globals; /* global variable table */ struct RObject *exc; /* exception */ - struct { - struct RObject *exc; - int n; - int n_allocated; - mrb_backtrace_entry *entries; - } backtrace; - struct iv_tbl *globals; /* global variable table */ struct RObject *top_self; struct RClass *object_class; /* Object class */ diff --git a/include/mruby/error.h b/include/mruby/error.h index bb67e7bd8..4f8743b35 100644 --- a/include/mruby/error.h +++ b/include/mruby/error.h @@ -25,7 +25,6 @@ MRB_API void mrb_sys_fail(mrb_state *mrb, const char *mesg); MRB_API mrb_value mrb_exc_new_str(mrb_state *mrb, struct RClass* c, mrb_value str); #define mrb_exc_new_str_lit(mrb, c, lit) mrb_exc_new_str(mrb, c, mrb_str_new_lit(mrb, lit)) MRB_API mrb_value mrb_make_exception(mrb_state *mrb, int argc, const mrb_value *argv); -MRB_API mrb_value mrb_exc_backtrace(mrb_state *mrb, mrb_value exc); MRB_API mrb_value mrb_get_backtrace(mrb_state *mrb); MRB_API mrb_noreturn void mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_value args, const char *fmt, ...); |
