svaarala / duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint
MIT License
5.87k stars 514 forks source link

Chrome DevTools + Duktape #2183

Open nick-thompson opened 4 years ago

nick-thompson commented 4 years ago

Does the duktape debugging protocol support Chrome DevTools?

For example, in Node.js you can pass an --inspect flag which enables the debugger, then if you open the chrome://inspect URL inside Chrome browser you'll see that you can discover local network targets and use the builtin chrome dev tools for the debugging process. (Related reading: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27)

I imagine that Duktape could do the same, if it doesn't already, perhaps by implementing a TCP client/JSON proxy that adapts between the devtools protocol and the duktape protocol. This seems like it would make for a nice developer experience using Duktape

svaarala commented 4 years ago

There's no support for that, but there is a debugger protocol which one can interface with, see https://duktape.org/guide.html#debugger. It would indeed be nice if it would be possible to proxy between the two targets. The Duktape protocol is binary based (to support slow embedded environments including slow serial) and there's already a JSON-to-binary proxy to make accessing the target easier.