Lines Matching refs:Event
155 event_for_pid(Event *event, void *data)
157 if (event->proc != NULL && event->proc->pid == (pid_t)(uintptr_t)data)
253 static Event *process_vfork_on_event(struct event_handler *super, Event *event);
306 * vforked process. We set up event handler specially to hint
379 * edge of an instruction. So for tasks that have a breakpoint event
383 undo_breakpoint(Event *event, void *data)
385 if (event != NULL
386 && event->proc->leader == data
387 && event->type == EVENT_BREAKPOINT)
388 set_instruction_pointer(event->proc, event->e_un.brk_addr);
440 handle_stopping_event(struct pid_task *task_info, Event **eventp)
446 Event *event = *eventp;
451 && event->type == EVENT_SIGNAL
452 && event->e_un.signum == SIGSTOP) {
457 *eventp = NULL; // sink the event
467 * yet. They are still in the queue. If we have seen an event for
490 event_exit_p(Event *event)
492 return event != NULL && (event->type == EVENT_EXIT
493 || event->type == EVENT_EXIT_SIGNAL);
497 event_exit_or_none_p(Event *event)
499 return event == NULL || event_exit_p(event)
500 || event->type == EVENT_NONE;
505 Event *event)
509 if (event != NULL && !event_exit_or_none_p(event)
562 static Event *process_stopping_on_event(struct event_handler *super,
563 Event *event);
648 struct Event **eventp)
711 /* This event handler is installed when we are in the process of
717 static Event *
718 process_stopping_on_event(struct event_handler *super, Event *event)
721 struct process *task = event->proc;
726 "process_stopping_on_event: pid %d; event type %d; state %d",
727 task->pid, event->type, self->state);
732 handle_stopping_event(task_info, &event);
735 int event_to_queue = !event_exit_or_none_p(event);
738 if (event_exit_p(event) && task_info != NULL)
746 if (event != NULL && event->type == EVENT_SYSRET) {
747 debug(1, "%d LT_EV_SYSRET", event->proc->pid);
766 if (event != NULL && task == teb) {
773 if (event->type == EVENT_BREAKPOINT) {
784 if (event->type == EVENT_SIGNAL) {
788 post_singlestep(self, &event);
799 /* Sink singlestep event. */
800 if (event->type == EVENT_BREAKPOINT)
801 event = NULL;
812 post_singlestep(self, &event);
821 if (await_sigstop_delivery(&self->pids, task_info, event))
826 if (event == NULL)
828 if (event->type == EVENT_BREAKPOINT) {
829 undo_breakpoint(event, leader);
835 undo_breakpoint(event, leader);
837 event = NULL; // handled
841 if (event != NULL && event_to_queue) {
842 enque_event(event);
843 event = NULL; // sink the event
846 return event;
900 /* And deliver the first fake event, in case all the
902 Event ev = {
944 static Event *
945 ltrace_exiting_on_event(struct event_handler *super, Event *event)
948 struct process *task = event->proc;
952 "ltrace_exiting_on_event: pid %d; event type %d",
953 task->pid, event->type);
956 handle_stopping_event(task_info, &event);
958 if (event != NULL && event->type == EVENT_BREAKPOINT)
959 undo_breakpoint(event, leader);
961 if (await_sigstop_delivery(&self->pids, task_info, event)
967 if (event_exit_or_none_p(event))
968 return event;
1049 static Event *
1050 process_vfork_on_event(struct event_handler *super, Event *event)
1053 "process_vfork_on_event: pid %d; event type %d",
1054 event->proc->pid, event->type);
1057 struct process *proc = event->proc;
1060 switch (event->type) {
1069 &event->e_un.brk_addr, &sbp);
1089 return event;
1105 /* We must set up custom event handler, so that we see
1153 * EVENT_FIRST event or something, or maybe this could somehow