A dynamic tracer for Linux

sym.h 627B

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