debugger.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package core
  2. import (
  3. "kumachan/standalone/util"
  4. "kumachan/standalone/util/richtext"
  5. "kumachan/lang/typsys"
  6. )
  7. type Debugger interface {
  8. CreateInstance(h RuntimeHandle) DebuggerInstance
  9. }
  10. type DebuggerInstance interface {
  11. ExitNotifier() util.ExitNotifier
  12. NotifyProgramCrash(msg richtext.Block) bool
  13. ReplInterface
  14. Inspector
  15. InputOutputActionMonitor
  16. }
  17. type ReplInterface interface {
  18. ReplEcho(cmd string, id int)
  19. ReplRespondExprValue(v Object, t typsys.CertainType, id int)
  20. ReplRespondExprError(msg richtext.Block, id int)
  21. ReplNotifyObValue(v Object, t typsys.CertainType, id int)
  22. ReplNotifyObError(err error, id int)
  23. ReplNotifyObCompletion(id int)
  24. ReplExposeValue(name string, v Object, t typsys.CertainType, info *FrameInfo) func()
  25. }
  26. type Inspector interface {
  27. InspectValue(v Object, t typsys.CertainType, info *FrameInfo, hint string)
  28. InspectError(err error, info *FrameInfo)
  29. InspectObSub(sub string, info *FrameInfo, hint string)
  30. InspectObValue(v Object, t typsys.CertainType, sub string, info *FrameInfo, hint string)
  31. InspectObError(err error, sub string, info *FrameInfo, hint string)
  32. InspectObCompletion(sub string, info *FrameInfo, hint string)
  33. InspectObContextDisposal(sub string, info *FrameInfo, hint string)
  34. }
  35. type InputOutputActionMonitor interface {
  36. LogRequest(method string, endpoint string, token string, body string, info *FrameInfo)
  37. LogFileRead(file string, info *FrameInfo)
  38. LogFileWrite(file string, content string, info *FrameInfo)
  39. }