summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuhei Okazaki <[email protected]>2015-03-31 10:41:59 +0900
committerYuhei Okazaki <[email protected]>2015-03-31 10:52:10 +0900
commit06435f5bc7a2ce354168b20bdd9e2cd62fe3f8e2 (patch)
tree61f34eb13a135d5abc33354e213bf6c7627d770b
parent0573306f510b9503f6baa7e9e1d158205add503d (diff)
downloadmruby-06435f5bc7a2ce354168b20bdd9e2cd62fe3f8e2.tar.gz
mruby-06435f5bc7a2ce354168b20bdd9e2cd62fe3f8e2.zip
fix maximum value of the index when access breakpoints.
-rwxr-xr-xmrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
index 610a5db6f..378c773ea 100755
--- a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
+++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
@@ -333,7 +333,7 @@ mrb_debug_delete_break( mrb_state *mrb, mrb_debug_context *dbg, uint32_t bpno )
free_breakpoint(mrb, &dbg->bp[index]);
for(i = index ; i < dbg->bpnum; i++) {
- if(dbg->bp[i + 1].type == MRB_DEBUG_BPTYPE_NONE) {
+ if((i + 1) == dbg->bpnum) {
memset(&dbg->bp[i], 0, sizeof(mrb_debug_breakpoint));
}
else {
@@ -461,7 +461,7 @@ mrb_debug_check_breakpoint_line( mrb_state *mrb, mrb_debug_context *dbg, const c
}
bp = dbg->bp;
- for(i=0; i<MAX_BREAKPOINT; i++) {
+ for(i=0; i<dbg->bpnum; i++) {
switch (bp->type) {
case MRB_DEBUG_BPTYPE_LINE:
if(bp->enable == TRUE) {
@@ -495,7 +495,7 @@ mrb_debug_check_breakpoint_method( mrb_state *mrb, mrb_debug_context *dbg, struc
}
bp = dbg->bp;
- for(i=0; i<MAX_BREAKPOINT; i++) {
+ for(i=0; i<dbg->bpnum; i++) {
if(bp->type == MRB_DEBUG_BPTYPE_METHOD) {
if(bp->enable == TRUE) {
bpno = compare_break_method(mrb, bp, class_obj, method_sym, isCfunc);