Unverified Commit 20aab8a1 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4763 from shuujii/mrdb-Fix-that-print-command-raises-FrozenError

Fix that `print` command raises `FrozenError` in `mrdb`; ref 1f5a7f2f
parents 7624e234 7f6e8e8d
......@@ -74,7 +74,7 @@ mrb_debug_eval(mrb_state *mrb, mrb_debug_context *dbg, const char *expr, size_t
*exc = mrb_obj_is_kind_of(mrb, v, mrb->eException_class);
}
s = mrb_funcall(mrb, v, "inspect", 0);
s = mrb_inspect(mrb, v);
/* enable code_fetch_hook */
mrb->code_fetch_hook = tmp;
......
......@@ -18,7 +18,6 @@ dbgcmd_print(mrb_state *mrb, mrdb_state *mrdb)
{
mrb_value expr;
mrb_value result;
mrb_value s;
uint8_t wcnt;
int ai;
......@@ -39,8 +38,9 @@ dbgcmd_print(mrb_state *mrb, mrdb_state *mrdb)
result = mrb_debug_eval(mrb, mrdb->dbg, RSTRING_PTR(expr), RSTRING_LEN(expr), NULL, 0);
/* $print_no = result */
s = mrb_str_cat_lit(mrb, result, "\0");
printf("$%lu = %s\n", (unsigned long)mrdb->print_no++, RSTRING_PTR(s));
printf("$%lu = ", (unsigned long)mrdb->print_no++);
fwrite(RSTRING_PTR(result), RSTRING_LEN(result), 1, stdout);
putc('\n', stdout);
if (mrdb->print_no == 0) {
mrdb->print_no = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment