mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-proc-ext/proc.c: use mrb_debug_get_position()
This commit is contained in:
@@ -51,16 +51,13 @@ proc_inspect(mrb_state *mrb, mrb_value self)
|
||||
int32_t line;
|
||||
mrb_str_cat_lit(mrb, str, " ");
|
||||
|
||||
filename = mrb_debug_get_filename(mrb, irep, 0);
|
||||
mrb_str_cat_cstr(mrb, str, filename ? filename : "-");
|
||||
mrb_str_cat_lit(mrb, str, ":");
|
||||
|
||||
line = mrb_debug_get_line(mrb, irep, 0);
|
||||
if (line != -1) {
|
||||
if (mrb_debug_get_position(mrb, irep, 0, &line, &filename)) {
|
||||
mrb_str_cat_cstr(mrb, str, filename);
|
||||
mrb_str_cat_lit(mrb, str, ":");
|
||||
mrb_str_concat(mrb, str, mrb_fixnum_value(line));
|
||||
}
|
||||
else {
|
||||
mrb_str_cat_lit(mrb, str, "-");
|
||||
mrb_str_cat_lit(mrb, str, "-:-");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user