Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspector: migrate process.binding to internalBinding #24931

Closed
wants to merge 1 commit into from

Conversation

@BeniCheni
Copy link
Contributor

commented Dec 10, 2018

Refs #22160, this PR attempts to migrate process.binding('inspector') to internalBinding('inspector').

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
inspector: migrate process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

Refs: #22160
@joyeecheung

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

@BeniCheni

This comment has been minimized.

Copy link
Contributor Author

commented Dec 10, 2018

Hi reviewers,

Would like some mentoring on these observations.

Couldn't change these inline code w. process.binding('inspector'). If using internalBinding('inspector'), tests seemed to failed with ReferenceError: internalBinding is not defined:

return `process.binding('inspector')...`
const script = `
  ...
  if (!process.binding('inspector').isEnabled()) return;
const script = `
...
const inspector = process.binding('inspector');

Another observation is when seemingly inside a child process, I would also run into failed test if using internalBinding

if (process.argv[2] === 'child') {
  ...
  const { registerAsyncHook } = process.binding('inspector');

P.S.: I've experimented w. // Flags: --expose-internals & const { internalBinding } = require('internal/test/binding');, but no luck.

@devsnek

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

wrapForBreakOnFirstLine is concerning. i think we should be able to use the inspector api to set a breakpoint instead of modifying the code? cc @nodejs/v8-inspector

@joyeecheung

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

@BeniCheni

For the test failures (ReferenceErrors), you'd need to obtain internalBinding via const { internalBinding } = require('internal/test/binding'); (which also needs --expose-internals)

For the wrapForBreakOnFirstLine, maybe instead of wrapping the source and pass it to callAndPauseOnStart, prepending a debugger; statement to the source would work, but I am not really sure

@joyeecheung

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

BTW, do we even need to wrap that in wrapForBreakOnFirstLine? module._compile is already wrapping the source with callAndPauseOnStart if process._breakFirstLine is true

@joyeecheung

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

I implemented the part about -e --inspect-brk in #24946 since it involves quite of bit of changes in the inspector tests.

@danbev

This comment has been minimized.

Copy link
Member

commented Dec 13, 2018

Landed in 0500237.

@danbev danbev closed this Dec 13, 2018

danbev added a commit that referenced this pull request Dec 13, 2018
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: #24931
Refs: #22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

@BeniCheni BeniCheni deleted the BeniCheni:inspector-internal-binding branch Dec 13, 2018

@MylesBorins

This comment has been minimized.

Copy link
Member

commented Dec 25, 2018

This doesn't land cleanly on v11.x, would someone be willing to make a backport?

@targos targos added this to Backport requested in v11.x Dec 28, 2018

@BeniCheni BeniCheni referenced this pull request Jan 6, 2019
32 of 33 tasks complete
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 9, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: nodejs#24931
Refs: nodejs#22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 9, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: nodejs#24931
Refs: nodejs#22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@BridgeAR BridgeAR referenced this pull request Jan 9, 2019
4 of 4 tasks complete
BridgeAR added a commit that referenced this pull request Jan 10, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: #24931
Refs: #22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

@BridgeAR BridgeAR moved this from Backport requested to Backported in v11.x Jan 10, 2019

joyeecheung added a commit to joyeecheung/node that referenced this pull request Jan 11, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: nodejs#24931
Refs: nodejs#22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax added a commit that referenced this pull request Jan 14, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: #24931
Refs: #22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax added a commit that referenced this pull request Jan 14, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: #24931
Refs: #22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

Backport-PR-URL: #25446
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: nodejs#24931
Refs: nodejs#22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@BridgeAR BridgeAR referenced this pull request Jan 16, 2019
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: nodejs#24931
Refs: nodejs#22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt
internalBinding.

PR-URL: nodejs#24931
Refs: nodejs#22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

Backport-PR-URL: nodejs#25446
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
9 participants
You can’t perform that action at this time.