< prev index next >

src/jdk.jdwp.agent/share/native/libjdwp/stepControl.c

Print this page

446     if (step == NULL) {
447         EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request");
448     }
449 
450     if (step->pending) {
451         jclass    clazz;
452         jmethodID method;
453         char     *classname;
454 
455         LOG_STEP(("handleMethodEnterEvent: thread=%p", thread));
456 
457         clazz     = evinfo->clazz;
458         method    = evinfo->method;
459         classname = getClassname(clazz);
460 
461         /*
462          * This handler is relevant only to step into
463          */
464         JDI_ASSERT(step->depth == JDWP_STEP_DEPTH(INTO));
465 
466         if (    (!eventFilter_predictFiltering(step->stepHandlerNode,
467                                                clazz, classname))
468              && (   step->granularity != JDWP_STEP_SIZE(LINE)
469                  || hasLineNumbers(method) ) ) {
470             /*
471              * We've found a suitable method in which to stop. Step
472              * until we reach the next safe location to complete the step->,
473              * and we can get rid of the method entry handler.
474              */
475             enableStepping(thread);
476             if ( step->methodEnterHandlerNode != NULL ) {
477                 (void)eventHandler_free(step->methodEnterHandlerNode);
478                 step->methodEnterHandlerNode = NULL;
479             }
480         }
481         jvmtiDeallocate(classname);
482         classname = NULL;
483     }
484 
485     stepControl_unlock();
486 }
487 
488 static void
489 completeStep(JNIEnv *env, jthread thread, StepRequest *step)
490 {
491     jvmtiError error;
492 
493     /*

446     if (step == NULL) {
447         EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting step request");
448     }
449 
450     if (step->pending) {
451         jclass    clazz;
452         jmethodID method;
453         char     *classname;
454 
455         LOG_STEP(("handleMethodEnterEvent: thread=%p", thread));
456 
457         clazz     = evinfo->clazz;
458         method    = evinfo->method;
459         classname = getClassname(clazz);
460 
461         /*
462          * This handler is relevant only to step into
463          */
464         JDI_ASSERT(step->depth == JDWP_STEP_DEPTH(INTO));
465 
466         if (    (!eventFilter_predictFiltering(step->stepHandlerNode, clazz, classname))

467              && (   step->granularity != JDWP_STEP_SIZE(LINE)
468                  || hasLineNumbers(method) ) ) {
469             /*
470              * We've found a suitable method in which to resume stepping.
471              * We can also get rid of the method entry handler now.

472              */
473             enableStepping(thread);
474             if ( step->methodEnterHandlerNode != NULL ) {
475                 (void)eventHandler_free(step->methodEnterHandlerNode);
476                 step->methodEnterHandlerNode = NULL;
477             }
478         }
479         jvmtiDeallocate(classname);
480         classname = NULL;
481     }
482 
483     stepControl_unlock();
484 }
485 
486 static void
487 completeStep(JNIEnv *env, jthread thread, StepRequest *step)
488 {
489     jvmtiError error;
490 
491     /*
< prev index next >