int handle_notif_ack (char *own_buf, int packet_len) { int i = 0; struct notif_server *np = NULL; for (i = 0; i < ARRAY_SIZE (notifs); i++) { np = notifs[i]; if (strncmp (own_buf, np->ack_name, strlen (np->ack_name)) == 0 && packet_len == strlen (np->ack_name)) break; } if (np == NULL) return 0; /* If we're waiting for GDB to acknowledge a pending event, consider that done. */ if (!QUEUE_is_empty (notif_event_p, np->queue)) { struct notif_event *head = QUEUE_deque (notif_event_p, np->queue); if (remote_debug) fprintf (stderr, "%s: acking %d\n", np->ack_name, QUEUE_length (notif_event_p, np->queue)); xfree (head); } notif_write_event (np, own_buf); return 1; }
void remote_notif_process (struct remote_notif_state *state, struct notif_client *except) { while (!QUEUE_is_empty (notif_client_p, state->notif_queue)) { struct notif_client *nc = QUEUE_deque (notif_client_p, state->notif_queue); gdb_assert (nc != except); if (nc->can_get_pending_events (nc)) remote_notif_get_pending_events (nc); } }