Skip to content

inspector: support non-V8 dispatchers #7393

@joshgav

Description

@joshgav

Background

In #7266 (comment) we began discussing separating the Inspector Protocol front-end from the V8-specific backend implementation in Google's v8_inspector contribution.

I believe we should do this so that the same Inspector Agent and Protocol Gateway in Node.js work with multiple backend implementations, starting with V8 Inspector. This would let other VM vendors create backends optimized for their APIs and capabilities, and would facilitate others adding new capabilities to the protocol through their own implementations.

If we don't do this other VMs would have to provide an alternate agent, gateway, and backend implementation for their diagnostic system; or provide (yet another) shim to V8's C++ diagnostic APIs.

Proof of Concept

To prove the concept, I implemented most of the separation in just this small commit: joshgav@5f2507d. The main changes are:

  • Add Inspector.h|cpp to ./deps/v8_inspector/platform/inspector_protocol as base class for all backend implementations, starting with V8Inspector in ./deps/v8_inspector/platform/v8_inspector/public/V8Inspector.h.
  • Refactor v8_inspector.gyp file into two - one for generating and compiling the protocol frontend and one for the backend implementation.
  • Configure ./src/inspector_agent.h|cc to dynamically load the correct backend implementation.
    • Note: Marked with a TODO because there are several ways to do this.

So, @nodejs/collaborators and @pavelfeldman:

  • In theory, what do you think of the proposal?
  • In practice, how can we implement this in cooperation with upstream?

One option could be to create an "inspector-gateway" repo in the nodejs org and maintain the protocol frontend there as an open project. We'd then include it in ./deps like other upstream dependencies.


Related

/cc @nodejs/diagnostics @thealphanerd @ofrobots @pavelfeldman @nodejs/chakracore @ehsan

Edits:
edit (2016-06-24): fix issue title to better match conventions

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussIssues opened for discussions and feedbacks.inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions