Commit Graph
5 Commits
Author SHA1 Message Date
西风逍遥游 040bc4576f fix(devtools): unbreak MCP eval + state capture on instance roots
DevLab's hot-reload test was failing deterministically on Linux: any --debug
run that reloads a script hit 'state reload: capture failed: root
'spritestack' is a class instance' because every module instance lives in the
Squirrel root table and Snapshot's auto-scan treated the first instance root
as a fatal capture error. With break-on-error enabled the engine paused at
the reported error, and a subsequent eve_eval deadlocked the pause pump.

- Snapshot::resolveRoots: drop OT_INSTANCE from the automatic root scan so
  module singletons / class instances are skipped instead of aborting the
  capture (plain-data roots such as gameState/lab are still captured).
- Debugger::waitWhilePaused: make the pause pump re-entrant so bytecode run
  by eve_eval / watches / breakpoint conditions while paused no longer blocks
  on the same thread's line hook (deadlock).
- test: new devtools.snapshot.skipsInstanceRootInAutoScan case.

Verified in WSL (Linux/GCC, software Vulkan + Xvfb): devlab MCP hot-reload
test 12/12 rounds, full ctest 1656/1656, all 37 example smokes pass.
2026-08-22 01:22:55 +08:00
西风逍遥游 54dea0d561 feat: state hot reload for scripts and state machines
Adds a capture -> reload -> restore pipeline so code/asset changes can be hot-applied without resetting running state:

- common: StateValue (JSON-compatible state tree) + IStateProvider capability interface.
- devtools: Snapshot v2 (script roots + native provider section, v1 compatible, strict rejection of non-data roots), ReloadSession (begin/commit/abort), eve.dev script API (stateRoots / beginStateReload / commitStateReload / abortStateReload).
- load.nut: three-phase soft reload (capture -> dofile -> restore) with migrate_instance / remap_instances helpers and eve_before_reload / eve_after_reload hooks.
- dialogue + AnimStateMachine: IStateProvider for phase/vars/rng and params/current state.
- animation: AnimClip::adopt + AnimClipRegistry + 'animclip' IAssetReloader so .eva content reloads keep clip identity.
- rpg + card: IStateProvider for casting/cooldowns and card phases.
- Tests: stateValue, snapshot v2/strict, reload script protocol, dialogue, animation state machine + reload, rpg/card state roundtrips.
2026-08-21 19:46:25 +08:00
西风逍遥游 33d5e5b870 devtools: DAP output events, variable inspect, error throw-site pause 2026-08-17 14:51:32 +08:00
sunxfancy cee6eb0266 feat(devtools): enhance debugging capabilities with DAP integration and improved CallGraph
- Added support for DAP (Debug Adapter Protocol) in the DebugAdapter, allowing for better integration with IDEs like VS Code.
- Implemented new debugging commands: stepInto, stepOver, and stepOut, enhancing script execution control.
- Updated CallGraph to use a fixed ring buffer for event storage, improving performance and memory management.
- Introduced methods for resolving source paths and managing script aliases, facilitating smoother debugging experiences.
- Enhanced documentation to reflect new features and usage instructions for debugging tools.

These changes significantly improve the debugging workflow and provide developers with more robust tools for script management and error tracing.
2026-08-09 21:51:34 +08:00
西风逍遥游andCursor Agent 8abbb134cb feat(devtools): pause, breakpoints, watches, snapshots, and VS Code DAP (#6)
* feat(devtools): pause, breakpoints, watches, snapshots, and VS Code DAP

Add a script-centric debugger: Pause key / DAP frame pause, Squirrel
breakpoints with watches, JSON snapshot of script state (stateless
engine), TCP Debug Adapter Protocol server, and a VS Code extension
under tools/vscode-eve-debug.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): correct Snapshot JSON (Poco Ptr) and DAP includes

Use Poco::JSON::Object/Array::Ptr for script-state capture/restore so
round-trips no longer BadCast; include TimeoutException via Exception.h.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): move DebugAdapter ctor to cpp for MSVC unique_ptr

MSVC rejects unique_ptr of forward-declared Poco sockets when the
default constructor is defined in the header (incomplete-type delete).

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

* fix(devtools): disable Poco auto-link on EVDevTools for MSVC

Including Poco Net/JSON without POCO_NO_AUTOMATIC_LIBS makes the
Windows linker request PocoFoundationd.lib instead of PocoFoundationmdd.

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-09 09:41:58 +08:00