diff options
author | Petr Machata <pmachata@redhat.com> | 2013-01-08 23:46:22 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-03-08 22:55:33 +0100 |
commit | 9978de4b7dace794a7e353fdf9985114fada5add (patch) | |
tree | 499a7064973a56da7780f32a1bfaab68344de9bf /handle_event.c | |
parent | 754ce881453ee3b6c6a93bbdaef7c645f43d49f6 (diff) | |
download | ltrace-9978de4b7dace794a7e353fdf9985114fada5add.tar.gz |
Put asserts to branches of handle_event switch where this ought to hold
Diffstat (limited to 'handle_event.c')
-rw-r--r-- | handle_event.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/handle_event.c b/handle_event.c index 563c30e..db68034 100644 --- a/handle_event.c +++ b/handle_event.c @@ -114,70 +114,91 @@ handle_event(Event *event) case EVENT_NONE: debug(1, "event: none"); return; + case EVENT_SIGNAL: + assert(event->proc != NULL); debug(1, "[%d] event: signal (%s [%d])", event->proc->pid, shortsignal(event->proc, event->e_un.signum), event->e_un.signum); handle_signal(event); return; + case EVENT_EXIT: + assert(event->proc != NULL); debug(1, "[%d] event: exit (%d)", event->proc->pid, event->e_un.ret_val); handle_exit(event); return; + case EVENT_EXIT_SIGNAL: + assert(event->proc != NULL); debug(1, "[%d] event: exit signal (%s [%d])", event->proc->pid, shortsignal(event->proc, event->e_un.signum), event->e_un.signum); handle_exit_signal(event); return; + case EVENT_SYSCALL: + assert(event->proc != NULL); debug(1, "[%d] event: syscall (%s [%d])", event->proc->pid, sysname(event->proc, event->e_un.sysnum), event->e_un.sysnum); handle_syscall(event); return; + case EVENT_SYSRET: + assert(event->proc != NULL); debug(1, "[%d] event: sysret (%s [%d])", event->proc->pid, sysname(event->proc, event->e_un.sysnum), event->e_un.sysnum); handle_sysret(event); return; + case EVENT_ARCH_SYSCALL: + assert(event->proc != NULL); debug(1, "[%d] event: arch_syscall (%s [%d])", event->proc->pid, arch_sysname(event->proc, event->e_un.sysnum), event->e_un.sysnum); handle_arch_syscall(event); return; + case EVENT_ARCH_SYSRET: + assert(event->proc != NULL); debug(1, "[%d] event: arch_sysret (%s [%d])", event->proc->pid, arch_sysname(event->proc, event->e_un.sysnum), event->e_un.sysnum); handle_arch_sysret(event); return; + case EVENT_CLONE: case EVENT_VFORK: + assert(event->proc != NULL); debug(1, "[%d] event: clone (%u)", event->proc->pid, event->e_un.newpid); handle_clone(event); return; + case EVENT_EXEC: + assert(event->proc != NULL); debug(1, "[%d] event: exec()", event->proc->pid); handle_exec(event); return; + case EVENT_BREAKPOINT: + assert(event->proc != NULL); debug(1, "[%d] event: breakpoint %p", event->proc->pid, event->e_un.brk_addr); handle_breakpoint(event); return; + case EVENT_NEW: debug(1, "[%d] event: new process", event->e_un.newpid); |