A dynamic tracer for Linux

sym.h 598B

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