• Home
  • Raw
  • Download

Lines Matching refs:state

119 u4 dvmJdwpNextRequestSerial(JdwpState* state)  in dvmJdwpNextRequestSerial()  argument
121 dvmDbgLockMutex(&state->serialLock); in dvmJdwpNextRequestSerial()
122 u4 result = state->requestSerial++; in dvmJdwpNextRequestSerial()
123 dvmDbgUnlockMutex(&state->serialLock); in dvmJdwpNextRequestSerial()
132 u4 dvmJdwpNextEventSerial(JdwpState* state) in dvmJdwpNextEventSerial() argument
134 dvmDbgLockMutex(&state->serialLock); in dvmJdwpNextEventSerial()
135 u4 result = state->eventSerial++; in dvmJdwpNextEventSerial()
136 dvmDbgUnlockMutex(&state->serialLock); in dvmJdwpNextEventSerial()
144 static void lockEventMutex(JdwpState* state) in lockEventMutex() argument
147 dvmDbgLockMutex(&state->eventLock); in lockEventMutex()
154 static void unlockEventMutex(JdwpState* state) in unlockEventMutex() argument
156 dvmDbgUnlockMutex(&state->eventLock); in unlockEventMutex()
186 JdwpError dvmJdwpRegisterEvent(JdwpState* state, JdwpEvent* pEvent) in dvmJdwpRegisterEvent() argument
188 lockEventMutex(state); in dvmJdwpRegisterEvent()
190 assert(state != NULL); in dvmJdwpRegisterEvent()
218 if (state->eventList != NULL) { in dvmJdwpRegisterEvent()
219 pEvent->next = state->eventList; in dvmJdwpRegisterEvent()
220 state->eventList->prev = pEvent; in dvmJdwpRegisterEvent()
222 state->eventList = pEvent; in dvmJdwpRegisterEvent()
223 state->numEvents++; in dvmJdwpRegisterEvent()
225 unlockEventMutex(state); in dvmJdwpRegisterEvent()
238 static void unregisterEvent(JdwpState* state, JdwpEvent* pEvent) in unregisterEvent() argument
242 assert(state->eventList == pEvent); in unregisterEvent()
244 state->eventList = pEvent->next; in unregisterEvent()
270 state->numEvents--; in unregisterEvent()
271 assert(state->numEvents != 0 || state->eventList == NULL); in unregisterEvent()
281 void dvmJdwpUnregisterEventById(JdwpState* state, u4 requestId) in dvmJdwpUnregisterEventById() argument
283 lockEventMutex(state); in dvmJdwpUnregisterEventById()
285 JdwpEvent* pEvent = state->eventList; in dvmJdwpUnregisterEventById()
288 unregisterEvent(state, pEvent); in dvmJdwpUnregisterEventById()
299 unlockEventMutex(state); in dvmJdwpUnregisterEventById()
305 void dvmJdwpUnregisterAll(JdwpState* state) in dvmJdwpUnregisterAll() argument
307 lockEventMutex(state); in dvmJdwpUnregisterAll()
309 JdwpEvent* pEvent = state->eventList; in dvmJdwpUnregisterAll()
313 unregisterEvent(state, pEvent); in dvmJdwpUnregisterAll()
318 state->eventList = NULL; in dvmJdwpUnregisterAll()
320 unlockEventMutex(state); in dvmJdwpUnregisterAll()
378 static JdwpEvent** allocMatchList(JdwpState* state) in allocMatchList() argument
380 return (JdwpEvent**) malloc(sizeof(JdwpEvent*) * state->numEvents); in allocMatchList()
387 static void cleanupMatchList(JdwpState* state, JdwpEvent** matchList, in cleanupMatchList() argument
400 unregisterEvent(state, pEvent); in cleanupMatchList()
462 static bool modsMatch(JdwpState* state, JdwpEvent* pEvent, ModBasket* basket) in modsMatch() argument
539 static void findMatchingEvents(JdwpState* state, JdwpEventKind eventKind, in findMatchingEvents() argument
545 JdwpEvent* pEvent = state->eventList; in findMatchingEvents()
547 if (pEvent->eventKind == eventKind && modsMatch(state, pEvent, basket)) in findMatchingEvents()
581 static void suspendByPolicy(JdwpState* state, JdwpSuspendPolicy suspendPolicy) in suspendByPolicy() argument
593 if (dvmDbgGetThreadSelfId() == state->debugThreadId) { in suspendByPolicy()
614 dvmJdwpSetWaitForEventThread(state, dvmDbgGetThreadSelfId()); in suspendByPolicy()
639 static bool invokeInProgress(JdwpState* state) in invokeInProgress() argument
655 void dvmJdwpSetWaitForEventThread(JdwpState* state, ObjectId threadId) in dvmJdwpSetWaitForEventThread() argument
660 dvmDbgLockMutex(&state->eventThreadLock); in dvmJdwpSetWaitForEventThread()
666 while (state->eventThreadId != 0) { in dvmJdwpSetWaitForEventThread()
668 state->eventThreadId, threadId); in dvmJdwpSetWaitForEventThread()
670 dvmDbgCondWait(&state->eventThreadCond, &state->eventThreadLock); in dvmJdwpSetWaitForEventThread()
676 state->eventThreadId = threadId; in dvmJdwpSetWaitForEventThread()
678 dvmDbgUnlockMutex(&state->eventThreadLock); in dvmJdwpSetWaitForEventThread()
684 void dvmJdwpClearWaitForEventThread(JdwpState* state) in dvmJdwpClearWaitForEventThread() argument
691 dvmDbgLockMutex(&state->eventThreadLock); in dvmJdwpClearWaitForEventThread()
693 assert(state->eventThreadId != 0); in dvmJdwpClearWaitForEventThread()
694 LOGV("cleared event token (0x%llx)", state->eventThreadId); in dvmJdwpClearWaitForEventThread()
696 state->eventThreadId = 0; in dvmJdwpClearWaitForEventThread()
698 dvmDbgCondSignal(&state->eventThreadCond); in dvmJdwpClearWaitForEventThread()
700 dvmDbgUnlockMutex(&state->eventThreadLock); in dvmJdwpClearWaitForEventThread()
721 static void eventFinish(JdwpState* state, ExpandBuf* pReq) in eventFinish() argument
726 set4BE(buf+4, dvmJdwpNextRequestSerial(state)); in eventFinish()
731 dvmJdwpSendRequest(state, pReq); in eventFinish()
745 bool dvmJdwpPostVMStart(JdwpState* state, bool suspend) in dvmJdwpPostVMStart() argument
756 lockEventMutex(state); in dvmJdwpPostVMStart()
772 unlockEventMutex(state); in dvmJdwpPostVMStart()
778 dvmJdwpSetWaitForEventThread(state, threadId); in dvmJdwpPostVMStart()
780 eventFinish(state, pReq); in dvmJdwpPostVMStart()
782 suspendByPolicy(state, suspendPolicy); in dvmJdwpPostVMStart()
810 bool dvmJdwpPostLocationEvent(JdwpState* state, const JdwpLocation* pLoc, in dvmJdwpPostLocationEvent() argument
831 if (basket.threadId == state->debugThreadId) { in dvmJdwpPostLocationEvent()
846 if (invokeInProgress(state)) { in dvmJdwpPostLocationEvent()
853 lockEventMutex(state); in dvmJdwpPostLocationEvent()
855 JdwpEvent** matchList = allocMatchList(state); in dvmJdwpPostLocationEvent()
859 findMatchingEvents(state, EK_BREAKPOINT, &basket, matchList, in dvmJdwpPostLocationEvent()
862 findMatchingEvents(state, EK_SINGLE_STEP, &basket, matchList, in dvmJdwpPostLocationEvent()
865 findMatchingEvents(state, EK_METHOD_ENTRY, &basket, matchList, in dvmJdwpPostLocationEvent()
868 findMatchingEvents(state, EK_METHOD_EXIT, &basket, matchList, in dvmJdwpPostLocationEvent()
895 cleanupMatchList(state, matchList, matchCount); in dvmJdwpPostLocationEvent()
896 unlockEventMutex(state); in dvmJdwpPostLocationEvent()
902 dvmJdwpSetWaitForEventThread(state, basket.threadId); in dvmJdwpPostLocationEvent()
904 eventFinish(state, pReq); in dvmJdwpPostLocationEvent()
906 suspendByPolicy(state, suspendPolicy); in dvmJdwpPostLocationEvent()
920 bool dvmJdwpPostThreadChange(JdwpState* state, ObjectId threadId, bool start) in dvmJdwpPostThreadChange() argument
929 if (invokeInProgress(state)) { in dvmJdwpPostThreadChange()
939 lockEventMutex(state); in dvmJdwpPostThreadChange()
941 JdwpEvent** matchList = allocMatchList(state); in dvmJdwpPostThreadChange()
945 findMatchingEvents(state, EK_THREAD_START, &basket, matchList, in dvmJdwpPostThreadChange()
948 findMatchingEvents(state, EK_THREAD_DEATH, &basket, matchList, in dvmJdwpPostThreadChange()
973 cleanupMatchList(state, matchList, matchCount); in dvmJdwpPostThreadChange()
974 unlockEventMutex(state); in dvmJdwpPostThreadChange()
980 dvmJdwpSetWaitForEventThread(state, basket.threadId); in dvmJdwpPostThreadChange()
982 eventFinish(state, pReq); in dvmJdwpPostThreadChange()
984 suspendByPolicy(state, suspendPolicy); in dvmJdwpPostThreadChange()
996 bool dvmJdwpPostVMDeath(JdwpState* state) in dvmJdwpPostVMDeath() argument
1006 eventFinish(state, pReq); in dvmJdwpPostVMDeath()
1022 bool dvmJdwpPostException(JdwpState* state, const JdwpLocation* pThrowLoc, in dvmJdwpPostException() argument
1041 if (invokeInProgress(state)) { in dvmJdwpPostException()
1048 lockEventMutex(state); in dvmJdwpPostException()
1050 JdwpEvent** matchList = allocMatchList(state); in dvmJdwpPostException()
1053 findMatchingEvents(state, EK_EXCEPTION, &basket, matchList, &matchCount); in dvmJdwpPostException()
1096 cleanupMatchList(state, matchList, matchCount); in dvmJdwpPostException()
1097 unlockEventMutex(state); in dvmJdwpPostException()
1103 dvmJdwpSetWaitForEventThread(state, basket.threadId); in dvmJdwpPostException()
1105 eventFinish(state, pReq); in dvmJdwpPostException()
1107 suspendByPolicy(state, suspendPolicy); in dvmJdwpPostException()
1121 bool dvmJdwpPostClassPrepare(JdwpState* state, int tag, RefTypeId refTypeId, in dvmJdwpPostClassPrepare() argument
1135 if (invokeInProgress(state)) { in dvmJdwpPostClassPrepare()
1142 lockEventMutex(state); in dvmJdwpPostClassPrepare()
1144 JdwpEvent** matchList = allocMatchList(state); in dvmJdwpPostClassPrepare()
1147 findMatchingEvents(state, EK_CLASS_PREPARE, &basket, matchList, in dvmJdwpPostClassPrepare()
1160 if (basket.threadId == state->debugThreadId) { in dvmJdwpPostClassPrepare()
1188 cleanupMatchList(state, matchList, matchCount); in dvmJdwpPostClassPrepare()
1190 unlockEventMutex(state); in dvmJdwpPostClassPrepare()
1196 dvmJdwpSetWaitForEventThread(state, basket.threadId); in dvmJdwpPostClassPrepare()
1198 eventFinish(state, pReq); in dvmJdwpPostClassPrepare()
1200 suspendByPolicy(state, suspendPolicy); in dvmJdwpPostClassPrepare()
1214 bool dvmJdwpPostClassUnload(JdwpState* state, RefTypeId refTypeId) in dvmJdwpPostClassUnload() argument
1227 bool dvmJdwpPostFieldAccess(JdwpState* state, int STUFF, ObjectId thisPtr, in dvmJdwpPostFieldAccess() argument
1241 void dvmJdwpDdmSendChunkV(JdwpState* state, int type, const struct iovec* iov, in dvmJdwpDdmSendChunkV() argument
1263 set4BE(header+4, dvmJdwpNextRequestSerial(state)); in dvmJdwpDdmSendChunkV()
1277 dvmJdwpSendBufferedRequest(state, wrapiov, iovcnt+1); in dvmJdwpDdmSendChunkV()