Debugger.hx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package cpp.vm;
  2. // TODO: implement this
  3. typedef Breakpoint = Dynamic;
  4. typedef StackFrame = Dynamic;
  5. class Debugger
  6. {
  7. public static function setHandler(inHandler:Void->Void)
  8. {
  9. untyped __global__.__hxcpp_dbg_set_handler(inHandler);
  10. }
  11. // Generate a handler callback ASAP
  12. public static function breakASAP(?inThread:Thread)
  13. {
  14. untyped __global__.__hxcpp_dbg_break_asap(inThread);
  15. }
  16. // Stepping
  17. public static function stepOver(?inThread:Thread)
  18. {
  19. untyped __global__.__hxcpp_dbg_step_over(inThread);
  20. }
  21. public static function stepInto(?inThread:Thread)
  22. {
  23. untyped __global__.__hxcpp_dbg_step_into(inThread);
  24. }
  25. public static function stepOut(?inThread:Thread)
  26. {
  27. untyped __global__.__hxcpp_dbg_step_out(inThread);
  28. }
  29. // Breakpoint
  30. public static function addBreakpoint(inBreakpoint:Breakpoint)
  31. {
  32. return untyped __global__.__hxcpp_breakpoints_add(inBreakpoint);
  33. }
  34. public static function getBreakpoints() : Array<Breakpoint>
  35. {
  36. return untyped __global__.__hxcpp_dbg_breakpoints_get();
  37. }
  38. public static function deleteBreakpoint(inI:Int)
  39. {
  40. untyped __global__.__hxcpp_dbg_breakpoints_delete(inI);
  41. }
  42. // Thread - todo
  43. // public static function suspendAll()
  44. // Callstack
  45. public static function getStackFrames() : Array<StackFrame>
  46. {
  47. return untyped __global__.__hxcpp_dbg_stack_frames_get();
  48. }
  49. public static function getFiles() : Array<String>
  50. {
  51. return untyped __global__.__hxcpp_dbg_get_files();
  52. }
  53. public static function getClasses() : Array<Class<Dynamic> >
  54. {
  55. return untyped __global__.__hxcpp_dbg_get_classes();
  56. }
  57. }