Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

[wip] implement runtimeExecutable version detection #100

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
17 changes: 14 additions & 3 deletions src/nodeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,22 @@ export class NodeDebugAdapter extends ChromeDebugAdapter {
const programArgs = args.args || [];

let launchArgs = [runtimeExecutable];
let majorVersion = 7;
try {
const version = cp.execFileSync(runtimeExecutable, ['--version'], {encoding: "utf8"}).trim().slice(1);
majorVersion = Number(version.split('.').shift());
} catch (e) {
logger.log('Could not detect runtimeExecutable version assuming ' + majorVersion);
}
if (!args.noDebug && !args.port) {
launchArgs.push(`--inspect=${port}`);
if (majorVersion < 8) {
launchArgs.push(`--inspect=${port}`);

// Always stop on entry to set breakpoints
launchArgs.push('--debug-brk');
// Always stop on entry to set breakpoints
launchArgs.push('--debug-brk');
} else {
launchArgs.push(`--inspect-brk=${port}`);
}
}

this._continueAfterConfigDone = !args.stopOnEntry;
Expand Down