1 #ifndef _PROBE_FINDER_H
2 #define _PROBE_FINDER_H
4 #define _stringify(n) #n
5 #define stringify(n) _stringify(n)
8 #define debug(fmt ...) \
9 fprintf(stderr, "DBG(" __FILE__ ":" stringify(__LINE__) "): " fmt)
11 #define debug(fmt ...) do {} while (0)
16 fprintf(stderr, "Error (" __FILE__ ":" stringify(__LINE__) \
17 "): " stringify(cnd) "\n"); \
21 #define MAX_PATH_LEN 256
22 #define MAX_PROBE_BUFFER 1024
23 #define MAX_PROBES 128
25 static inline int is_c_varname(const char *name)
28 return isalpha(name[0]) || name[0] == '_';
33 char *file; /* File name */
34 int line; /* Line number */
36 char *function; /* Function name */
37 int offset; /* Offset bytes */
39 int nr_args; /* Number of arguments */
40 char **args; /* Arguments */
43 int found; /* Number of found probe points */
44 char *probes[MAX_PROBES]; /* Output buffers (will be allocated)*/
47 extern int find_probepoint(int fd, struct probe_point *pp);
49 #include <libdwarf/dwarf.h>
50 #include <libdwarf/libdwarf.h>
53 struct probe_point *pp; /* Target probe point */
55 /* For function searching */
56 Dwarf_Addr addr; /* Address */
57 Dwarf_Unsigned fno; /* File number */
58 Dwarf_Off inl_offs; /* Inline offset */
60 /* For variable searching */
61 Dwarf_Addr cu_base; /* Current CU base address */
62 Dwarf_Locdesc fbloc; /* Location of Current Frame Base */
63 const char *var; /* Current variable name */
64 char *buf; /* Current output buffer */
65 int len; /* Length of output buffer */
68 #endif /*_PROBE_FINDER_H */