Skip to content

inspector: normalized script URL in inspector protocol #22223

@alexkozy

Description

@alexkozy
  • Version: each starting Node 6 when Node gets V8Inspector.
  • Platform: all.
  • Subsystem: inspector.

V8Inspector exposes protocol for inspection and debugging node state. There are a lot of different URL exposures:

Node internally uses the platform-specific path as script URL in some cases and file URL in other (see --experimental-modules). It makes using protocol much harder, e.g., when we need to set breakpoint ahead of time, we need to generate RegExp that will match platform-specific path and file URL to be ready for a different way how Node executes module.

I have a plan to make everything better:

  1. Add new V8InspectorClient method: resourceNameToURL. V8Inspector calls this method whenever getting a new URL from Node, e.g., when the new script is parsed.
  2. Implement this method for Node. Node implementation will normalize the platform-specific path to the file URL.
  3. Backport these two patches through Node 10 back to 8 since they should not affect anything in runtime and will make a life of different Node tools much easier.

Metadata

Metadata

Assignees

Labels

inspectorIssues and PRs related to the V8 inspector protocol

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions