debug.monkey2 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Namespace monkey.debug
  2. Extern
  3. #rem monkeydoc Stops the app and activates the debugger (debug builds only).
  4. Stops the app, causing the debugger (if available) to activate. The app will then wait for further instructions from the
  5. debugger (step, continue, end etc).
  6. The debugger is only available in debug builds, and when running an app from the Ted2 IDE.
  7. #end
  8. Function DebugStop()="bbDB::stop"
  9. #rem monkeydoc Generates a non-recoverable runtime error.
  10. Halts the program with a non-recoverable runtime error.
  11. @param message Runtime error message to generate.
  12. #end
  13. Function RuntimeError( message:String )="bbDB::error"
  14. #rem monkeydoc Generates a runtime error if a boolean expression is false.
  15. @param condition The boolean condition to check.
  16. @param message Runtime error message to generate.
  17. #end
  18. Function Assert( condition:Bool,message:String="Assert failed" )="bbAssert"
  19. #rem monkeydoc Generates a runtime error if a boolean expression is false (debug builds only).
  20. This function does not execute at all in release builds, so make sure that `condition` doesn't inadvertantly execute
  21. any critical code.
  22. @param condition The boolean condition to check.
  23. @param message Runtime error message to generate.
  24. #end
  25. Function DebugAssert( condition:Bool,message:String="Debug assert failed" )="bbDebugAssert"
  26. #rem monkeydoc Gets the current stack state (debug builds only).
  27. In release mode, an empty array is returned.
  28. @example
  29. Namespace test
  30. Function Test2()
  31. Print "~n".Join( GetDebugStack() )
  32. End
  33. Function Test()
  34. Test2()
  35. End
  36. Function Main()
  37. Test()
  38. End
  39. @end
  40. @return A string array reprenting the current stack state.
  41. #end
  42. Function GetDebugStack:String[]()="bbDB::stack"