Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripting Engine Debugger Support #1701

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

rjd15372
Copy link
Contributor

@rjd15372 rjd15372 commented Feb 10, 2025

This PR introduces the support for implementing remote debuggers in scripting engines modules.

The module API is extended with scripting engines callbacks and new functions that can be used by scripting engine modules to implement a remote debugger.

Most of the code that was used to implement the Lua debugger, was refactored and moved to the scripting_engine.c file, and only the code specific to the Lua engine, remained in the debug_lua.c file.

The SCRIPT DEBUG (YES|NO|SYNC) command was extend with an optional parameter that can be used to specify the engine name, where we want to enable the debugger. If no engine name is specified, the Lua engine is used to keep backwards compatibility.

In src/valkeymodule.h we see the module API changes. And in the helloscripting.c file we can see how to implement a simple debugger for the dummy HELLO scripting engine.

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 46.49682% with 336 lines in your changes missing coverage. Please review.

Project coverage is 71.04%. Comparing base (3828936) to head (fcee5d6).
Report is 2 commits behind head on unstable.

Files with missing lines Patch % Lines
src/scripting_engine.c 49.14% 207 Missing ⚠️
src/lua/debug_lua.c 40.14% 85 Missing ⚠️
src/eval.c 41.66% 14 Missing ⚠️
src/module.c 22.22% 14 Missing ⚠️
src/valkey-cli.c 0.00% 9 Missing ⚠️
src/lua/engine_lua.c 76.00% 6 Missing ⚠️
src/server.c 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1701      +/-   ##
============================================
- Coverage     71.10%   71.04%   -0.06%     
============================================
  Files           123      123              
  Lines         65523    65790     +267     
============================================
+ Hits          46590    46742     +152     
- Misses        18933    19048     +115     
Files with missing lines Coverage Δ
src/commands.def 100.00% <ø> (ø)
src/server.c 87.54% <66.66%> (ø)
src/lua/engine_lua.c 86.63% <76.00%> (-1.65%) ⬇️
src/valkey-cli.c 55.74% <0.00%> (-0.08%) ⬇️
src/eval.c 86.21% <41.66%> (-2.46%) ⬇️
src/module.c 9.64% <22.22%> (+0.04%) ⬆️
src/lua/debug_lua.c 35.73% <40.14%> (-3.55%) ⬇️
src/scripting_engine.c 55.06% <49.14%> (-20.80%) ⬇️

... and 13 files with indirect coverage changes

@rjd15372 rjd15372 force-pushed the scripting-engine-debug-api branch from 1ac8176 to fcee5d6 Compare February 10, 2025 14:25
@madolson
Copy link
Member

Postponing until 9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants