code_junkie

Debugging techniques

Nov 10th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #ifdef DEBUG
  2. # define DPRINTF(...) fprintf(stderr, __VA_ARGS__);
  3. #else
  4. # define DPRINTF(...)
  5. #endif
  6.  
  7. try {
  8. //something that fails
  9. } catch {
  10. //do nothing
  11. }
  12.  
  13. #ifdef DEBUG
  14. #define DBG x printf x
  15. #else
  16. #define DBG x do {} while (0)
  17. #endif
  18.  
  19. void my_printf(int section, int level, ...)
  20. {
  21. if (global_debug_off)
  22. return;
  23. //do you stuff here
  24. }
  25.  
  26. <pre>
  27.  
  28. var_dump()
  29.  
  30. print_r()
Add Comment
Please, Sign In to add comment