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

Use fork instead of spawn for AppWorker #760

Merged
merged 3 commits into from
Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/debugger/forkedAppWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ export class ForkedAppWorker implements IDebuggeeWorker {
// Note that we set --debug-brk flag to pause the process on the first line - this is
// required for debug adapter to set the breakpoints BEFORE the debuggee has started.
// The adapter will continue execution once it's done with breakpoints.
const nodeArgs = [`--inspect=${port}`, "--debug-brk", scriptToRunPath];
const nodeArgs = [`--inspect=${port}`, "--debug-brk"];
// Start child Node process in debugging mode
this.debuggeeProcess = child_process.spawn("node", nodeArgs, {
stdio: ["pipe", "pipe", "pipe", "ipc"],
})
this.debuggeeProcess = child_process.fork(scriptToRunPath, nodeArgs)
.on("message", (message: any) => {
// 'workerLoaded' is a special message that indicates that worker is done with loading.
// We need to wait for it before doing any IPC because process.send doesn't seems to care
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/nodeDebugWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function makeSession(
private launch(request: DebugProtocol.Request): void {
this.requestSetup(request.arguments)
.then(() => {
logger.verbose(`Handle launch request: ${request.arguments}`);
logger.verbose(`Handle launch request: ${JSON.stringify(request.arguments, null , 2)}`);
return this.remoteExtension.launch(request);
})
.then(() => {
Expand Down