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)*/
48 extern int find_probepoint(int fd, struct probe_point *pp);
50 #include <libdwarf/dwarf.h>
51 #include <libdwarf/libdwarf.h>
54 struct probe_point *pp; /* Target probe point */
56 /* For function searching */
57 Dwarf_Addr addr; /* Address */
58 Dwarf_Unsigned fno; /* File number */
59 Dwarf_Off inl_offs; /* Inline offset */
61 /* For variable searching */
62 Dwarf_Addr cu_base; /* Current CU base address */
63 Dwarf_Locdesc fbloc; /* Location of Current Frame Base */
64 const char *var; /* Current variable name */
65 char *buf; /* Current output buffer */
66 int len; /* Length of output buffer */
68 #endif /* NO_LIBDWARF */
70 #endif /*_PROBE_FINDER_H */