issue #3837:Add the debug support for mac and lua template