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/apibreak.c

    r331 r439  
    8585
    8686static uint16_t
    87 check_file_lineno(struct mrb_irep *irep, const char *file, uint16_t lineno)
     87check_file_lineno(mrb_state *mrb, struct mrb_irep *irep, const char *file, uint16_t lineno)
    8888{
    8989  mrb_irep_debug_info_file *info_file;
     
    9494
    9595  for (f_idx = 0; f_idx < irep->debug_info->flen; ++f_idx) {
     96    const char *filename;
    9697    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)) {
    98100      result = MRB_DEBUG_BP_FILE_OK;
    99101
     
    104106    }
    105107    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);
    107109      if (result == (MRB_DEBUG_BP_FILE_OK | MRB_DEBUG_BP_LINENO_OK)) {
    108110        return result;
     
    113115}
    114116
    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 
    126117static int32_t
    127118compare_break_method(mrb_state *mrb, mrb_debug_breakpoint *bp, struct RClass *class_obj, mrb_sym method_sym, mrb_bool* isCfunc)
     
    129120  const char* class_name;
    130121  const char* method_name;
    131   struct RProc* m;
     122  mrb_method_t m;
    132123  struct RClass* sc;
    133124  const char* sn;
     
    136127  mrb_bool is_defined;
    137128
    138   method_name = mrb_sym2name(mrb, method_sym);
     129  method_name = mrb_sym_name(mrb, method_sym);
    139130
    140131  method_p = &bp->point.methodpoint;
    141132  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);
    143134    if (class_name == NULL) {
    144135      if (method_p->class_name == NULL) {
     
    148139    else if (method_p->class_name != NULL) {
    149140      m = mrb_method_search_vm(mrb, &class_obj, method_sym);
    150       if (m == NULL) {
     141      if (MRB_METHOD_UNDEF_P(m)) {
    151142        return MRB_DEBUG_OK;
    152143      }
    153       if (MRB_PROC_CFUNC_P(m)) {
     144      if (MRB_METHOD_CFUNC_P(m)) {
    154145        *isCfunc = TRUE;
    155146      }
     
    163154      ssym = mrb_symbol(mrb_check_intern_cstr(mrb, method_p->method_name));
    164155      m = mrb_method_search_vm(mrb, &sc, ssym);
    165       if (m == NULL) {
     156      if (MRB_METHOD_UNDEF_P(m)) {
    166157        return MRB_DEBUG_OK;
    167158      }
    168159
    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);
    171162      if (strcmp(sn, class_name) == 0) {
    172163        return bp->bpno;
     
    197188
    198189  /* 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);
    200191  if (result == 0) {
    201192    return MRB_DEBUG_BREAK_INVALID_FILE;
     
    205196  }
    206197
    207   set_file = mrb_malloc(mrb, strlen(file) + 1);
     198  set_file = (char*)mrb_malloc(mrb, strlen(file) + 1);
    208199
    209200  index = dbg->bpnum;
     
    242233
    243234  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);
    245236    strncpy(set_class, class_name, strlen(class_name) + 1);
    246237  }
     
    249240  }
    250241
    251   set_method = mrb_malloc(mrb, strlen(method_name) + 1);
     242  set_method = (char*)mrb_malloc(mrb, strlen(method_name) + 1);
    252243
    253244  strncpy(set_method, method_name, strlen(method_name) + 1);
     
    438429
    439430static mrb_bool
    440 check_start_pc_for_line(mrb_irep *irep, mrb_code *pc, uint16_t line)
     431check_start_pc_for_line(mrb_state *mrb, mrb_irep *irep, const mrb_code *pc, uint16_t line)
    441432{
    442433  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)) {
    444435      return FALSE;
    445436    }
     
    459450  }
    460451
    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)) {
    462453    return MRB_DEBUG_OK;
    463454  }
     
    515506  return 0;
    516507}
    517 
    518 
Note: See TracChangeset for help on using the changeset viewer.