Has anyone tried to create a mobdebug extension for VSCode?

As we know Defold uses the mobdebug, a remote debugger created and used by ZeroBraine Studio author.

This is easy to start mobdebug server separately and connect Defold game to it by using built-in mobdebug.lua script. Just download mobdebug, install luasocket and run the server via terminal:

$ lua -e "require('mobdebug').listen()"

Then run the game from Defold Editor with this script:

local mobdebug = require 'builtins.scripts.mobdebug'

function init(self)
  mobdebug.start()
end

And you will see that debugger works fine, all commands like to set breakpoint or to see the stack are available via command line with stdin/stdout.

Has anyone tried to create a mobdebug extension for VSCode? Its debugging architecture with debugger adapter protocol looks very friendly and ready to use with any debugger. The only thing left to do is to make an adapter-extension between mobdebug server and the VSCode debugging UI.

Of course, mobdebug can be used to create a debugger for any other text editor, such as Atom. But in fact Atom does’t have any official and universal debugging UI, so VSCode is more attractive here.

6 Likes

I think it’s even possible to start the mobdebug instance the same way the editor starts it. (By making a HTTP request to the engine’s debug port)

1 Like

This could be a good starting point as @Mathias_Westerdahl suggested:

Source:

Other one:

2 Likes

One more

2 Likes