Home | History | Annotate | Download | only in back

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