summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-04-03 08:31:37 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-04-03 08:31:37 +0900
commitfa824e324bb37abe237a57d83f05089e8a724b21 (patch)
tree946ba39271fee8a8076d58a920c2fe586e8d35dc
parentd77249f0063318759a2dcff9e584a72288890528 (diff)
parent06435f5bc7a2ce354168b20bdd9e2cd62fe3f8e2 (diff)
downloadmruby-fa824e324bb37abe237a57d83f05089e8a724b21.tar.gz
mruby-fa824e324bb37abe237a57d83f05089e8a724b21.zip
Merge pull request #2755 from Yuuhei-Okazaki/fix_maxbreakpoint_reference
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);