static void print_info_stopped_code(mrb_state *mrb, mrdb_state *mrdb) { char* file = mrb_debug_get_source(mrb, mrdb, mrdb->srcpath, mrdb->dbg->prvfile); uint16_t lineno = mrdb->dbg->prvline; if(file != NULL) { mrb_debug_list(mrb, mrdb->dbg, file, lineno, lineno); mrb_free(mrb, file); } }
dbgcmd_state dbgcmd_list(mrb_state *mrb, mrdb_state *mrdb) { char *filename; listcmd_parser_state *st = listcmd_parser_state_new(mrb); if (parse_listcmd_args(mrb, mrdb, st)) { if ((filename = mrb_debug_get_source(mrb, mrdb, mrdb->srcpath, st->filename)) == NULL) { filename = st->filename; } mrb_debug_list(mrb, mrdb->dbg, filename, st->line_min, st->line_max); if (filename != NULL && filename != st->filename) { mrb_free(mrb, filename); } listcmd_parser_state_free(mrb, st); } return DBGST_PROMPT; }