@@ -70,12 +70,12 @@ parse_breakpoint_no(char* args)
70
70
char * ps = args ;
71
71
uint32_t l ;
72
72
73
- if ((* ps == '0' )|| (strlen (ps ) >= BPNO_LETTER_NUM )) {
73
+ if ((* ps == '0' )|| (strlen (ps ) >= BPNO_LETTER_NUM )) {
74
74
return 0 ;
75
75
}
76
76
77
- while ( !(ISBLANK (* ps )|| ISCNTRL (* ps )) ) {
78
- if (!ISDIGIT (* ps )) {
77
+ while ( !(ISBLANK (* ps )|| ISCNTRL (* ps ))) {
78
+ if (!ISDIGIT (* ps )) {
79
79
return 0 ;
80
80
}
81
81
ps ++ ;
@@ -90,7 +90,7 @@ exe_set_command_all(mrb_state *mrb, mrdb_state *mrdb, all_command_func func)
90
90
{
91
91
int32_t ret = MRB_DEBUG_OK ;
92
92
93
- if (mrdb -> wcnt == 1 ) {
93
+ if (mrdb -> wcnt == 1 ) {
94
94
ret = func (mrb , mrdb -> dbg );
95
95
print_api_common_error (ret );
96
96
return TRUE;
@@ -109,15 +109,15 @@ exe_set_command_select(mrb_state *mrb, mrdb_state *mrdb, select_command_func fun
109
109
for (i = 1 ; i < mrdb -> wcnt ; i ++ ) {
110
110
ps = mrdb -> words [i ];
111
111
bpno = parse_breakpoint_no (ps );
112
- if (bpno == 0 ) {
112
+ if (bpno == 0 ) {
113
113
printf (BREAK_ERR_MSG_INVALIDBPNO , ps );
114
114
break ;
115
115
}
116
116
ret = func (mrb , mrdb -> dbg , (uint32_t )bpno );
117
- if (ret == MRB_DEBUG_BREAK_INVALID_NO ) {
117
+ if (ret == MRB_DEBUG_BREAK_INVALID_NO ) {
118
118
printf (BREAK_ERR_MSG_NOBPNO , bpno );
119
119
}
120
- else if (ret != MRB_DEBUG_OK ) {
120
+ else if (ret != MRB_DEBUG_OK ) {
121
121
print_api_common_error (ret );
122
122
}
123
123
}
@@ -128,24 +128,24 @@ check_bptype(char* args)
128
128
{
129
129
char * ps = args ;
130
130
131
- if (ISBLANK (* ps )|| ISCNTRL (* ps )) {
131
+ if (ISBLANK (* ps )|| ISCNTRL (* ps )) {
132
132
puts (BREAK_ERR_MSG_BLANK );
133
133
return MRB_DEBUG_BPTYPE_NONE ;
134
134
}
135
135
136
- if (!ISDIGIT (* ps )) {
136
+ if (!ISDIGIT (* ps )) {
137
137
return MRB_DEBUG_BPTYPE_METHOD ;
138
138
}
139
139
140
- while ( !(ISBLANK (* ps )|| ISCNTRL (* ps )) ) {
141
- if (!ISDIGIT (* ps )) {
140
+ while ( !(ISBLANK (* ps )|| ISCNTRL (* ps ))) {
141
+ if (!ISDIGIT (* ps )) {
142
142
printf (BREAK_ERR_MSG_INVALIDSTR , args );
143
143
return MRB_DEBUG_BPTYPE_NONE ;
144
144
}
145
145
ps ++ ;
146
146
}
147
147
148
- if ((* args == '0' )|| (strlen (args ) >= LINENO_MAX_DIGIT )) {
148
+ if ((* args == '0' )|| (strlen (args ) >= LINENO_MAX_DIGIT )) {
149
149
puts (BREAK_ERR_MSG_RANGEOVER );
150
150
return MRB_DEBUG_BPTYPE_NONE ;
151
151
}
@@ -158,12 +158,12 @@ print_breakpoint(mrb_debug_breakpoint *bp)
158
158
{
159
159
const char * enable_letter [] = {BREAK_INFO_MSG_DISABLE , BREAK_INFO_MSG_ENABLE };
160
160
161
- if (bp -> type == MRB_DEBUG_BPTYPE_LINE ) {
161
+ if (bp -> type == MRB_DEBUG_BPTYPE_LINE ) {
162
162
printf (BREAK_INFO_MSG_LINEBREAK ,
163
163
bp -> bpno , enable_letter [bp -> enable ], bp -> point .linepoint .file , bp -> point .linepoint .lineno );
164
164
}
165
165
else {
166
- if (bp -> point .methodpoint .class_name == NULL ) {
166
+ if (bp -> point .methodpoint .class_name == NULL ) {
167
167
printf (BREAK_INFO_MSG_METHODBREAK_NOCLASS ,
168
168
bp -> bpno , enable_letter [bp -> enable ], bp -> point .methodpoint .method_name );
169
169
}
@@ -183,18 +183,18 @@ info_break_all(mrb_state *mrb, mrdb_state *mrdb)
183
183
mrb_debug_breakpoint * bp_list ;
184
184
185
185
bpnum = mrb_debug_get_breaknum (mrb , mrdb -> dbg );
186
- if (bpnum < 0 ) {
186
+ if (bpnum < 0 ) {
187
187
print_api_common_error (bpnum );
188
188
return ;
189
189
}
190
- else if (bpnum == 0 ) {
190
+ else if (bpnum == 0 ) {
191
191
puts (BREAK_ERR_MSG_NOBPNO_INFOALL );
192
192
return ;
193
193
}
194
194
bp_list = (mrb_debug_breakpoint * )mrb_malloc (mrb , bpnum * sizeof (mrb_debug_breakpoint ));
195
195
196
196
ret = mrb_debug_get_break_all (mrb , mrdb -> dbg , (uint32_t )bpnum , bp_list );
197
- if (ret < 0 ) {
197
+ if (ret < 0 ) {
198
198
print_api_common_error (ret );
199
199
return ;
200
200
}
@@ -219,21 +219,21 @@ info_break_select(mrb_state *mrb, mrdb_state *mrdb)
219
219
for (i = 2 ; i < mrdb -> wcnt ; i ++ ) {
220
220
ps = mrdb -> words [i ];
221
221
bpno = parse_breakpoint_no (ps );
222
- if (bpno == 0 ) {
222
+ if (bpno == 0 ) {
223
223
puts (BREAK_ERR_MSG_INVALIDBPNO_INFO );
224
224
break ;
225
225
}
226
226
227
227
ret = mrb_debug_get_break (mrb , mrdb -> dbg , bpno , & bp );
228
- if (ret == MRB_DEBUG_BREAK_INVALID_NO ) {
228
+ if (ret == MRB_DEBUG_BREAK_INVALID_NO ) {
229
229
printf (BREAK_ERR_MSG_NOBPNO_INFO , bpno );
230
230
break ;
231
231
}
232
- else if (ret != MRB_DEBUG_OK ) {
232
+ else if (ret != MRB_DEBUG_OK ) {
233
233
print_api_common_error (ret );
234
234
break ;
235
235
}
236
- else if (isFirst == TRUE) {
236
+ else if (isFirst == TRUE) {
237
237
isFirst = FALSE;
238
238
puts (BREAK_INFO_MSG_HEADER );
239
239
}
@@ -250,17 +250,17 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
250
250
mrb_debug_bptype type ;
251
251
uint32_t l ;
252
252
253
- if (mrdb -> wcnt <= 1 ) {
253
+ if (mrdb -> wcnt <= 1 ) {
254
254
puts (BREAK_ERR_MSG_BLANK );
255
255
return MRB_DEBUG_BPTYPE_NONE ;
256
256
}
257
257
258
258
args = mrdb -> words [1 ];
259
- if ((body = strrchr (args , ':' )) == NULL ) {
259
+ if ((body = strrchr (args , ':' )) == NULL ) {
260
260
body = args ;
261
261
type = check_bptype (body );
262
262
} else {
263
- if (body == args ) {
263
+ if (body == args ) {
264
264
printf (BREAK_ERR_MSG_INVALIDSTR , args );
265
265
return MRB_DEBUG_BPTYPE_NONE ;
266
266
}
@@ -271,7 +271,7 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
271
271
switch (type ) {
272
272
case MRB_DEBUG_BPTYPE_LINE :
273
273
STRTOUL (l , body );
274
- if ( l <= 65535 ) {
274
+ if ( l <= 65535 ) {
275
275
* line = l ;
276
276
* file = (body == args )? mrb_debug_get_filename (dbg -> irep , (uint32_t )(dbg -> pc - dbg -> irep -> iseq )): args ;
277
277
} else {
@@ -280,17 +280,17 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
280
280
}
281
281
break ;
282
282
case MRB_DEBUG_BPTYPE_METHOD :
283
- if (body == args ) {
283
+ if (body == args ) {
284
284
/* method only */
285
- if ( ISUPPER (* body )|| ISLOWER (* body )|| (* body == '_' ) ) {
285
+ if ( ISUPPER (* body )|| ISLOWER (* body )|| (* body == '_' )) {
286
286
* method = body ;
287
287
* cname = NULL ;
288
288
} else {
289
289
printf (BREAK_ERR_MSG_INVALIDMETHOD , args );
290
290
type = MRB_DEBUG_BPTYPE_NONE ;
291
291
}
292
292
} else {
293
- if ( ISUPPER (* args ) ) {
293
+ if ( ISUPPER (* args )) {
294
294
switch (* body ) {
295
295
case '@' : case '$' : case '?' : case '.' : case ',' : case ':' :
296
296
case ';' : case '#' : case '\\' : case '\'' : case '\"' :
@@ -379,7 +379,7 @@ dbgcmd_break(mrb_state *mrb, mrdb_state *mrdb)
379
379
dbgcmd_state
380
380
dbgcmd_info_break (mrb_state * mrb , mrdb_state * mrdb )
381
381
{
382
- if (mrdb -> wcnt == 2 ) {
382
+ if (mrdb -> wcnt == 2 ) {
383
383
info_break_all (mrb , mrdb );
384
384
}
385
385
else {
@@ -395,7 +395,7 @@ dbgcmd_delete(mrb_state *mrb, mrdb_state *mrdb)
395
395
mrb_bool ret = FALSE;
396
396
397
397
ret = exe_set_command_all (mrb , mrdb , mrb_debug_delete_break_all );
398
- if (ret != TRUE) {
398
+ if (ret != TRUE) {
399
399
exe_set_command_select (mrb , mrdb , mrb_debug_delete_break );
400
400
}
401
401
@@ -408,7 +408,7 @@ dbgcmd_enable(mrb_state *mrb, mrdb_state *mrdb)
408
408
mrb_bool ret = FALSE;
409
409
410
410
ret = exe_set_command_all (mrb , mrdb , mrb_debug_enable_break_all );
411
- if (ret != TRUE) {
411
+ if (ret != TRUE) {
412
412
exe_set_command_select (mrb , mrdb , mrb_debug_enable_break );
413
413
}
414
414
@@ -421,7 +421,7 @@ dbgcmd_disable(mrb_state *mrb, mrdb_state *mrdb)
421
421
mrb_bool ret = FALSE;
422
422
423
423
ret = exe_set_command_all (mrb , mrdb , mrb_debug_disable_break_all );
424
- if (ret != TRUE) {
424
+ if (ret != TRUE) {
425
425
exe_set_command_select (mrb , mrdb , mrb_debug_disable_break );
426
426
}
427
427
return DBGST_PROMPT ;
0 commit comments