home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / !runtime / debugger.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-18  |  1.0 KB  |  54 lines  |  [TEXT/R*ch]

  1. #ifndef _debugger_
  2. #define _debugger_
  3.  
  4. #include "misc.h"
  5. #include "mlvalues.h"
  6.  
  7. #ifdef DEBUG
  8.  
  9. #define LOG_BUFFER_SIZE 100
  10. extern code_t log_buffer[LOG_BUFFER_SIZE];
  11. extern code_t * log_ptr;
  12. extern int trace_flag;
  13.  
  14. #define Debug(x) x
  15.  
  16. #ifdef __STDC__
  17. #define Assert(x) if (!(x)) failed_assert ( #x , __FILE__, __LINE__)
  18. #define Dprintx(x) printf ("expression %s %ld\n", #x, (unsigned long) (x))
  19. #else
  20. #ifndef __LINE__
  21. #define __LINE__ 0
  22. #endif
  23. #ifndef __FILE__
  24. #define __FILE__ "(?)"
  25. #endif
  26. #define Assert(x) if (!(x)) failed_assert ("(?)" , __FILE__, __LINE__)
  27. #define Dprintx(x) printf ("expression %ld\n", (unsigned long) (x))
  28. #endif /* __STDC__ */
  29.  
  30. void failed_assert P((char *, char *, int));
  31. void print_value P((value));
  32. code_t disasm_instr P((code_t));
  33. void post_mortem P((int));
  34. unsigned long not_random P((void));
  35.  
  36. #else /* DEBUG */
  37.  
  38. #define Debug(x)
  39. #define Assert(x)
  40. #define Dprintx(x)
  41.  
  42. #endif /* DEBUG */
  43.  
  44. #define nTrace(msg, x, y)
  45.  
  46. #ifdef TRACE
  47. #define Trace(msg, x, y) printf (msg, x, y)
  48. #else
  49. #define Trace(msg, x, y)
  50. #endif
  51.  
  52.  
  53. #endif /* _debugger_ */
  54.