feat(debug): REDIS_LUA_DEBUG build flavor with in-VM Lua debugger#26
Open
fatal10110 wants to merge 1 commit into
Open
feat(debug): REDIS_LUA_DEBUG build flavor with in-VM Lua debugger#26fatal10110 wants to merge 1 commit into
fatal10110 wants to merge 1 commit into
Conversation
Adds a second WASM flavor (redis_lua.debug.{mjs,wasm}) carrying a full
step-debugging surface while leaving the default binary byte-for-byte
unchanged:
- Asyncify build with a single suspendable import, host_debug_request,
defined in an Emscripten JS library (debug_library.js) so the paused
script's Lua frames stay live while the JS host decides what to do.
- Pure-Lua debug agent (debug_agent.lua, embedded via a generated header)
owning breakpoints, step modes, stack/scopes/variables inspection and
paused-frame evaluate; C owns only the combined fuel+line hook, agent
lifecycle, and teardown back to the fuel-only hook.
- eval_debug export loads the user chunk under the script SHA so debugger
source identity matches; keeps debug/setfenv/getfenv and compiles
ldblib.c in this flavor only.
- Line events burn fuel too: count events landing inside the (hook-
disabled) agent are swallowed by the VM, so count alone cannot kill
runaway loops under the debugger.
- JS API: load({ debug: true }), engine.evalDebug(), RedisHost.
onDebugRequest, default debug asset paths; Asyncify-wrapped exports
(arity 0) are treated as sret in the ABI sniffing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a second WASM flavor (redis_lua.debug.{mjs,wasm}) carrying a full step-debugging surface while leaving the default binary byte-for-byte unchanged: