A dynamic tracer for Linux

sym.h 611B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _PLY_SYM_H
  2. #define _PLY_SYM_H
  3. #include <stdint.h>
  4. struct func;
  5. struct node;
  6. struct type;
  7. struct symtab;
  8. struct sym {
  9. struct symtab *st;
  10. const char *name;
  11. const struct func *func;
  12. struct type *type;
  13. /* irstate_t irs; */
  14. };
  15. struct symtab {
  16. struct sym **syms;
  17. size_t len;
  18. };
  19. #define symtab_foreach(_st, _sym) \
  20. for((_sym) = (_st)->syms; (_sym) < &(_st)->syms[(_st)->len]; (_sym)++)
  21. struct sym *sym_alloc(struct symtab *st, struct node *n,
  22. const struct func *func);
  23. void sym_dump(struct sym *sym, FILE *fp);
  24. void symtab_dump(struct symtab *st, FILE *fp);
  25. #endif /* _PLY_SYM_H */