VALUE check_breakpoints_by_pos(debug_context_t *debug_context, const char *file, int line) { VALUE breakpoint; int i; if(!CTX_FL_TEST(debug_context, CTX_FL_ENABLE_BKPT)) return Qnil; if(check_breakpoint_by_pos(debug_context->breakpoint, file, line)) return debug_context->breakpoint; if(RARRAY_LEN(rdebug_breakpoints) == 0) return Qnil; for(i = 0; i < RARRAY_LEN(rdebug_breakpoints); i++) { breakpoint = rb_ary_entry(rdebug_breakpoints, i); if(check_breakpoint_by_pos(breakpoint, file, line)) return breakpoint; } return Qnil; }
extern VALUE breakpoint_find(VALUE breakpoints, VALUE source, VALUE pos) { VALUE breakpoint_object; char *file; int line; int i; file = RSTRING_PTR(source); line = FIX2INT(pos); for(i = 0; i < RARRAY_LEN(breakpoints); i++) { breakpoint_object = rb_ary_entry(breakpoints, i); if (check_breakpoint_by_pos(breakpoint_object, file, line)) { return breakpoint_object; } } return Qnil; }
extern VALUE find_breakpoint_by_pos(VALUE breakpoints, VALUE source, VALUE pos, VALUE bind) { VALUE breakpoint; char *file; int line; int i; file = RSTRING_PTR(source); line = FIX2INT(pos); for (i = 0; i < RARRAY_LENINT(breakpoints); i++) { breakpoint = rb_ary_entry(breakpoints, i); if (check_breakpoint_by_pos(breakpoint, file, line) && check_breakpoint_by_expr(breakpoint, bind) && check_breakpoint_by_hit_condition(breakpoint)) { return breakpoint; } } return Qnil; }