diff options
author | Juan Cespedes <cespedes@debian.org> | 2009-06-25 19:54:10 +0200 |
---|---|---|
committer | Juan Cespedes <cespedes@debian.org> | 2009-06-25 19:54:10 +0200 |
commit | 40dc6353a443f2eed64fcada3bcf305e56855b15 (patch) | |
tree | 3dfe493fe94bd06148e944d4adf1fae3b1a53b12 /ltrace.h | |
parent | f728123bd75a65a6a1536e198c3c30719e494e71 (diff) | |
download | ltrace-40dc6353a443f2eed64fcada3bcf305e56855b15.tar.gz |
Added support for callbacks to libltrace
Diffstat (limited to 'ltrace.h')
-rw-r--r-- | ltrace.h | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -1,2 +1,30 @@ +typedef struct Process Process; +typedef struct Event Event; +struct Event { + Process *proc; + enum { + EVENT_NONE, + EVENT_SIGNAL, + EVENT_EXIT, + EVENT_EXIT_SIGNAL, + EVENT_SYSCALL, + EVENT_SYSRET, + EVENT_ARCH_SYSCALL, + EVENT_ARCH_SYSRET, + EVENT_CLONE, + EVENT_EXEC, + EVENT_BREAKPOINT, + EVENT_NEW /* in this case, proc is NULL */ + } type; + union { + int ret_val; /* EVENT_EXIT */ + int signum; /* EVENT_SIGNAL, EVENT_EXIT_SIGNAL */ + int sysnum; /* EVENT_SYSCALL, EVENT_SYSRET */ + void *brk_addr; /* EVENT_BREAKPOINT */ + int newpid; /* EVENT_CLONE, EVENT_NEW */ + } e_un; +}; + extern void ltrace_init(int argc, char **argv); +extern void ltrace_add_callback(void (*func)(Event *)); extern void ltrace_main(void); |