+#
+# For debugging define -DSDCC.DEBUG command line option
+
+;--------------------------------
+; Debugging Macros
+
+!ifdef SDCC.DEBUG
+ Var SDCC.FunctionName
+!endif
+
+!define DebugMsg "!insertmacro MACRO_SDCC_DebugMsg"
+!macro MACRO_SDCC_DebugMsg MSG
+ !ifdef SDCC.DEBUG
+ MessageBox MB_OK "*** $SDCC.FunctionName: ${MSG} ***"
+ !endif
+!macroend
+
+!define Function "!insertmacro MACRO_SDCC_Function"
+!macro MACRO_SDCC_Function NAME
+ Function "${NAME}"
+ !ifdef SDCC.DEBUG
+ StrCpy $SDCC.FunctionName ${NAME}
+ !endif
+!macroend
+
+!define FunctionEnd "!insertmacro MACRO_SDCC_FunctionEnd"
+!macro MACRO_SDCC_FunctionEnd
+ !ifdef SDCC.DEBUG
+ StrCpy $SDCC.FunctionName ""
+ !endif
+ FunctionEnd
+!macroend