Commit fbe26dd
authored
Debugger (#1410)
* Add debugger backend.
This adds on a debugger to the evaluation loop, that allows for pausing,
saving state, then resuming from saved state.
* DAP debug server, multi-thread debugging, and iterative interpreter debug support
- Add MSDebugServer implementing the Debug Adapter Protocol over TCP,
with launch/attach modes, breakpoints, step-over/step-in/step-out,
variable inspection, exception breakpoints, and watch expressions
- Add multi-thread DAP support: register/unregister threads, per-thread
pause states, sync and async stepping modes (sync blocks in place,
async snapshots state and resumes on a new thread)
- Refactor DebugContext into a full thread-aware debug state manager with
per-thread StepMode, ThreadDebugState, and a thread registry for DAP
- Add DaemonManager lifecycle listeners and thread-aware waitForThreads,
so the debug session stays alive while background threads run
- Extract spawnExecutionThread() to centralize execution thread lifecycle
(run, await daemons, signal completion) in one place
- Fix StackTraceManager thread affinity: remove isDebugAdopted flag so
background threads (x_new_thread) get their own STM instead of sharing
the main thread's, which was corrupting call depth for step-over
- Fix skippingResume flag: clear unconditionally on source line change
rather than requiring shouldStop=true, which blocked step-over returns
- Add StackTraceFrame.getTarget() for debugger source mapping
- Add Breakpoint condition/hitCount/logMessage support
- Wire up cmdline interpreter (--debug flag) and lang server for DAP
- Add DAPTestHarness and dual sync/async integration tests for step-over
and multi-thread step-over scenarios
- Add debugger dependency (lsp4j.debug) to pom.xml
* Add logpoint support
* Add attach mode and KEYPAIR security
* Add docs and final touches
* Debug infrastructure: managed mode, hit-count dedup, and comprehensive tests
- Enable managed execution mode in CommandHelperPlugin so the debug
session survives script completion on embedded (Minecraft) servers
- Fix hit-count breakpoint deduplication: multiple AST nodes on the same
source line no longer increment the hit counter more than once per
visit. Uses column-based caching in ThreadDebugState to distinguish
"same line, different node" from "new loop iteration, same first node"
- Add evaluateBreakpointCondition() to DebugContext with per-thread
cache-aware hit-count and condition evaluation
- Add Breakpoint.getHitCount() getter
- Add MSDebugServer managed mode support: setManagedExecution(),
startedOnHostMainThread capture, resumeOnHostMainThread() for
resuming on the server main thread, dynamic scripting mode flag
in evaluate handler
- Add 21 new DAP integration tests (39 total) covering: managed mode
step-over, thread events, disconnect; variables/scopes; CArray
expansion (indexed, associative, nested); evaluate expressions;
exception breakpoints; conditional and hit-count breakpoints;
step-in, step-out, step-in targets; disconnect resumes execution
* Fix flakey test1 parent 1eb61de commit fbe26dd
File tree
44 files changed
+6144
-445
lines changed- src
- main
- java/com/laytonsmith
- PureUtilities
- Common
- commandhelper
- core
- constructs
- environments
- exceptions
- CRE
- functions
- natives/interfaces
- tools
- debugger
- langserv
- resources
- docs
- test/java/com/laytonsmith/core
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+6144
-445
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
| 136 | + | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
| |||
489 | 494 | | |
490 | 495 | | |
491 | 496 | | |
492 | | - | |
| 497 | + | |
493 | 498 | | |
494 | 499 | | |
495 | 500 | | |
| |||
569 | 574 | | |
570 | 575 | | |
571 | 576 | | |
| 577 | + | |
| 578 | + | |
572 | 579 | | |
573 | 580 | | |
574 | 581 | | |
| |||
842 | 849 | | |
843 | 850 | | |
844 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
845 | 870 | | |
846 | 871 | | |
847 | 872 | | |
| |||
0 commit comments