Home | History | Annotate | Download | only in back

Lines Matching refs:node

35 #define HANDLING_EVENT(node) ((node)->current_ei != 0)
165 setThreadLocalStorage(jthread thread, ThreadNode *node)
170 (gdata->jvmti, thread, (void*)node);
185 ThreadNode *node;
187 node = NULL;
189 (gdata->jvmti, thread, (void**)&node);
197 return node;
210 ThreadNode *node;
212 for (node = list->first; node != NULL; node = node->next) {
213 if (isSameObject(env, node->thread, thread)) {
217 return node;
228 ThreadNode *node;
230 /* Get thread local storage for quick thread -> node access */
231 node = getThreadLocalStorage(thread);
236 if ( node == NULL ) {
241 node = nonTlsSearch(env, list, thread);
243 node = nonTlsSearch(env, &runningThreads, thread);
244 if ( node == NULL ) {
245 node = nonTlsSearch(env, &otherThreads, thread);
248 if ( node != NULL ) {
250 setThreadLocalStorage(thread, (void*)node);
255 if ( node != NULL && list != NULL && node->list != list ) {
258 return node;
263 removeNode(ThreadList *list, ThreadNode *node)
268 prev = node->prev;
269 next = node->next;
279 node->next = NULL;
280 node->prev = NULL;
281 node->list = NULL;
286 addNode(ThreadList *list, ThreadNode *node)
288 node->next = NULL;
289 node->prev = NULL;
290 node->list = NULL;
292 list->first = node;
294 list->first->prev = node;
295 node->next = list->first;
296 list->first = node;
298 node->list = list;
304 ThreadNode *node;
307 node = findThread(list, thread);
308 if (node == NULL) {
309 node = jvmtiAllocate(sizeof(*node));
310 if (node == NULL) {
314 (void)memset(node, 0, sizeof(*node));
317 jvmtiDeallocate(node);
326 saveGlobalRef(env, thread, &(node->thread));
327 if (node->thread == NULL) {
328 jvmtiDeallocate(node);
336 if (threadControl_isDebugThread(node->thread)) {
337 node->isDebugThread = JNI_TRUE;
344 node->suspendCount = suspendAllCount;
345 node->suspendOnStart = JNI_TRUE;
347 node->current_ei = 0;
348 node->instructionStepMode = JVMTI_DISABLE;
349 node->eventBag = eventBag;
350 addNode(list, node);
352 /* Set thread local storage for quick thread -> node access.
356 setThreadLocalStorage(node->thread, (void*)node);
359 return node;
363 clearThread(JNIEnv *env, ThreadNode *node)
365 if (node->pendingStop != NULL) {
366 tossGlobalRef(env, &(node->pendingStop));
368 stepControl_clearRequest(node->thread, &node->currentStep);
369 if (node->isDebugThread) {
370 (void)threadControl_removeDebugThread(node->thread);
373 setThreadLocalStorage(node->thread, NULL);
374 tossGlobalRef(env, &(node->thread));
375 bagDestroyBag(node->eventBag);
376 jvmtiDeallocate(node);
382 ThreadNode *node;
384 node = findThread(list, thread);
385 if (node != NULL) {
386 removeNode(list, node);
387 clearThread(env, node);
394 ThreadNode *node;
396 node = list->first;
397 while (node != NULL) {
398 ThreadNode *temp = node->next;
399 if (node->suspendCount == 0) {
400 removeThread(env, list, node->thread);
402 node = temp;
407 moveNode(ThreadList *source, ThreadList *dest, ThreadNode *node)
409 removeNode(source, node);
410 JDI_ASSERT(findThread(dest, node->thread) == NULL);
411 addNode(dest, node);
420 ThreadNode *node;
423 for (node = list->first; node != NULL; node = node->next) {
424 error = (*function)(env, node, arg);
492 threadSetEventNotificationMode(ThreadNode *node,
499 node->instructionStepMode = mode;
507 processDeferredEventModes(JNIEnv *env, jthread thread, ThreadNode *node)
518 error = threadSetEventNotificationMode(node,
611 ThreadNode *node;
614 node = list->first;
615 while (node != NULL) {
616 if (node->resumeFrameDepth > 0) {
623 error = threadState(node->thread, &state);
632 node = node->next;
658 ThreadNode *node;
665 node = findThread(&runningThreads, thread);
666 if (node != NULL) {
667 if (node->resumeFrameDepth > 0) {
672 if (compareDepth < node->resumeFrameDepth) {
673 node->resumeFrameDepth = 0;
685 ThreadNode *node;
687 node = findThread(NULL, thread);
688 if (node != NULL) {
689 while (node && node->suspendCount > 0) {
691 node = findThread(NULL, thread);
701 ThreadNode *node;
704 node = findThread(&runningThreads, thread);
705 if (node != NULL) {
706 JDI_ASSERT(node->resumeFrameDepth == 0);
731 node->resumeFrameDepth = frameDepth;
826 ThreadNode *node;
828 node = insertThread(env, &runningThreads, thread);
839 node->isStarted = JNI_TRUE;
849 commonSuspendByNode(ThreadNode *node)
853 LOG_MISC(("thread=%p suspended", node->thread));
855 (gdata->jvmti, node->thread);
861 node->toBeResumed = JNI_TRUE;
884 deferredSuspendThreadByNode(ThreadNode *node)
889 if (node->isDebugThread) {
898 if (node->suspendCount > 0) {
899 error = commonSuspendByNode(node);
907 node->suspendCount--;
911 node->suspendOnStart = JNI_FALSE;
919 suspendThreadByNode(ThreadNode *node)
922 if (node->isDebugThread) {
931 if (node->suspendOnStart) {
932 node->suspendCount++;
936 if (node->suspendCount == 0) {
937 error = commonSuspendByNode(node);
947 node->suspendOnStart = JNI_TRUE;
953 node->suspendCount++;
962 resumeThreadByNode(ThreadNode *node)
966 if (node->isDebugThread) {
970 if (node->suspendCount > 0) {
971 node->suspendCount--;
973 if ((node->suspendCount == 0) && node->toBeResumed &&
974 !node->suspendOnStart) {
975 LOG_MISC(("thread=%p resumed", node->thread));
977 (gdata->jvmti, node->thread);
978 node->frameGeneration++; /* Increment on each resume */
979 node->toBeResumed = JNI_FALSE;
980 if (error == JVMTI_ERROR_THREAD_NOT_ALIVE && !node->isStarted) {
1052 ThreadNode *node;
1059 node = findThread(&runningThreads, thread);
1060 if (node == NULL) {
1061 node = insertThread(env, &otherThreads, thread);
1065 return deferredSuspendThreadByNode(node);
1067 return suspendThreadByNode(node);
1073 resumeCopyHelper(JNIEnv *env, ThreadNode *node, void *arg)
1075 if (node->isDebugThread) {
1080 if (node->suspendCount > 1) {
1081 node->suspendCount--;
1101 if (nodenode->toBeResumed || node->suspendOnStart)) {
1102 node->suspendCount--;
1117 if (node->suspendCount == 1 && node->toBeResumed && !node->suspendOnStart) {
1120 **listPtr = node->thread;
1128 resumeCountHelper(JNIEnv *env, ThreadNode *node, void *arg)
1130 if (node->isDebugThread) {
1141 if (node->suspendCount == 1 && node->toBeResumed && !node->suspendOnStart) {
1230 ThreadNode *node;
1232 node = findThread(&runningThreads, reqList[i]);
1233 if (node == NULL) {
1236 LOG_MISC(("thread=%p resumed as part of list", node->thread));
1243 node->suspendCount--;
1244 node->toBeResumed = JNI_FALSE;
1245 node->frameGeneration++; /* Increment on each resume */
1278 ThreadNode *node;
1285 node = findThread(&runningThreads, initList[i]);
1286 if (node == NULL) {
1287 node = insertThread(env, &otherThreads, initList[i]);
1290 if (node->isDebugThread) {
1299 if (node->suspendOnStart || node->suspendCount > 0) {
1300 node->suspendCount++;
1304 if (node->suspendCount == 0) {
1323 ThreadNode *node;
1325 node = findThread(NULL, reqList[i]);
1326 if (node == NULL) {
1329 LOG_MISC(("thread=%p suspended as part of list", node->thread));
1333 node->toBeResumed = JNI_TRUE;
1349 node->suspendOnStart = JNI_TRUE;
1355 node->suspendCount++;
1372 ThreadNode *node;
1378 node = findThread(NULL, thread);
1381 * If the node is in neither list, the debugger never suspended
1385 if (node != NULL) {
1386 error = resumeThreadByNode(node);
1438 ThreadNode *node;
1442 node = findThread(&runningThreads, thread);
1443 if (node == NULL) {
1444 node = findThread(&otherThreads, thread);
1448 if (node != NULL) {
1449 *count = node->suspendCount;
1452 * If the node is in neither list, the debugger never suspended
1483 suspendAllHelper(JNIEnv *env, ThreadNode *node, void *arg)
1489 if (!contains(env, list, count, node->thread)) {
1490 error = commonSuspend(env, node->thread, JNI_FALSE);
1564 resumeHelper(JNIEnv *env, ThreadNode *node, void *ignored)
1568 * don't need to recheck to see if the node is still on one
1571 return resumeThreadByNode(node);
1589 * such threads must have a node in one of the thread lists, so there's
1621 ThreadNode *node;
1628 node = findThread(&runningThreads, thread);
1629 if (node != NULL) {
1630 step = &node->currentStep;
1641 ThreadNode *node;
1648 node = findThread(&runningThreads, thread);
1649 if (node != NULL) {
1650 request = &node->currentInvoke;
1748 ThreadNode *node;
1750 node = findThread(NULL, thread);
1751 if (node == NULL) {
1754 popFrameThread = node->popFrameThread;
1767 ThreadNode *node;
1769 node = findThread(NULL, thread);
1770 if (node == NULL) {
1773 node->popFrameThread = value;
1786 ThreadNode *node;
1788 node = findThread(NULL, thread);
1789 if (node == NULL) {
1793 popFrameEvent = node->popFrameEvent;
1806 ThreadNode *node;
1808 node = findThread(NULL, thread);
1809 if (node == NULL) {
1812 node->popFrameEvent = value;
1813 node->frameGeneration++; /* Increment on each resume */
1826 ThreadNode *node;
1828 node = findThread(NULL, thread);
1829 if (node == NULL) {
1833 popFrameProceed = node->popFrameProceed;
1846 ThreadNode *node;
1848 node = findThread(NULL, thread);
1849 if (node == NULL) {
1852 node->popFrameProceed = value;
2038 ThreadNode *node;
2070 node = findThread(&otherThreads, thread);
2071 if (node != NULL) {
2072 moveNode(&otherThreads, &runningThreads, node);
2075 * Get a thread node for the reporting thread. For thread start
2077 * the thread node may need to be created.
2082 node = insertThread(env, &runningThreads, thread);
2086 node->isStarted = JNI_TRUE;
2087 processDeferredEventModes(env, thread, node);
2090 node->current_ei = ei;
2091 eventBag = node->eventBag;
2092 if (node->suspendOnStart) {
2093 threadToSuspend = node->thread;
2110 doPendingTasks(JNIEnv *env, ThreadNode *node)
2116 if (node->pendingInterrupt) {
2118 (gdata->jvmti, node->thread);
2122 node->pendingInterrupt = JNI_FALSE;
2125 if (node->pendingStop != NULL) {
2127 (gdata->jvmti, node->thread, node->pendingStop);
2131 tossGlobalRef(env, &(node->pendingStop));
2139 ThreadNode *node;
2148 node = findThread(&runningThreads, thread);
2149 if (node == NULL) {
2156 jboolean inResume = (node->resumeFrameDepth > 0);
2158 node = NULL; /* has been freed */
2169 doPendingTasks(env, node);
2170 node->eventBag = eventBag;
2171 node->current_ei = 0;
2186 ThreadNode *node;
2199 node = findThread(&runningThreads, thread);
2200 if ((node != NULL) && HANDLING_EVENT(node)) {
2221 ThreadNode *node;
2230 node = findThread(&runningThreads, thread);
2231 if ((node == NULL) || !HANDLING_EVENT(node)) {
2238 node->pendingInterrupt = JNI_TRUE;
2249 ThreadNode *node;
2253 node = findThread(&runningThreads, thread);
2254 if (node != NULL) {
2255 node->cleInfo.ei = 0;
2256 if (node->cleInfo.clazz != NULL) {
2257 tossGlobalRef(env, &(node->cleInfo.clazz));
2268 ThreadNode *node;
2275 node = findThread(&runningThreads, thread);
2276 if (node != NULL && node->cleInfo.ei != 0 &&
2277 node->cleInfo.method == method &&
2278 node->cleInfo.location == location &&
2279 (isSameObject(env, node->cleInfo.clazz, clazz))) {
2292 ThreadNode *node;
2296 node = findThread(&runningThreads, thread);
2297 if (node != NULL) {
2298 node->cleInfo.ei = ei;
2301 saveGlobalRef(env, clazz, &(node->cleInfo.clazz));
2303 node->cleInfo.method = method;
2304 node->cleInfo.location = location;
2313 ThreadNode *node;
2317 node = findThread(&runningThreads, thread);
2318 if (node != NULL) {
2319 node->pendingInterrupt = JNI_TRUE;
2328 ThreadNode *node;
2337 node = findThread(&runningThreads, thread);
2338 if ((node == NULL) || !HANDLING_EVENT(node)) {
2348 saveGlobalRef(env, throwable, &(node->pendingStop));
2357 detachHelper(JNIEnv *env, ThreadNode *node, void *arg)
2359 invoker_detach(&node->currentInvoke);
2377 resetHelper(JNIEnv *env, ThreadNode *node, void *arg)
2379 if (node->toBeResumed) {
2380 LOG_MISC(("thread=%p resumed", node->thread));
2381 (void)JVMTI_FUNC_PTR(gdata->jvmti,ResumeThread)(gdata->jvmti, node->thread);
2382 node->frameGeneration++; /* Increment on each resume */
2384 stepControl_clearRequest(node->thread, &node->currentStep);
2385 node->toBeResumed = JNI_FALSE;
2386 node->suspendCount = 0;
2387 node->suspendOnStart = JNI_FALSE;
2419 ThreadNode *node;
2425 node = findThread(&runningThreads, thread);
2426 if (node != NULL) {
2427 mode = node->instructionStepMode;
2444 ThreadNode *node;
2448 node = findThread(&runningThreads, thread);
2449 if ((node == NULL) || (!node->isStarted)) {
2455 error = threadSetEventNotificationMode(node,
2475 ThreadNode *node;
2477 node = findThread(&runningThreads, NULL);
2478 thread = (node == NULL) ? NULL : node->thread;
2492 ThreadNode *node;
2494 node = findThread(NULL, thread);
2496 if (node != NULL) {
2497 frameGeneration = node->frameGeneration;