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

mrubyを2.1.1に更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/prototool/src/cmdbreak.c

    r321 r439  
    44*/
    55
    6 #include <stdlib.h>
     6#include <ctype.h>
    77#include <string.h>
    8 
    9 #include "mruby.h"
    10 #include "mruby/dump.h"
    11 #include "mruby/debug.h"
    12 #include "mruby/string.h"
     8#include <mruby.h>
     9#include <mruby/dump.h>
     10#include <mruby/debug.h>
     11#include <mruby/string.h>
    1312#include "mrdb.h"
    1413#include "mrdberror.h"
     
    4443#define BPNO_LETTER_NUM 9
    4544
    46 typedef int32_t(*all_command_func)(mrb_state *, mrb_debug_context *);
    47 typedef int32_t(*select_command_func)(mrb_state *, mrb_debug_context *, uint32_t);
     45typedef int32_t (*all_command_func)(mrb_state *, mrb_debug_context *);
     46typedef int32_t (*select_command_func)(mrb_state *, mrb_debug_context *, uint32_t);
    4847
    4948static void
    5049print_api_common_error(int32_t error)
    5150{
    52         switch (error) {
    53         case MRB_DEBUG_INVALID_ARGUMENT:
    54                 puts(BREAK_ERR_MSG_INVALIDARG);
    55                 break;
    56         default:
    57                 break;
    58         }
     51  switch(error) {
     52    case MRB_DEBUG_INVALID_ARGUMENT:
     53      puts(BREAK_ERR_MSG_INVALIDARG);
     54      break;
     55    default:
     56      break;
     57  }
    5958}
    6059
     
    6968parse_breakpoint_no(char* args)
    7069{
    71         char* ps = args;
    72         uint32_t l;
    73 
    74         if ((*ps == '0') || (strlen(ps) >= BPNO_LETTER_NUM)) {
    75                 return 0;
    76         }
    77 
    78         while (!(ISBLANK(*ps) || ISCNTRL(*ps))) {
    79                 if (!ISDIGIT(*ps)) {
    80                         return 0;
    81                 }
    82                 ps++;
    83         }
    84 
    85         STRTOUL(l, args);
    86         return l;
     70  char* ps = args;
     71  uint32_t l;
     72
     73  if ((*ps == '0')||(strlen(ps) >= BPNO_LETTER_NUM)) {
     74    return 0;
     75  }
     76
     77  while (!(ISBLANK(*ps)||ISCNTRL(*ps))) {
     78    if (!ISDIGIT(*ps)) {
     79      return 0;
     80    }
     81    ps++;
     82  }
     83
     84  STRTOUL(l, args);
     85  return l;
    8786}
    8887
     
    9089exe_set_command_all(mrb_state *mrb, mrdb_state *mrdb, all_command_func func)
    9190{
    92         int32_t ret = MRB_DEBUG_OK;
    93 
    94         if (mrdb->wcnt == 1) {
    95                 ret = func(mrb, mrdb->dbg);
    96                 print_api_common_error(ret);
    97                 return TRUE;
    98         }
    99         return FALSE;
     91  int32_t ret = MRB_DEBUG_OK;
     92
     93  if (mrdb->wcnt == 1) {
     94    ret = func(mrb, mrdb->dbg);
     95    print_api_common_error(ret);
     96    return TRUE;
     97  }
     98  return FALSE;
    10099}
    101100
     
    103102exe_set_command_select(mrb_state *mrb, mrdb_state *mrdb, select_command_func func)
    104103{
    105         char* ps;
    106         int32_t ret = MRB_DEBUG_OK;
    107         int32_t bpno = 0;
    108         int32_t i;
    109 
    110         for (i = 1; i < mrdb->wcnt; i++) {
    111                 ps = mrdb->words[i];
    112                 bpno = parse_breakpoint_no(ps);
    113                 if (bpno == 0) {
    114                         printf(BREAK_ERR_MSG_INVALIDBPNO, ps);
    115                         break;
    116                 }
    117                 ret = func(mrb, mrdb->dbg, (uint32_t)bpno);
    118                 if (ret == MRB_DEBUG_BREAK_INVALID_NO) {
    119                         printf(BREAK_ERR_MSG_NOBPNO, bpno);
    120                 }
    121                 else if (ret != MRB_DEBUG_OK) {
    122                         print_api_common_error(ret);
    123                 }
    124         }
     104  char* ps;
     105  int32_t ret = MRB_DEBUG_OK;
     106  int32_t bpno = 0;
     107  int32_t i;
     108
     109  for(i=1; i<mrdb->wcnt; i++) {
     110    ps = mrdb->words[i];
     111    bpno = parse_breakpoint_no(ps);
     112    if (bpno == 0) {
     113      printf(BREAK_ERR_MSG_INVALIDBPNO, ps);
     114      break;
     115    }
     116    ret = func(mrb, mrdb->dbg, (uint32_t)bpno);
     117    if (ret == MRB_DEBUG_BREAK_INVALID_NO) {
     118      printf(BREAK_ERR_MSG_NOBPNO, bpno);
     119    }
     120    else if (ret != MRB_DEBUG_OK) {
     121      print_api_common_error(ret);
     122    }
     123  }
    125124}
    126125
     
    128127check_bptype(char* args)
    129128{
    130         char* ps = args;
    131 
    132         if (ISBLANK(*ps) || ISCNTRL(*ps)) {
    133                 puts(BREAK_ERR_MSG_BLANK);
    134                 return MRB_DEBUG_BPTYPE_NONE;
    135         }
    136 
    137         if (!ISDIGIT(*ps)) {
    138                 return MRB_DEBUG_BPTYPE_METHOD;
    139         }
    140 
    141         while (!(ISBLANK(*ps) || ISCNTRL(*ps))) {
    142                 if (!ISDIGIT(*ps)) {
    143                         printf(BREAK_ERR_MSG_INVALIDSTR, args);
    144                         return MRB_DEBUG_BPTYPE_NONE;
    145                 }
    146                 ps++;
    147         }
    148 
    149         if ((*args == '0') || (strlen(args) >= LINENO_MAX_DIGIT)) {
    150                 puts(BREAK_ERR_MSG_RANGEOVER);
    151                 return MRB_DEBUG_BPTYPE_NONE;
    152         }
    153 
    154         return MRB_DEBUG_BPTYPE_LINE;
     129  char* ps = args;
     130
     131  if (ISBLANK(*ps)||ISCNTRL(*ps)) {
     132    puts(BREAK_ERR_MSG_BLANK);
     133    return MRB_DEBUG_BPTYPE_NONE;
     134  }
     135
     136  if (!ISDIGIT(*ps)) {
     137    return MRB_DEBUG_BPTYPE_METHOD;
     138  }
     139
     140  while (!(ISBLANK(*ps)||ISCNTRL(*ps))) {
     141    if (!ISDIGIT(*ps)) {
     142      printf(BREAK_ERR_MSG_INVALIDSTR, args);
     143      return MRB_DEBUG_BPTYPE_NONE;
     144    }
     145    ps++;
     146  }
     147
     148  if ((*args == '0')||(strlen(args) >= LINENO_MAX_DIGIT)) {
     149    puts(BREAK_ERR_MSG_RANGEOVER);
     150    return MRB_DEBUG_BPTYPE_NONE;
     151  }
     152
     153  return MRB_DEBUG_BPTYPE_LINE;
    155154}
    156155
     
    158157print_breakpoint(mrb_debug_breakpoint *bp)
    159158{
    160         const char* enable_letter[] = { BREAK_INFO_MSG_DISABLE, BREAK_INFO_MSG_ENABLE };
    161 
    162         if (bp->type == MRB_DEBUG_BPTYPE_LINE) {
    163                 printf(BREAK_INFO_MSG_LINEBREAK,
    164                         bp->bpno, enable_letter[bp->enable], bp->point.linepoint.file, bp->point.linepoint.lineno);
    165         }
    166         else {
    167                 if (bp->point.methodpoint.class_name == NULL) {
    168                         printf(BREAK_INFO_MSG_METHODBREAK_NOCLASS,
    169                                 bp->bpno, enable_letter[bp->enable], bp->point.methodpoint.method_name);
    170                 }
    171                 else {
    172                         printf(BREAK_INFO_MSG_METHODBREAK,
    173                                 bp->bpno, enable_letter[bp->enable], bp->point.methodpoint.class_name, bp->point.methodpoint.method_name);
    174                 }
    175         }
     159  const char* enable_letter[] = {BREAK_INFO_MSG_DISABLE, BREAK_INFO_MSG_ENABLE};
     160
     161  if (bp->type == MRB_DEBUG_BPTYPE_LINE) {
     162    printf(BREAK_INFO_MSG_LINEBREAK,
     163      bp->bpno, enable_letter[bp->enable], bp->point.linepoint.file, bp->point.linepoint.lineno);
     164  }
     165  else {
     166    if (bp->point.methodpoint.class_name == NULL) {
     167      printf(BREAK_INFO_MSG_METHODBREAK_NOCLASS,
     168        bp->bpno, enable_letter[bp->enable], bp->point.methodpoint.method_name);
     169    }
     170    else {
     171      printf(BREAK_INFO_MSG_METHODBREAK,
     172        bp->bpno, enable_letter[bp->enable], bp->point.methodpoint.class_name, bp->point.methodpoint.method_name);
     173    }
     174  }
    176175}
    177176
     
    179178info_break_all(mrb_state *mrb, mrdb_state *mrdb)
    180179{
    181         int32_t bpnum = 0;
    182         int32_t i = 0;
    183         int32_t ret = MRB_DEBUG_OK;
    184         mrb_debug_breakpoint *bp_list;
    185 
    186         bpnum = mrb_debug_get_breaknum(mrb, mrdb->dbg);
    187         if (bpnum < 0) {
    188                 print_api_common_error(bpnum);
    189                 return;
    190         }
    191         else if (bpnum == 0) {
    192                 puts(BREAK_ERR_MSG_NOBPNO_INFOALL);
    193                 return;
    194         }
    195         bp_list = (mrb_debug_breakpoint*)mrb_malloc(mrb, bpnum * sizeof(mrb_debug_breakpoint));
    196 
    197         ret = mrb_debug_get_break_all(mrb, mrdb->dbg, (uint32_t)bpnum, bp_list);
    198         if (ret < 0) {
    199                 print_api_common_error(ret);
    200                 return;
    201         }
    202         puts(BREAK_INFO_MSG_HEADER);
    203         for (i = 0; i < bpnum; i++) {
    204                 print_breakpoint(&bp_list[i]);
    205         }
    206 
    207         mrb_free(mrb, bp_list);
     180  int32_t bpnum = 0;
     181  int32_t i = 0;
     182  int32_t ret = MRB_DEBUG_OK;
     183  mrb_debug_breakpoint *bp_list;
     184
     185  bpnum = mrb_debug_get_breaknum(mrb, mrdb->dbg);
     186  if (bpnum < 0) {
     187    print_api_common_error(bpnum);
     188    return;
     189  }
     190  else if (bpnum == 0) {
     191    puts(BREAK_ERR_MSG_NOBPNO_INFOALL);
     192    return;
     193  }
     194  bp_list = (mrb_debug_breakpoint*)mrb_malloc(mrb, bpnum * sizeof(mrb_debug_breakpoint));
     195
     196  ret = mrb_debug_get_break_all(mrb, mrdb->dbg, (uint32_t)bpnum, bp_list);
     197  if (ret < 0) {
     198    print_api_common_error(ret);
     199    return;
     200  }
     201  puts(BREAK_INFO_MSG_HEADER);
     202  for(i = 0 ; i < bpnum ; i++) {
     203    print_breakpoint(&bp_list[i]);
     204  }
     205
     206  mrb_free(mrb, bp_list);
    208207}
    209208
     
    211210info_break_select(mrb_state *mrb, mrdb_state *mrdb)
    212211{
    213         int32_t ret = MRB_DEBUG_OK;
    214         int32_t bpno = 0;
    215         char* ps = mrdb->command;
    216         mrb_debug_breakpoint bp;
    217         mrb_bool isFirst = TRUE;
    218         int32_t i;
    219 
    220         for (i = 2; i < mrdb->wcnt; i++) {
    221                 ps = mrdb->words[i];
    222                 bpno = parse_breakpoint_no(ps);
    223                 if (bpno == 0) {
    224                         puts(BREAK_ERR_MSG_INVALIDBPNO_INFO);
    225                         break;
    226                 }
    227 
    228                 ret = mrb_debug_get_break(mrb, mrdb->dbg, bpno, &bp);
    229                 if (ret == MRB_DEBUG_BREAK_INVALID_NO) {
    230                         printf(BREAK_ERR_MSG_NOBPNO_INFO, bpno);
    231                         break;
    232                 }
    233                 else if (ret != MRB_DEBUG_OK) {
    234                         print_api_common_error(ret);
    235                         break;
    236                 }
    237                 else if (isFirst == TRUE) {
    238                         isFirst = FALSE;
    239                         puts(BREAK_INFO_MSG_HEADER);
    240                 }
    241                 print_breakpoint(&bp);
    242         }
     212  int32_t ret = MRB_DEBUG_OK;
     213  int32_t bpno = 0;
     214  char* ps = mrdb->command;
     215  mrb_debug_breakpoint bp;
     216  mrb_bool isFirst = TRUE;
     217  int32_t i;
     218
     219  for(i=2; i<mrdb->wcnt; i++) {
     220    ps = mrdb->words[i];
     221    bpno = parse_breakpoint_no(ps);
     222    if (bpno == 0) {
     223      puts(BREAK_ERR_MSG_INVALIDBPNO_INFO);
     224      break;
     225    }
     226
     227    ret = mrb_debug_get_break(mrb, mrdb->dbg, bpno, &bp);
     228    if (ret == MRB_DEBUG_BREAK_INVALID_NO) {
     229      printf(BREAK_ERR_MSG_NOBPNO_INFO, bpno);
     230      break;
     231    }
     232    else if (ret != MRB_DEBUG_OK) {
     233      print_api_common_error(ret);
     234      break;
     235    }
     236    else if (isFirst == TRUE) {
     237      isFirst = FALSE;
     238      puts(BREAK_INFO_MSG_HEADER);
     239    }
     240    print_breakpoint(&bp);
     241  }
    243242}
    244243
    245244mrb_debug_bptype
    246 parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **cname, char **method)
    247 {
    248         mrb_debug_context *dbg = mrdb->dbg;
    249         char *args;
    250         char *body;
    251         mrb_debug_bptype type;
    252         uint32_t l;
    253 
    254         if (mrdb->wcnt <= 1) {
    255                 puts(BREAK_ERR_MSG_BLANK);
    256                 return MRB_DEBUG_BPTYPE_NONE;
    257         }
    258 
    259         args = mrdb->words[1];
    260         if ((body = strrchr(args, ':')) == NULL) {
    261                 body = args;
    262                 type = check_bptype(body);
    263         }
    264         else {
    265                 if (body == args) {
    266                         printf(BREAK_ERR_MSG_INVALIDSTR, args);
    267                         return MRB_DEBUG_BPTYPE_NONE;
    268                 }
    269                 *body = '\0';
    270                 type = check_bptype(++body);
    271         }
    272 
    273         switch (type) {
    274         case MRB_DEBUG_BPTYPE_LINE:
    275                 STRTOUL(l, body);
    276                 if (l <= 65535) {
    277                         *line = l;
    278                         *file = (body == args) ? mrb_debug_get_filename(dbg->irep, (uint32_t)(dbg->pc - dbg->irep->iseq)) : args;
    279                 }
    280                 else {
    281                         puts(BREAK_ERR_MSG_RANGEOVER);
    282                         type = MRB_DEBUG_BPTYPE_NONE;
    283                 }
    284                 break;
    285         case MRB_DEBUG_BPTYPE_METHOD:
    286                 if (body == args) {
    287                         /* method only */
    288                         if (ISUPPER(*body) || ISLOWER(*body) || (*body == '_')) {
    289                                 *method = body;
    290                                 *cname = NULL;
    291                         }
    292                         else {
    293                                 printf(BREAK_ERR_MSG_INVALIDMETHOD, args);
    294                                 type = MRB_DEBUG_BPTYPE_NONE;
    295                         }
    296                 }
    297                 else {
    298                         if (ISUPPER(*args)) {
    299                                 switch (*body) {
    300                                 case '@': case '$': case '?': case '.': case ',': case ':':
    301                                 case ';': case '#': case '\\': case '\'': case '\"':
    302                                         printf(BREAK_ERR_MSG_INVALIDMETHOD, body);
    303                                         type = MRB_DEBUG_BPTYPE_NONE;
    304                                         break;
    305                                 default:
    306                                         *method = body;
    307                                         *cname = args;
    308                                         break;
    309                                 }
    310                         }
    311                         else {
    312                                 printf(BREAK_ERR_MSG_INVALIDCLASS, args);
    313                                 type = MRB_DEBUG_BPTYPE_NONE;
    314                         }
    315                 }
    316                 break;
    317         case MRB_DEBUG_BPTYPE_NONE:
    318         default:
    319                 break;
    320         }
    321 
    322         return type;
     245parse_breakcommand(mrb_state *mrb, mrdb_state *mrdb, const char **file, uint32_t *line, char **cname, char **method)
     246{
     247  mrb_debug_context *dbg = mrdb->dbg;
     248  char *args;
     249  char *body;
     250  mrb_debug_bptype type;
     251  uint32_t l;
     252
     253  if (mrdb->wcnt <= 1) {
     254    puts(BREAK_ERR_MSG_BLANK);
     255    return MRB_DEBUG_BPTYPE_NONE;
     256  }
     257
     258  args = mrdb->words[1];
     259  if ((body = strrchr(args, ':')) == NULL) {
     260    body = args;
     261    type = check_bptype(body);
     262  }
     263  else {
     264    if (body == args) {
     265      printf(BREAK_ERR_MSG_INVALIDSTR, args);
     266      return MRB_DEBUG_BPTYPE_NONE;
     267    }
     268    *body = '\0';
     269    type = check_bptype(++body);
     270  }
     271
     272  switch(type) {
     273    case MRB_DEBUG_BPTYPE_LINE:
     274      STRTOUL(l, body);
     275      if (l <= 65535) {
     276        *line = l;
     277        *file = (body == args)? mrb_debug_get_filename(mrb, dbg->irep, dbg->pc - dbg->irep->iseq): args;
     278      }
     279      else {
     280        puts(BREAK_ERR_MSG_RANGEOVER);
     281        type = MRB_DEBUG_BPTYPE_NONE;
     282      }
     283      break;
     284    case MRB_DEBUG_BPTYPE_METHOD:
     285      if (body == args) {
     286        /* method only */
     287        if (ISUPPER(*body)||ISLOWER(*body)||(*body == '_')) {
     288          *method = body;
     289          *cname = NULL;
     290        }
     291        else {
     292          printf(BREAK_ERR_MSG_INVALIDMETHOD, args);
     293          type = MRB_DEBUG_BPTYPE_NONE;
     294        }
     295      }
     296      else {
     297        if (ISUPPER(*args)) {
     298          switch(*body) {
     299            case '@': case '$': case '?': case '.': case ',': case ':':
     300            case ';': case '#': case '\\': case '\'': case '\"':
     301            printf(BREAK_ERR_MSG_INVALIDMETHOD, body);
     302            type = MRB_DEBUG_BPTYPE_NONE;
     303            break;
     304          default:
     305            *method = body;
     306            *cname = args;
     307            break;
     308          }
     309        }
     310        else {
     311          printf(BREAK_ERR_MSG_INVALIDCLASS, args);
     312          type = MRB_DEBUG_BPTYPE_NONE;
     313        }
     314      }
     315      break;
     316    case MRB_DEBUG_BPTYPE_NONE:
     317    default:
     318      break;
     319  }
     320
     321  return type;
    323322}
    324323
     
    326325dbgcmd_break(mrb_state *mrb, mrdb_state *mrdb)
    327326{
    328         mrb_debug_bptype type;
    329         mrb_debug_context *dbg = mrdb->dbg;
    330         const char *file = NULL;
    331         uint32_t line = 0;
    332         char *cname = NULL;
    333         char *method = NULL;
    334         int32_t ret;
    335 
    336         type = parse_breakcommand(mrdb, &file, &line, &cname, &method);
    337         switch (type) {
    338         case MRB_DEBUG_BPTYPE_LINE:
    339                 ret = mrb_debug_set_break_line(mrb, dbg, file, line);
    340                 break;
    341         case MRB_DEBUG_BPTYPE_METHOD:
    342                 ret = mrb_debug_set_break_method(mrb, dbg, cname, method);
    343                 break;
    344         case MRB_DEBUG_BPTYPE_NONE:
    345         default:
    346                 return DBGST_PROMPT;
    347         }
    348 
    349         if (ret >= 0) {
    350                 if (type == MRB_DEBUG_BPTYPE_LINE) {
    351                         printf(BREAK_SET_MSG_LINE, ret, file, line);
    352                 }
    353                 else if ((type == MRB_DEBUG_BPTYPE_METHOD) && (cname == NULL)) {
    354                         printf(BREAK_SET_MSG_METHOD, ret, method);
    355                 }
    356                 else {
    357                         printf(BREAK_SET_MSG_CLASS_METHOD, ret, cname, method);
    358                 }
    359         }
    360         else {
    361                 switch (ret) {
    362                 case MRB_DEBUG_BREAK_INVALID_LINENO:
    363                         printf(BREAK_ERR_MSG_INVALIDLINENO, line, file);
    364                         break;
    365                 case MRB_DEBUG_BREAK_INVALID_FILE:
    366                         printf(BREAK_ERR_MSG_INVALIDFILE, file);
    367                         break;
    368                 case MRB_DEBUG_BREAK_NUM_OVER:
    369                         puts(BREAK_ERR_MSG_NUMOVER);
    370                         break;
    371                 case MRB_DEBUG_BREAK_NO_OVER:
    372                         puts(BREAK_ERR_MSG_NOOVER);
    373                         break;
    374                 case MRB_DEBUG_INVALID_ARGUMENT:
    375                         puts(BREAK_ERR_MSG_INVALIDARG);
    376                         break;
    377                 case MRB_DEBUG_NOBUF:
    378                         puts("T.B.D.");
    379                         break;
    380                 default:
    381                         break;
    382                 }
    383         }
    384 
    385         return DBGST_PROMPT;
     327  mrb_debug_bptype type;
     328  mrb_debug_context *dbg = mrdb->dbg;
     329  const char *file = NULL;
     330  uint32_t line = 0;
     331  char *cname = NULL;
     332  char *method = NULL;
     333  int32_t ret;
     334
     335  type = parse_breakcommand(mrb, mrdb, &file, &line, &cname, &method);
     336  switch (type) {
     337    case MRB_DEBUG_BPTYPE_LINE:
     338      ret = mrb_debug_set_break_line(mrb, dbg, file, line);
     339      break;
     340    case MRB_DEBUG_BPTYPE_METHOD:
     341      ret = mrb_debug_set_break_method(mrb, dbg, cname, method);
     342      break;
     343    case MRB_DEBUG_BPTYPE_NONE:
     344    default:
     345      return DBGST_PROMPT;
     346  }
     347
     348  if (ret >= 0) {
     349    if (type == MRB_DEBUG_BPTYPE_LINE) {
     350      printf(BREAK_SET_MSG_LINE, ret, file, line);
     351    }
     352    else if ((type == MRB_DEBUG_BPTYPE_METHOD)&&(cname == NULL)) {
     353      printf(BREAK_SET_MSG_METHOD, ret, method);
     354    }
     355    else {
     356      printf(BREAK_SET_MSG_CLASS_METHOD, ret, cname, method);
     357    }
     358  }
     359  else {
     360    switch (ret) {
     361      case MRB_DEBUG_BREAK_INVALID_LINENO:
     362        printf(BREAK_ERR_MSG_INVALIDLINENO, line, file);
     363        break;
     364      case MRB_DEBUG_BREAK_INVALID_FILE:
     365        printf(BREAK_ERR_MSG_INVALIDFILE, file);
     366        break;
     367      case MRB_DEBUG_BREAK_NUM_OVER:
     368        puts(BREAK_ERR_MSG_NUMOVER);
     369        break;
     370      case MRB_DEBUG_BREAK_NO_OVER:
     371        puts(BREAK_ERR_MSG_NOOVER);
     372        break;
     373      case MRB_DEBUG_INVALID_ARGUMENT:
     374        puts(BREAK_ERR_MSG_INVALIDARG);
     375        break;
     376      case MRB_DEBUG_NOBUF:
     377        puts("T.B.D.");
     378        break;
     379      default:
     380        break;
     381    }
     382  }
     383
     384  return DBGST_PROMPT;
    386385}
    387386
     
    389388dbgcmd_info_break(mrb_state *mrb, mrdb_state *mrdb)
    390389{
    391         if (mrdb->wcnt == 2) {
    392                 info_break_all(mrb, mrdb);
    393         }
    394         else {
    395                 info_break_select(mrb, mrdb);
    396         }
    397 
    398         return DBGST_PROMPT;
     390  if (mrdb->wcnt == 2) {
     391    info_break_all(mrb, mrdb);
     392  }
     393  else {
     394    info_break_select(mrb, mrdb);
     395  }
     396
     397  return DBGST_PROMPT;
    399398}
    400399
     
    402401dbgcmd_delete(mrb_state *mrb, mrdb_state *mrdb)
    403402{
    404         mrb_bool ret = FALSE;
    405 
    406         ret = exe_set_command_all(mrb, mrdb, mrb_debug_delete_break_all);
    407         if (ret != TRUE) {
    408                 exe_set_command_select(mrb, mrdb, mrb_debug_delete_break);
    409         }
    410 
    411         return DBGST_PROMPT;
     403  mrb_bool ret = FALSE;
     404
     405  ret = exe_set_command_all(mrb, mrdb, mrb_debug_delete_break_all);
     406  if (ret != TRUE) {
     407    exe_set_command_select(mrb, mrdb, mrb_debug_delete_break);
     408  }
     409
     410  return DBGST_PROMPT;
    412411}
    413412
     
    415414dbgcmd_enable(mrb_state *mrb, mrdb_state *mrdb)
    416415{
    417         mrb_bool ret = FALSE;
    418 
    419         ret = exe_set_command_all(mrb, mrdb, mrb_debug_enable_break_all);
    420         if (ret != TRUE) {
    421                 exe_set_command_select(mrb, mrdb, mrb_debug_enable_break);
    422         }
    423 
    424         return DBGST_PROMPT;
     416  mrb_bool ret = FALSE;
     417
     418  ret = exe_set_command_all(mrb, mrdb, mrb_debug_enable_break_all);
     419  if (ret != TRUE) {
     420    exe_set_command_select(mrb, mrdb, mrb_debug_enable_break);
     421  }
     422
     423  return DBGST_PROMPT;
    425424}
    426425
     
    428427dbgcmd_disable(mrb_state *mrb, mrdb_state *mrdb)
    429428{
    430         mrb_bool ret = FALSE;
    431 
    432         ret = exe_set_command_all(mrb, mrdb, mrb_debug_disable_break_all);
    433         if (ret != TRUE) {
    434                 exe_set_command_select(mrb, mrdb, mrb_debug_disable_break);
    435         }
    436         return DBGST_PROMPT;
    437 }
     429  mrb_bool ret = FALSE;
     430
     431  ret = exe_set_command_all(mrb, mrdb, mrb_debug_disable_break_all);
     432  if (ret != TRUE) {
     433    exe_set_command_select(mrb, mrdb, mrb_debug_disable_break);
     434  }
     435  return DBGST_PROMPT;
     436}
Note: See TracChangeset for help on using the changeset viewer.