built a debugging mode for codegen