useful debug macros and some debug functions for use in debugger