aboutsummaryrefslogtreecommitdiff
path: root/ltrace.h
diff options
context:
space:
mode:
authorJuan Cespedes <cespedes@debian.org>2009-06-25 19:54:10 +0200
committerJuan Cespedes <cespedes@debian.org>2009-06-25 19:54:10 +0200
commit40dc6353a443f2eed64fcada3bcf305e56855b15 (patch)
tree3dfe493fe94bd06148e944d4adf1fae3b1a53b12 /ltrace.h
parentf728123bd75a65a6a1536e198c3c30719e494e71 (diff)
downloadltrace-40dc6353a443f2eed64fcada3bcf305e56855b15.tar.gz
Added support for callbacks to libltrace
Diffstat (limited to 'ltrace.h')
-rw-r--r--ltrace.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/ltrace.h b/ltrace.h
index d7d8a69..9ba16a6 100644
--- a/ltrace.h
+++ b/ltrace.h
@@ -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);