Open moteus opened 2 years ago
This is a is very handy to have. Being able to support multiple debuggers is a huge win.
whats the protocol used before by mobdebug? i would like to study the specs
found answer to my question here:
i asked the question because: when the functionality is equal to both debug protocols then i would not mix the implementation into one file. when something changes then it need to implemented in both protocols on 2 places (DRY)
i would like to see some main functionality and then implement the adapter pattern either for mobdebug protocol or for debug adapter protocol.
local mobdebug = require("mobdebug").adapter("dap").start()
local mobdebug = require("mobdebug").start()
I thought about it and even tried to do such a split, but I couldn't do this.
The mobdebug.lua
file is a self-contained module with a debug server and debug client simultaneously.
It contains code that depends on a file name and a call stack size.
So as a result, I got some unexplainable errors when adding additional layers to this code.
I had code with two classes, DapLoop and MobDebugLoop, but I could not fix or even understood some glitches and ended up with a more straightforward implementation.
If speaking about require("mobdebug").adapter("dap").start()
right now, I see no necessity in such because it is pretty easy to detect client protocol by the first message.
PS. Right now, I use my module with ZBS, and several colleagues use it with VSCode without any issues.
Is there some manual on how to use it with vscode? Isn't there any chance to have multiple connections from debugged application to singe vscode server to debug multiple lua VMs simultaneousely without starting multiple debugging sessions in VSCode?
I'll try to add comments in the code