ltrace.h revision 2a61d19bd244dadcde5009f1632cf14b95623e3d
1typedef enum Event_type Event_type;
2enum Event_type {
3	EVENT_NONE=0,
4	EVENT_SIGNAL,
5	EVENT_EXIT,
6	EVENT_EXIT_SIGNAL,
7	EVENT_SYSCALL,
8	EVENT_SYSRET,
9	EVENT_ARCH_SYSCALL,
10	EVENT_ARCH_SYSRET,
11	EVENT_CLONE,
12	EVENT_EXEC,
13	EVENT_BREAKPOINT,
14	EVENT_NEW,        /* in this case, proc is NULL */
15	EVENT_MAX
16};
17
18typedef struct Process Process;
19typedef struct Event Event;
20struct Event {
21	Process * proc;
22	Event_type type;
23	union {
24		int ret_val;     /* EVENT_EXIT */
25		int signum;      /* EVENT_SIGNAL, EVENT_EXIT_SIGNAL */
26		int sysnum;      /* EVENT_SYSCALL, EVENT_SYSRET */
27		void * brk_addr; /* EVENT_BREAKPOINT */
28		int newpid;      /* EVENT_CLONE, EVENT_NEW */
29	} e_un;
30};
31
32typedef void (*callback_func) (Event *);
33
34extern void ltrace_init(int argc, char **argv);
35extern void ltrace_add_callback(callback_func f, Event_type type);
36extern void ltrace_main(void);
37