Ignore:
Timestamp:
Jul 9, 2020, 8:51:43 AM (4 years ago)
Author:
coas-nagasima
Message:

mrubyを2.1.1に更新

Location:
EcnlProtoTool/trunk/mruby-2.1.1
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c

    r331 r439  
    1919  mrb_value expr;
    2020  mrb_value result;
    21   mrb_value s;
    2221  uint8_t wcnt;
    2322  int ai;
     
    3736  }
    3837
    39   result = mrb_debug_eval(mrb, mrdb->dbg, RSTRING_PTR(expr), RSTRING_LEN(expr), NULL);
     38  result = mrb_debug_eval(mrb, mrdb->dbg, RSTRING_PTR(expr), RSTRING_LEN(expr), NULL, 0);
    4039
    4140  /* $print_no = result */
    42   s = mrb_str_cat_lit(mrb, result, "\0");
    43   printf("$%lu = %s\n", (unsigned long)mrdb->print_no++, RSTRING_PTR(s));
     41  printf("$%lu = ", (unsigned long)mrdb->print_no++);
     42  fwrite(RSTRING_PTR(result), RSTRING_LEN(result), 1, stdout);
     43  putc('\n', stdout);
    4444
    4545  if (mrdb->print_no == 0) {
     
    5757  return dbgcmd_print(mrb, mrdb);
    5858}
     59
     60dbgcmd_state
     61dbgcmd_info_local(mrb_state *mrb, mrdb_state *mrdb)
     62{
     63  mrb_value result;
     64  mrb_value s;
     65  int ai;
     66
     67  ai = mrb_gc_arena_save(mrb);
     68
     69  result = mrb_debug_eval(mrb, mrdb->dbg, "local_variables", 0, NULL, 1);
     70
     71  s = mrb_str_cat_lit(mrb, result, "\0");
     72  printf("$%lu = %s\n", (unsigned long)mrdb->print_no++, RSTRING_PTR(s));
     73
     74  if (mrdb->print_no == 0) {
     75    mrdb->print_no = 1;
     76  }
     77
     78  mrb_gc_arena_restore(mrb, ai);
     79
     80  return DBGST_PROMPT;
     81}
Note: See TracChangeset for help on using the changeset viewer.