Lines Matching full:step

53  * They usually require multiple events step, and otherwise, before they
54 * complete. While a step request is pending, we may need to temporarily
57 * events. So, for step events only, we directly enable and disable stepping.
58 * This is safe because there can only ever be one pending step request
71 EXIT_ERROR(error, "enabling single step"); in enableStepping()
85 EXIT_ERROR(error, "disabling single step"); in disableStepping()
166 initState(JNIEnv *env, jthread thread, StepRequest *step) in initState() argument
173 step->fromLine = -1; in initState()
174 step->fromNative = JNI_FALSE; in initState()
175 step->frameExited = JNI_FALSE; in initState()
176 step->fromStackDepth = getFrameCount(thread); in initState()
178 if (step->fromStackDepth <= 0) { in initState()
180 * If there are no stack frames, treat the step as though in initState()
185 step->fromNative = JNI_TRUE; in initState()
199 step->fromNative = JNI_TRUE; in initState()
209 LOG_STEP(("initState(): frame=%d", step->fromStackDepth)); in initState()
217 if (step->granularity == JDWP_STEP_SIZE(LINE) ) { in initState()
219 LOG_STEP(("initState(): Begin line step")); in initState()
230 if ( method != step->method ) { in initState()
231 step->lineEntryCount = 0; in initState()
232 if (step->lineEntries != NULL) { in initState()
233 jvmtiDeallocate(step->lineEntries); in initState()
234 step->lineEntries = NULL; in initState()
236 step->method = method; in initState()
237 getLineNumberTable(step->method, in initState()
238 &step->lineEntryCount, &step->lineEntries); in initState()
239 if (step->lineEntryCount > 0) { in initState()
241 &step->lineEntryCount, &step->lineEntries); in initState()
244 step->fromLine = findLineNumber(thread, location, in initState()
245 step->lineEntries, step->lineEntryCount); in initState()
256 * TO DO: The step handlers (handleFrameChange and handleStep can
265 StepRequest *step; in handleFramePopEvent() local
270 step = threadControl_getStepRequest(thread); in handleFramePopEvent()
271 if (step == NULL) { in handleFramePopEvent()
272 EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request"); in handleFramePopEvent()
275 if (step->pending) { in handleFramePopEvent()
285 fromDepth = step->fromStackDepth; in handleFramePopEvent()
293 * fact here. Once the next step event comes in, we can safely in handleFramePopEvent()
297 step->frameExited = JNI_TRUE; in handleFramePopEvent()
300 if (step->depth == JDWP_STEP_DEPTH(OVER)) { in handleFramePopEvent()
325 * will be disabled again on the next step event. in handleFramePopEvent()
331 * step-over can be stopped. in handleFramePopEvent()
336 } else if (step->depth == JDWP_STEP_DEPTH(OUT) && in handleFramePopEvent()
339 * The original stepping frame is about to be popped. Step in handleFramePopEvent()
344 } else if (step->methodEnterHandlerNode != NULL && in handleFramePopEvent()
348 * step into operation. We've popped back to the original in handleFramePopEvent()
354 (void)eventHandler_free(step->methodEnterHandlerNode); in handleFramePopEvent()
355 step->methodEnterHandlerNode = NULL; in handleFramePopEvent()
368 StepRequest *step; in handleExceptionCatchEvent() local
373 step = threadControl_getStepRequest(thread); in handleExceptionCatchEvent()
374 if (step == NULL) { in handleExceptionCatchEvent()
375 EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request"); in handleExceptionCatchEvent()
378 if (step->pending) { in handleExceptionCatchEvent()
384 jint fromDepth = step->fromStackDepth; in handleExceptionCatchEvent()
391 * fact here. Once the next step event comes in, we can safely in handleExceptionCatchEvent()
395 step->frameExited = JNI_TRUE; in handleExceptionCatchEvent()
398 if (step->depth == JDWP_STEP_DEPTH(OVER) && in handleExceptionCatchEvent()
406 } else if (step->depth == JDWP_STEP_DEPTH(OUT) && in handleExceptionCatchEvent()
409 * The original stepping frame is done. Step in handleExceptionCatchEvent()
413 } else if (step->methodEnterHandlerNode != NULL && in handleExceptionCatchEvent()
417 * step into operation. We've popped back to the original in handleExceptionCatchEvent()
422 (void)eventHandler_free(step->methodEnterHandlerNode); in handleExceptionCatchEvent()
423 step->methodEnterHandlerNode = NULL; in handleExceptionCatchEvent()
435 StepRequest *step; in handleMethodEnterEvent() local
442 step = threadControl_getStepRequest(thread); in handleMethodEnterEvent()
443 if (step == NULL) { in handleMethodEnterEvent()
444 EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request"); in handleMethodEnterEvent()
447 if (step->pending) { in handleMethodEnterEvent()
459 * This handler is relevant only to step into in handleMethodEnterEvent()
461 JDI_ASSERT(step->depth == JDWP_STEP_DEPTH(INTO)); in handleMethodEnterEvent()
463 if ( (!eventFilter_predictFiltering(step->stepHandlerNode, in handleMethodEnterEvent()
465 && ( step->granularity != JDWP_STEP_SIZE(LINE) in handleMethodEnterEvent()
468 * We've found a suitable method in which to stop. Step in handleMethodEnterEvent()
469 * until we reach the next safe location to complete the step->, in handleMethodEnterEvent()
473 if ( step->methodEnterHandlerNode != NULL ) { in handleMethodEnterEvent()
474 (void)eventHandler_free(step->methodEnterHandlerNode); in handleMethodEnterEvent()
475 step->methodEnterHandlerNode = NULL; in handleMethodEnterEvent()
486 completeStep(JNIEnv *env, jthread thread, StepRequest *step) in completeStep() argument
491 * We've completed a step; reset state for the next one, if any in completeStep()
496 if (step->methodEnterHandlerNode != NULL) { in completeStep()
497 (void)eventHandler_free(step->methodEnterHandlerNode); in completeStep()
498 step->methodEnterHandlerNode = NULL; in completeStep()
501 error = initState(env, thread, step); in completeStep()
504 * None of the initState errors should happen after one step in completeStep()
507 EXIT_ERROR(error, "initializing step state"); in completeStep()
516 StepRequest *step; in stepControl_handleStep() local
525 step = threadControl_getStepRequest(thread); in stepControl_handleStep()
526 if (step == NULL) { in stepControl_handleStep()
527 EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request"); in stepControl_handleStep()
531 * If no step is currently pending, ignore the event in stepControl_handleStep()
533 if (!step->pending) { in stepControl_handleStep()
540 * We never filter step into instruction. It's always over on the in stepControl_handleStep()
541 * first step event. in stepControl_handleStep()
543 if (step->depth == JDWP_STEP_DEPTH(INTO) && in stepControl_handleStep()
544 step->granularity == JDWP_STEP_SIZE(MIN)) { in stepControl_handleStep()
552 * stepping started, the step is always complete. in stepControl_handleStep()
554 if (step->frameExited) { in stepControl_handleStep()
565 fromDepth = step->fromStackDepth; in stepControl_handleStep()
572 * this code will be reached. Complete the step-> in stepControl_handleStep()
578 if ( step->depth == JDWP_STEP_DEPTH(INTO) in stepControl_handleStep()
579 && (!eventFilter_predictFiltering(step->stepHandlerNode, clazz, in stepControl_handleStep()
588 * We need to continue, but don't want the overhead of step in stepControl_handleStep()
596 if (step->depth == JDWP_STEP_DEPTH(INTO)) { in stepControl_handleStep()
597 step->methodEnterHandlerNode = in stepControl_handleStep()
601 if (step->methodEnterHandlerNode == NULL) { in stepControl_handleStep()
624 if (step->granularity == JDWP_STEP_SIZE(MIN)) { in stepControl_handleStep()
628 if (step->fromLine != -1) { in stepControl_handleStep()
643 if ( method == step->method ) { in stepControl_handleStep()
648 step->lineEntries, step->lineEntryCount); in stepControl_handleStep()
650 if (line != step->fromLine) { in stepControl_handleStep()
665 * set the step->frameExited flag when the original in stepControl_handleStep()
668 * and complete the step immediately. in stepControl_handleStep()
678 completeStep(env, thread, step); in stepControl_handleStep()
688 stepLock = debugMonitorCreate("JDWP Step Handler Lock"); in stepControl_initialize()
697 * Reset step control request stack depth and line number.
703 StepRequest *step; in stepControl_resetRequest() local
710 step = threadControl_getStepRequest(thread); in stepControl_resetRequest()
712 if (step != NULL) { in stepControl_resetRequest()
715 error = initState(env, thread, step); in stepControl_resetRequest()
717 EXIT_ERROR(error, "initializing step state"); in stepControl_resetRequest()
720 EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request"); in stepControl_resetRequest()
727 initEvents(jthread thread, StepRequest *step) in initEvents() argument
730 * single-stepping is enabled (i.e. step-into or step-over/step-out in initEvents()
733 if (step->depth == JDWP_STEP_DEPTH(INTO) || step->fromStackDepth > 0) { in initEvents()
738 step->catchHandlerNode = eventHandler_createInternalThreadOnly( in initEvents()
742 step->framePopHandlerNode = eventHandler_createInternalThreadOnly( in initEvents()
747 if (step->catchHandlerNode == NULL || in initEvents()
748 step->framePopHandlerNode == NULL) { in initEvents()
750 "installing step event handlers"); in initEvents()
756 * 1) For step into, always in initEvents()
757 * 2) For step over, unless right after the VM_INIT. in initEvents()
762 * 3) For step out, only if stepping from native, except right after VM_INIT in initEvents()
764 * (right after VM_INIT, a step->over or out is identical to running in initEvents()
767 switch (step->depth) { in initEvents()
772 if (step->fromStackDepth > 0 && !step->fromNative ) { in initEvents()
777 if (step->fromNative && in initEvents()
778 (step->fromStackDepth > 0)) { in initEvents()
791 StepRequest *step; in stepControl_beginStep() local
801 step = threadControl_getStepRequest(thread); in stepControl_beginStep()
802 if (step == NULL) { in stepControl_beginStep()
814 * Overwrite any currently executing step. in stepControl_beginStep()
816 step->granularity = size; in stepControl_beginStep()
817 step->depth = depth; in stepControl_beginStep()
818 step->catchHandlerNode = NULL; in stepControl_beginStep()
819 step->framePopHandlerNode = NULL; in stepControl_beginStep()
820 step->methodEnterHandlerNode = NULL; in stepControl_beginStep()
821 step->stepHandlerNode = node; in stepControl_beginStep()
822 error = initState(env, thread, step); in stepControl_beginStep()
824 initEvents(thread, step); in stepControl_beginStep()
833 * If everything went ok, indicate a step is pending. in stepControl_beginStep()
836 step->pending = JNI_TRUE; in stepControl_beginStep()
851 clearStep(jthread thread, StepRequest *step) in clearStep() argument
853 if (step->pending) { in clearStep()
856 if ( step->catchHandlerNode != NULL ) { in clearStep()
857 (void)eventHandler_free(step->catchHandlerNode); in clearStep()
858 step->catchHandlerNode = NULL; in clearStep()
860 if ( step->framePopHandlerNode!= NULL ) { in clearStep()
861 (void)eventHandler_free(step->framePopHandlerNode); in clearStep()
862 step->framePopHandlerNode = NULL; in clearStep()
864 if ( step->methodEnterHandlerNode != NULL ) { in clearStep()
865 (void)eventHandler_free(step->methodEnterHandlerNode); in clearStep()
866 step->methodEnterHandlerNode = NULL; in clearStep()
868 step->pending = JNI_FALSE; in clearStep()
871 * Warning: Do not clear step->method, step->lineEntryCount, in clearStep()
872 * or step->lineEntries here, they will likely in clearStep()
873 * be needed on the next step. in clearStep()
882 StepRequest *step; in stepControl_endStep() local
890 step = threadControl_getStepRequest(thread); in stepControl_endStep()
891 if (step != NULL) { in stepControl_endStep()
892 clearStep(thread, step); in stepControl_endStep()
910 stepControl_clearRequest(jthread thread, StepRequest *step) in stepControl_clearRequest() argument
913 clearStep(thread, step); in stepControl_clearRequest()