I’m not sure if many people are aware of the work which has been done with
Firefox’s WebIDE,
which is available using Shift-F8 in the latest versions.
If has the very handy ability to remotely debug Safari, Chrome and Firefox
on local and devices via USB,
all via a single interface, especially handy if you want to debug iOS web
apps from a windows machine
It uses Valance https://developer.mozilla.org/en-US/docs/Tools/Valence to
interface to the different
debugging protocols.
I was wondering if it would be possible/practical to hook this up to Lucee
to allow server side debugging?
z
Chrome dev tools now has supporting for debugging nodejs (aka server side
code)
nodejs:master
← ofrobots:v8-inspector
opened 08:27PM - 16 May 16 UTC
For background see: https://github.com/nodejs/node/issues/2546#issuecomment-1893… 11746
This PR brings in v8_inspector support to Node.js (currently behind a compile time flag.) This means Node.js can now be debugged and profiled via the [Chrome Debugging Protocol](https://developer.chrome.com/devtools/docs/debugger-protocol), which enables inspection via Chrome DevTools and other tools & IDEs. So far, v8_inspector includes support for the following protocol domains: [Debugger](https://chromedevtools.github.io/debugger-protocol-viewer/v8/Debugger/), [Profiler](https://chromedevtools.github.io/debugger-protocol-viewer/v8/Profiler/), [Runtime](https://chromedevtools.github.io/debugger-protocol-viewer/v8/Runtime/), [HeapProfiler](https://chromedevtools.github.io/debugger-protocol-viewer/v8/HeapProfiler/)
In the Chrome DevTools client, the following is now available:
- Complete breakpoint debugging, stepping w/ blackboxing
- Source maps for transpiled code
- LiveEdit: JavaScript hot-swap evaluation w/ V8
- Console evaluation with ES6 feature/object support and [custom object formatting](https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/view)
- Sampling JavaScript profiler w/ flamechart
- Heap snapshot inspection, heap allocation timeline, allocation profiling
- Asynchronous stacks for native promises
There is more functionality that could be implemented, but we've reached a good point to get input from the community on the feature set and on the integration with Node.js core.
This PR has two logical sets of changes:
### Bring in v8_inspector as a dependency
`v8_inspector` used to be part of Blink. We have removed almost all of the dependencies on Blink and are working on getting this code merged directly into V8 – the biggest piece remaining is integrating the DevTools tests into the V8 test infrastructure. However, this work will likely complete in V8 5.3 / 5.4 timeframe. If we wait for this upstream change, it would mean the improved debugging experience would not be available to Node.js v6.x LTS users.
In the meantime, we propose to bring the v8_inspector dependency directly into Node.js. This dependency can be dropped once v8_inspector merges upstream into V8 (in Node.js v7.x timeframe).
### Node.js support for the v8_inspector protocol
The support for talking to v8_inspector protocol is primarily in `node_inspector.cc`. We also needed support for a subset of the websockets protocol to be able to talk to DevTools. We have implemented this based on the websockets implementation from Chromium. We are calling it the 'inspector socket protocol' as it is not a complete websockets implementation, although it could be extended. This protocol is _not_ available to userspace JavaScript code, and is accessible only to internal C++ code in core.
The implementation is behind a compile time flag controlled by the `--with-inspector` configure flag.
## Usage
```
$ make -j8
$ ./node --inspect benchmark/http_simple.js
Debugger listening on port 5858. To start debugging, open following URL in Chrome:
chrome-devtools://devtools/remote/serve_file/@4604d24a75168768584760ba56d175507941852f/inspector.html?experiments=true&v8only=true&ws=localhost:5858/node
```
You can attach Chrome DevTools by opening the printed url in a Chrome browser.

By default, the debugging port is 5858. You can optionally specify an alternate port via the `--inspect=9229` flag. If you want the debugger to pause on application start, you can additional pass the `--debug-brk` flag. For example:
```
$ ./node --inspect=9229 --debug-brk benchmark/http_simple.js
Debugger listening on port 9229. To start debugging, open following URL in Chrome:
chrome-devtools://devtools/remote/serve_file/@4604d24a75168768584760ba56d175507941852f/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node
```
Getting this merged into Node.js would allow people to test the DevTools integration and allow proper debugging to be well-tested and stable well in time for the release of the 6.x LTS. It would also enable third-party debug tool writers to start building other debugging and profiling tools that work with Node.js.
Thanks for the review.
/cc @repenaxa, @eugeneo, @paulirish
Something which might nice to consider for the roadmap with Lucee
It’s one of the things demo-ed in this really informative video which I
highly
recommend watching to see what’s been add/improved in Chrome Dev Tools
Debugging The Web (Chrome Dev Summit 2016)
https://www.youtube.com/watch?v=HF1luRD4QmkOn Wednesday, 7 October 2015 15:02:47 UTC+11, Zac Spitzer wrote:
I’m not sure if many people are aware of the work which has been done with
Firefox’s WebIDE,
which is available using Shift-F8 in the latest versions.
Firefox Profiler - Documentation
If has the very handy ability to remotely debug Safari, Chrome and Firefox
on local and devices via USB,
all via a single interface, especially handy if you want to debug iOS web
apps from a windows machine
It uses Valance https://developer.mozilla.org/en-US/docs/Tools/Valence to
interface to the different
debugging protocols.
I was wondering if it would be possible/practical to hook this up to Lucee
to allow server side debugging?
z