- 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/apibreak.c
r331 r439 85 85 86 86 static uint16_t 87 check_file_lineno( struct mrb_irep *irep, const char *file, uint16_t lineno)87 check_file_lineno(mrb_state *mrb, struct mrb_irep *irep, const char *file, uint16_t lineno) 88 88 { 89 89 mrb_irep_debug_info_file *info_file; … … 94 94 95 95 for (f_idx = 0; f_idx < irep->debug_info->flen; ++f_idx) { 96 const char *filename; 96 97 info_file = irep->debug_info->files[f_idx]; 97 if (!strcmp(info_file->filename, file)) { 98 filename = mrb_sym_name_len(mrb, info_file->filename_sym, NULL); 99 if (!strcmp(filename, file)) { 98 100 result = MRB_DEBUG_BP_FILE_OK; 99 101 … … 104 106 } 105 107 for (i=0; i < irep->rlen; ++i) { 106 result |= check_file_lineno( irep->reps[i], file, lineno);108 result |= check_file_lineno(mrb, irep->reps[i], file, lineno); 107 109 if (result == (MRB_DEBUG_BP_FILE_OK | MRB_DEBUG_BP_LINENO_OK)) { 108 110 return result; … … 113 115 } 114 116 115 static const char*116 get_class_name(mrb_state *mrb, struct RClass *class_obj)117 {118 struct RClass *outer;119 mrb_sym class_sym;120 121 outer = mrb_class_outer_module(mrb, class_obj);122 class_sym = mrb_class_sym(mrb, class_obj, outer);123 return mrb_sym2name(mrb, class_sym);124 }125 126 117 static int32_t 127 118 compare_break_method(mrb_state *mrb, mrb_debug_breakpoint *bp, struct RClass *class_obj, mrb_sym method_sym, mrb_bool* isCfunc) … … 129 120 const char* class_name; 130 121 const char* method_name; 131 struct RProc*m;122 mrb_method_t m; 132 123 struct RClass* sc; 133 124 const char* sn; … … 136 127 mrb_bool is_defined; 137 128 138 method_name = mrb_sym 2name(mrb, method_sym);129 method_name = mrb_sym_name(mrb, method_sym); 139 130 140 131 method_p = &bp->point.methodpoint; 141 132 if (strcmp(method_p->method_name, method_name) == 0) { 142 class_name = get_class_name(mrb, class_obj);133 class_name = mrb_class_name(mrb, class_obj); 143 134 if (class_name == NULL) { 144 135 if (method_p->class_name == NULL) { … … 148 139 else if (method_p->class_name != NULL) { 149 140 m = mrb_method_search_vm(mrb, &class_obj, method_sym); 150 if ( m == NULL) {141 if (MRB_METHOD_UNDEF_P(m)) { 151 142 return MRB_DEBUG_OK; 152 143 } 153 if (MRB_ PROC_CFUNC_P(m)) {144 if (MRB_METHOD_CFUNC_P(m)) { 154 145 *isCfunc = TRUE; 155 146 } … … 163 154 ssym = mrb_symbol(mrb_check_intern_cstr(mrb, method_p->method_name)); 164 155 m = mrb_method_search_vm(mrb, &sc, ssym); 165 if ( m == NULL) {156 if (MRB_METHOD_UNDEF_P(m)) { 166 157 return MRB_DEBUG_OK; 167 158 } 168 159 169 class_name = get_class_name(mrb, class_obj);170 sn = get_class_name(mrb, sc);160 class_name = mrb_class_name(mrb, class_obj); 161 sn = mrb_class_name(mrb, sc); 171 162 if (strcmp(sn, class_name) == 0) { 172 163 return bp->bpno; … … 197 188 198 189 /* file and lineno check (line type mrb_debug_line_ary only.) */ 199 result = check_file_lineno( dbg->root_irep, file, lineno);190 result = check_file_lineno(mrb, dbg->root_irep, file, lineno); 200 191 if (result == 0) { 201 192 return MRB_DEBUG_BREAK_INVALID_FILE; … … 205 196 } 206 197 207 set_file = mrb_malloc(mrb, strlen(file) + 1);198 set_file = (char*)mrb_malloc(mrb, strlen(file) + 1); 208 199 209 200 index = dbg->bpnum; … … 242 233 243 234 if (class_name != NULL) { 244 set_class = mrb_malloc(mrb, strlen(class_name) + 1);235 set_class = (char*)mrb_malloc(mrb, strlen(class_name) + 1); 245 236 strncpy(set_class, class_name, strlen(class_name) + 1); 246 237 } … … 249 240 } 250 241 251 set_method = mrb_malloc(mrb, strlen(method_name) + 1);242 set_method = (char*)mrb_malloc(mrb, strlen(method_name) + 1); 252 243 253 244 strncpy(set_method, method_name, strlen(method_name) + 1); … … 438 429 439 430 static mrb_bool 440 check_start_pc_for_line(mrb_ irep *irep,mrb_code *pc, uint16_t line)431 check_start_pc_for_line(mrb_state *mrb, mrb_irep *irep, const mrb_code *pc, uint16_t line) 441 432 { 442 433 if (pc > irep->iseq) { 443 if (line == mrb_debug_get_line( irep, (uint32_t)(pc - irep->iseq - 1))) {434 if (line == mrb_debug_get_line(mrb, irep, pc - irep->iseq - 1)) { 444 435 return FALSE; 445 436 } … … 459 450 } 460 451 461 if (!check_start_pc_for_line( dbg->irep, dbg->pc, line)) {452 if (!check_start_pc_for_line(mrb, dbg->irep, dbg->pc, line)) { 462 453 return MRB_DEBUG_OK; 463 454 } … … 515 506 return 0; 516 507 } 517 518
Note:
See TracChangeset
for help on using the changeset viewer.