MobDebug icon indicating copy to clipboard operation
MobDebug copied to clipboard

Support for VSCode DAP protocol

Open moteus opened this issue 3 years ago • 6 comments

I'll try to add comments in the code

moteus avatar Feb 26 '22 11:02 moteus

This is a is very handy to have. Being able to support multiple debuggers is a huge win.

mavriq-dev avatar Apr 26 '22 20:04 mavriq-dev

whats the protocol used before by mobdebug? i would like to study the specs

muescha avatar Nov 21 '22 10:11 muescha

found answer to my question here:

https://github.com/pkulchenko/MobDebug/blob/f27d479f8c1693f6fce00b69cffd1754244b6bf6/src/mobdebug.lua#L1541-L1561

and in https://github.com/pkulchenko/MobDebug/issues/32

muescha avatar Nov 23 '22 18:11 muescha

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()

muescha avatar Nov 23 '22 18:11 muescha

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.

moteus avatar Dec 10 '22 07:12 moteus

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?

KuDeSnik33ra avatar Dec 16 '22 09:12 KuDeSnik33ra