Skip to content

inspector: split the HostPort being used and the one parsed from CLI

Instead of using a shared pointer of the entire debug option set, pass the parsed debug option to inspector classes by value because they are set once the CLI argument parsing is done. Add another shared pointer to HostPort being used by the inspector server, which is copied from the one in the debug options initially. The port of the shared HostPort is 9229 by default and can be specified as 0 initially but will be set to the actual port of the server once it starts listening.

This makes the shared state clearer and makes it possible to use require('internal/options') in JS land to query the CLI options instead of using process._breakFirstLine and other underscored properties of process since we are now certain that these values should not be altered once the parsing is done and can be passed around in copies without locks.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading