static void handleFrameEvent(JNIEnv *env, EventInfo *evinfo, HandlerNode *node, struct bag *eventBag) { /* * The frame id that comes with this event is very transient. * We can't send the frame to the helper thread because it * might be useless by the time the helper thread can use it * (if suspend policy is NONE). So, get the needed info from * the frame and then use a special command to the helper * thread. */ jmethodID method; jlocation location; jvmtiError error; FrameNumber fnum = 0; jvalue returnValue; error = JVMTI_FUNC_PTR(gdata->jvmti,GetFrameLocation) (gdata->jvmti, evinfo->thread, fnum, &method, &location); if (error != JVMTI_ERROR_NONE) { location = -1; } returnValue = evinfo->u.method_exit.return_value; eventHelper_recordFrameEvent(node->handlerID, node->suspendPolicy, evinfo->ei, evinfo->thread, evinfo->clazz, evinfo->method, location, node->needReturnValue, returnValue, eventBag); }
static void handleFrameEvent(JNIEnv *env, JVMDI_Event *event, HandlerNode *node, struct bag *eventBag) { /* * The frame id that comes with this event is very transient. * We can't send the frameID to the helper thread because it * might be useless by the time the helper thread can use it * (if suspend policy is NONE). So, get the needed info from * the frame and then use a special command to the helper * thread. */ jclass clazz; jmethodID method; jlocation location; JVMDI_frame_event_data *eventData = &event->u.frame; jint error; error = threadControl_getFrameLocation(eventData->thread, eventData->frame, &clazz, &method, &location); if (error == JVMDI_ERROR_NONE) { (*env)->DeleteGlobalRef(env, clazz); } else { location = -1; } eventHelper_recordFrameEvent(node->handlerID, node->suspendPolicy, (jbyte)event->kind, eventData->thread, eventData->clazz, eventData->method, location, eventBag); }