- Timestamp:
- Jul 9, 2020, 8:51:43 AM (4 years ago)
- 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/mrdb.c
r331 r439 6 6 #include <stdlib.h> 7 7 #include <string.h> 8 #include <stdio.h>9 8 #include <ctype.h> 10 9 … … 53 52 {"help", NULL, 1, 0, 1, DBGCMD_HELP, dbgcmd_help}, /* h[elp] */ 54 53 {"info", "breakpoints", 1, 1, 1, DBGCMD_INFO_BREAK, dbgcmd_info_break}, /* i[nfo] b[reakpoints] */ 54 {"info", "locals", 1, 1, 0, DBGCMD_INFO_LOCAL, dbgcmd_info_local}, /* i[nfo] l[ocals] */ 55 55 {"list", NULL, 1, 0, 1, DBGCMD_LIST, dbgcmd_list}, /* l[ist] */ 56 56 {"print", NULL, 1, 0, 0, DBGCMD_PRINT, dbgcmd_print}, /* p[rint] */ … … 185 185 mrb_debug_context_new(mrb_state *mrb) 186 186 { 187 mrb_debug_context *dbg = mrb_malloc(mrb, sizeof(mrb_debug_context));187 mrb_debug_context *dbg = (mrb_debug_context*)mrb_malloc(mrb, sizeof(mrb_debug_context)); 188 188 189 189 memset(dbg, 0, sizeof(mrb_debug_context)); … … 224 224 mrdb_state_new(mrb_state *mrb) 225 225 { 226 mrdb_state *mrdb = mrb_malloc(mrb, sizeof(mrdb_state));226 mrdb_state *mrdb = (mrdb_state*)mrb_malloc(mrb, sizeof(mrdb_state)); 227 227 228 228 memset(mrdb, 0, sizeof(mrdb_state)); 229 229 230 230 mrdb->dbg = mrb_debug_context_get(mrb); 231 mrdb->command = mrb_malloc(mrb, MAX_COMMAND_LINE+1);231 mrdb->command = (char*)mrb_malloc(mrb, MAX_COMMAND_LINE+1); 232 232 mrdb->print_no = 1; 233 233 … … 505 505 506 506 static int32_t 507 check_method_breakpoint(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *regs)507 check_method_breakpoint(mrb_state *mrb, mrb_irep *irep, const mrb_code *pc, mrb_value *regs) 508 508 { 509 509 struct RClass* c; … … 511 511 int32_t bpno; 512 512 mrb_bool isCfunc; 513 struct mrb_insn_data insn; 513 514 514 515 mrb_debug_context *dbg = mrb_debug_context_get(mrb); … … 518 519 dbg->method_bpno = 0; 519 520 520 switch(GET_OPCODE(*pc)) { 521 insn = mrb_decode_insn(pc); 522 switch(insn.insn) { 521 523 case OP_SEND: 522 524 case OP_SENDB: 523 c = mrb_class(mrb, regs[ GETARG_A(*pc)]);524 sym = irep->syms[ GETARG_B(*pc)];525 c = mrb_class(mrb, regs[insn.a]); 526 sym = irep->syms[insn.b]; 525 527 break; 526 528 case OP_SUPER: … … 544 546 545 547 static void 546 mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *regs)548 mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, const mrb_code *pc, mrb_value *regs) 547 549 { 548 550 const char *file; … … 567 569 } 568 570 569 file = mrb_debug_get_filename( irep, (uint32_t)(pc - irep->iseq));570 line = mrb_debug_get_line( irep, (uint32_t)(pc - irep->iseq));571 file = mrb_debug_get_filename(mrb, irep, pc - irep->iseq); 572 line = mrb_debug_get_line(mrb, irep, pc - irep->iseq); 571 573 572 574 switch (dbg->xm) {
Note:
See TracChangeset
for help on using the changeset viewer.