debug.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _DEBUG_H
  2. #define _DEBUG_H
  3. #ifdef HAVE_CONFIG_H
  4. # include "config.h"
  5. #endif
  6. /*
  7. * Undefine this to completely disable context debugging.
  8. * WARNING: DO NOT send in bug reports if you undefine this!
  9. */
  10. #undef DEBUG_CONTEXT
  11. /*
  12. * Handy aliases for memory tracking and core dumps
  13. */
  14. #ifdef DEBUG_CONTEXT
  15. # define Context eggContext(__FILE__, __LINE__)
  16. # define ContextNote(note) eggContextNote(__FILE__, __LINE__, note)
  17. #else
  18. # define Context {}
  19. # define ContextNote(note) {}
  20. #endif
  21. #define debug0(x) putlog(LOG_DEBUG,"*",x)
  22. #define debug1(x,a1) putlog(LOG_DEBUG,"*",x,a1)
  23. #define debug2(x,a1,a2) putlog(LOG_DEBUG,"*",x,a1,a2)
  24. #define debug3(x,a1,a2,a3) putlog(LOG_DEBUG,"*",x,a1,a2,a3)
  25. #define debug4(x,a1,a2,a3,a4) putlog(LOG_DEBUG,"*",x,a1,a2,a3,a4)
  26. extern bool sdebug, segfaulted;
  27. void setlimits();
  28. void sdprintf (const char *, ...) __attribute__((format(printf, 1, 2)));
  29. void init_signals();
  30. void init_debug();
  31. void eggContext(const char *, int);
  32. void eggContextNote(const char *, int, const char *);
  33. #endif /* !_DEBUG_H */