-
Notifications
You must be signed in to change notification settings - Fork 955
Scripting Engine Debugger Support #1701
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1701 +/- ##
============================================
- Coverage 72.58% 72.37% -0.22%
============================================
Files 128 128
Lines 71326 71626 +300
============================================
+ Hits 51772 51839 +67
- Misses 19554 19787 +233
🚀 New features to boost your workflow:
|
1ac8176 to
fcee5d6
Compare
|
Postponing until 9.0. |
zuiderkwast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this pending comment since forever. Posting it now.
We talked about this in a core team meeting. We said that nobody uses the Lua debugger and that we could basically deprecate it. No meed to make this large change to extend the debugger support. The main reason to do it is to avoid breaking it if we move Lua to a module?
Correct. This is required if we want to keep the debugger feature for Lua when moving Lua to a module. |
zuiderkwast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to see Lua moved into a module. To keep backward compat behaviour here, we need to make it load by default and add some new config to disable loading the default modules. But that's a future PR.
Regarding deeping or deleting the debugger, I think it's safer to keep the debugger, so I guess we should get this merged.
I'm fine with merging this without too detailed review, as long as it has been tested. Preferably we should test the ABI compatibility too, at least manually. Old Valkey should ignore new module's debugger callbacks. New Valkey should work (not crash on SCRIPT DEBUG, etc.) with module compiled for old valkeymodule.h.
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
fcee5d6 to
574faac
Compare
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
|
@zuiderkwast I've updated the PR, and addressed your comments. Added new tests and fixed some bugs that appeared in the tests. |
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
|
@zuiderkwast I've updated this PR with the current unstable branch. We should get this PR merged so I can open the PR that moves the lua engine into a module. |
zuiderkwast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's get this merged.
You need to commit the generated file commands.def.
zuiderkwast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to get @madolson's eyes on the module API before we merge this.
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
zuiderkwast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speed review, but it seems safe enough. I'm not worried about the debugger, but only about breaking the regular scripting with the refactoring. We have good test coverage for scripting though so I think it's safe.
|
@madolson do you want to review the module API additions? |
Signed-off-by: Ricardo Dias <[email protected]>
|
I believe we can merge this without waiting for the others to review it, so we can unblock the other work. If there are any concerns regarding the module API, we have time to change it until 9.1. It needs some rebase now and bump the scripting engine API version to 3? |
Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
|
@zuiderkwast yes, I've fixed the merge conflicts and updated the code accordingly. Run a few more tests and looks good. Will merge this now. |
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](https://github.com/valkey-io/valkey/pull/1701/files#diff-b91520205c29a3a5a940786e509b2f13a5e73a1ac2016be773e62ea64c7efb28) 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. --------- Signed-off-by: Ricardo Dias <[email protected]>
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](https://github.com/valkey-io/valkey/pull/1701/files#diff-b91520205c29a3a5a940786e509b2f13a5e73a1ac2016be773e62ea64c7efb28) 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. --------- Signed-off-by: Ricardo Dias <[email protected]>
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.cfile, and only the code specific to the Lua engine, remained in thedebug_lua.cfile.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.cfile we can see how to implement a simple debugger for the dummy HELLO scripting engine.