Lines Matching defs:pEvent
162 static void dumpEvent(const JdwpEvent* pEvent)
165 pEvent->requestId, pEvent, pEvent->prev, pEvent->next);
167 dvmJdwpEventKindStr(pEvent->eventKind),
168 dvmJdwpSuspendPolicyStr(pEvent->suspendPolicy),
169 pEvent->modCount);
171 for (int i = 0; i < pEvent->modCount; i++) {
172 const JdwpEventMod* pMod = &pEvent->mods[i];
186 JdwpError dvmJdwpRegisterEvent(JdwpState* state, JdwpEvent* pEvent)
191 assert(pEvent != NULL);
192 assert(pEvent->prev == NULL);
193 assert(pEvent->next == NULL);
199 for (int i = 0; i < pEvent->modCount; i++) {
200 const JdwpEventMod* pMod = &pEvent->mods[i];
211 dumpEvent(pEvent); /* TODO - need for field watches */
219 pEvent->next = state->eventList;
220 state->eventList->prev = pEvent;
222 state->eventList = pEvent;
238 static void unregisterEvent(JdwpState* state, JdwpEvent* pEvent)
240 if (pEvent->prev == NULL) {
242 assert(state->eventList == pEvent);
244 state->eventList = pEvent->next;
246 pEvent->prev->next = pEvent->next;
249 if (pEvent->next != NULL) {
250 pEvent->next->prev = pEvent->prev;
251 pEvent->next = NULL;
253 pEvent->prev = NULL;
258 for (int i = 0; i < pEvent->modCount; i++) {
259 JdwpEventMod* pMod = &pEvent->mods[i];
285 JdwpEvent* pEvent = state->eventList;
286 while (pEvent != NULL) {
287 if (pEvent->requestId == requestId) {
288 unregisterEvent(state, pEvent);
289 dvmJdwpEventFree(pEvent);
293 pEvent = pEvent->next;
309 JdwpEvent* pEvent = state->eventList;
310 while (pEvent != NULL) {
311 JdwpEvent* pNextEvent = pEvent->next;
313 unregisterEvent(state, pEvent);
314 dvmJdwpEventFree(pEvent);
315 pEvent = pNextEvent;
344 void dvmJdwpEventFree(JdwpEvent* pEvent)
346 if (pEvent == NULL)
350 assert(pEvent->prev == NULL);
351 assert(pEvent->next == NULL);
352 /* want to assert state->eventList != pEvent */
357 for (int i = 0; i < pEvent->modCount; i++) {
358 if (pEvent->mods[i].modKind == MK_CLASS_MATCH) {
359 free(pEvent->mods[i].classMatch.classPattern);
360 pEvent->mods[i].classMatch.classPattern = NULL;
362 if (pEvent->mods[i].modKind == MK_CLASS_EXCLUDE) {
363 free(pEvent->mods[i].classExclude.classPattern);
364 pEvent->mods[i].classExclude.classPattern = NULL;
368 free(pEvent);
392 JdwpEvent* pEvent = *ppEvent;
394 for (int i = 0; i < pEvent->modCount; i++) {
395 if (pEvent->mods[i].modKind == MK_COUNT &&
396 pEvent->mods[i].count.count == 0)
399 unregisterEvent(state, pEvent);
400 dvmJdwpEventFree(pEvent);
461 static bool modsMatch(JdwpState* state, JdwpEvent* pEvent, ModBasket* basket)
463 JdwpEventMod* pMod = pEvent->mods;
465 for (int i = pEvent->modCount; i > 0; i--, pMod++) {
544 JdwpEvent* pEvent = state->eventList;
545 while (pEvent != NULL) {
546 if (pEvent->eventKind == eventKind && modsMatch(state, pEvent, basket))
548 *matchList++ = pEvent;
552 pEvent = pEvent->next;