tarantool icon indicating copy to clipboard operation
tarantool copied to clipboard

Builtin debugger PoC

Open tsafin opened this issue 3 years ago • 2 comments

Early PoC to introduce builtin debugger into Tarantool console.

Based on https://github.com/slembcke/debugger.lua.git

tsafin avatar Feb 08 '22 12:02 tsafin

It's not yet enabled via command-line -ldb (as in Redis debugger), but need to be activated manually via require 'debugger'() https://gist.github.com/335357f394c7d984090c9fe1c7319a45

tsafin avatar Feb 08 '22 12:02 tsafin

TODO

  • [ ] Integrate Debugger into Tarantool shell script;
    • [ ] -d option to activate debugger mode;
    • [ ] switch between debugger and standard REPL via some commands;
  • [x] Tarantool Debugger launcher;
  • [x] Fix broken single step 'n';
  • [ ] Fix debug.debug() hanging in Tarantool (i.e. use standard console.c facilities to work with readline API);
  • [x] break command via single-line steps;
    • [ ] fix step_over after ffi calls;
  • [ ] break command via HALT patch (flush jit generated code, modify bytecode, disable JIT);
  • [ ] ~~vscode exension calling default debugger scenario (my debugger.lua);~~
    • (we still need something for remote networking);
  • [ ] plan A: implement DAP in Lua, create extension using it:
    • [ ] in vscode;
    • [ ] in vim;
  • [x] plan B: modify local-lua-debug extension to debug Tarantool. (vscode-tdbg launcher)
    • [x] convert ffi code to LuaC to retrieve @builtin source code;

Not a goal (yet):

  • [ ] remote debug (modified moddebug.lua);
  • [ ] vscode extension calling moddebug.lua;

tsafin avatar May 27 '22 10:05 tsafin

Coverage Status

Coverage increased (+0.01%) to 85.115% when pulling 6e4f686aa4a9f74081e552b057ec8d836f62a03a on tsafin:tsafin/debugger-poc into 215630e6f6c429f96c7d210b200d9d241c374f9a on tarantool:master.

coveralls avatar Oct 24 '22 13:10 coveralls

Close, as parts of this branch have been extracted to separate pull-requests.

tsafin avatar Mar 29 '23 08:03 tsafin