/* * call-seq: * context.step(steps, force = false) * * Stops the current context after a number of +steps+ are made. * +force+ parameter (if true) ensures that the cursor moves from the current line. */ static VALUE context_stop_next(int argc, VALUE *argv, VALUE self) { VALUE steps, force; debug_context_t *debug_context; debug_check_started(); rb_scan_args(argc, argv, "11", &steps, &force); if(FIX2INT(steps) < 0) rb_raise(rb_eRuntimeError, "Steps argument can't be negative."); Data_Get_Struct(self, debug_context_t, debug_context); debug_context->stop_next = FIX2INT(steps); if(RTEST(force)) CTX_FL_SET(debug_context, CTX_FL_FORCE_MOVE); else CTX_FL_UNSET(debug_context, CTX_FL_FORCE_MOVE); return steps; }