add debug macros to main.h, partial implemented