| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 69cfb2f commit 9098585
24 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -505,13 +505,15 @@ class ProbeInspectorSession { | |||
| 505 | 505 | ||
| 506 | 506 | onChildOutput(text, which) { | |
| 507 | 507 | if (which !== 'stderr') { return; } | |
| 508 | + debug('child stderr: %j', text); | ||
| 508 | 509 | ||
| 509 | 510 | this.childStderr += text; | |
| 510 | 511 | ||
| 511 | 512 | const combined = this.disconnectSentinelBuffer + text; | |
| 512 | 513 | // Detect the disconnect sentinel. | |
| 513 | 514 | if (this.connected && | |
| 514 | 515 | StringPrototypeIncludes(combined, kProbeDisconnectSentinel)) { | |
| 516 | + debug('disconnect sentinel detected, resetting client'); | ||
| 515 | 517 | this.disconnectRequested = true; | |
| 516 | 518 | this.client.reset(); | |
| 517 | 519 | } | |
@@ -587,6 +589,7 @@ class ProbeInspectorSession { | |||
| 587 | 589 | } | |
| 588 | 590 | ||
| 589 | 591 | onPaused(params) { | |
| 592 | + debug('paused: finished=%d, reason=%s hitBreakpoints=%j', this.finished, params.reason, params.hitBreakpoints); | ||
| 590 | 593 | this.handlePaused(params).catch((error) => { | |
| 591 | 594 | if (error === kInspectorFailedSentinel) { return; } | |
| 592 | 595 | this.recordInspectorFailure({ | |
@@ -841,6 +844,9 @@ class ProbeInspectorSession { | |||
| 841 | 844 | } | |
| 842 | 845 | ||
| 843 | 846 | onScriptParsed(params) { | |
| 847 | + if (params.url && !StringPrototypeStartsWith(params.url, 'node:')) { | ||
| 848 | + debug('scriptParsed: scriptId=%s url=%s, length=%d', params.scriptId, params.url, params.length); | ||
| 849 | + } | ||
| 844 | 850 | // This map grows by the number of scripts parsed, which is limited, and is just a | |
| 845 | 851 | // small string -> string map. The lifetime is bounded by probe timeout etc. so cleanup is overkill. | |
| 846 | 852 | this.scriptIdToUrl.set(params.scriptId, params.url); | |
@@ -883,6 +889,8 @@ class ProbeInspectorSession { | |||
| 883 | 889 | } | |
| 884 | 890 | ||
| 885 | 891 | const result = await this.callCdp('Debugger.setBreakpointByUrl', params); | |
| 892 | + debug('breakpoint set: id=%s urlRegex=%s locations=%j', | ||
| 893 | + result.breakpointId, params.urlRegex, result.locations); | ||
| 886 | 894 | this.breakpointDefinitions.set(result.breakpointId, { probeIndices }); | |
| 887 | 895 | } | |
| 888 | 896 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ spawnSyncAndAssert(process.execPath, [ | |||
| 16 | 16 | '--probe', 'probe-bound-never-hit.js:4', | |
| 17 | 17 | '--expr', '1', | |
| 18 | 18 | 'probe-bound-never-hit.js', | |
| 19 | - ], { cwd }, { | ||
| 19 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 20 | 20 | stdout(output) { | |
| 21 | 21 | assertProbeJson(output, { | |
| 22 | 22 | v: 2, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ spawnSyncAndAssert(process.execPath, [ | |||
| 19 | 19 | '--', | |
| 20 | 20 | '--inspect-port=0', | |
| 21 | 21 | 'probe.js', | |
| 22 | - ], { cwd }, { | ||
| 22 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 23 | 23 | stdout(output) { | |
| 24 | 24 | assertProbeJson(output, { | |
| 25 | 25 | v: 2, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ spawnSyncAndAssert(process.execPath, [ | |||
| 24 | 24 | '--probe', 'probe-multi-statement.js:5:29', | |
| 25 | 25 | '--expr', 'acc.length', | |
| 26 | 26 | 'probe-multi-statement.js', | |
| 27 | - ], { cwd }, { | ||
| 27 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 28 | 28 | stdout(output) { | |
| 29 | 29 | assertProbeJson(output, { | |
| 30 | 30 | v: 2, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ spawnSyncAndExit(process.execPath, [ | |||
| 23 | 23 | '--probe', `${fixture}:16`, '--expr', probes[0].expr, | |
| 24 | 24 | '--probe', `${fixture}:17`, '--expr', probes[1].expr, | |
| 25 | 25 | fixture, | |
| 26 | - ], { cwd }, { | ||
| 26 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 27 | 27 | status: 0, | |
| 28 | 28 | signal: null, | |
| 29 | 29 | stdout(output) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ spawnSyncAndExit(process.execPath, [ | |||
| 24 | 24 | '--probe', `${fixture}:10`, '--expr', probes[0].expr, | |
| 25 | 25 | '--probe', `${fixture}:11`, '--expr', probes[1].expr, | |
| 26 | 26 | fixture, | |
| 27 | - ], { cwd }, { | ||
| 27 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 28 | 28 | status: 1, | |
| 29 | 29 | signal: null, | |
| 30 | 30 | stdout(output) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ spawnSyncAndExit(process.execPath, [ | |||
| 18 | 18 | 'inspect', '--json', | |
| 19 | 19 | '--probe', `${fixture}:8`, '--expr', probes[0].expr, | |
| 20 | 20 | fixture, | |
| 21 | - ], { cwd }, { | ||
| 21 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 22 | 22 | status: 1, | |
| 23 | 23 | signal: null, | |
| 24 | 24 | stdout(output) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ spawnSyncAndAssert(process.execPath, [ | |||
| 17 | 17 | '--expr', 'finalValue', | |
| 18 | 18 | '--json', | |
| 19 | 19 | 'probe.js', | |
| 20 | - ], { cwd }, { | ||
| 20 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 21 | 21 | stdout(output) { | |
| 22 | 22 | assertProbeJson(output, { | |
| 23 | 23 | v: 2, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ spawnSyncAndAssert(process.execPath, [ | |||
| 24 | 24 | '--probe', probeArg, | |
| 25 | 25 | '--expr', 'errorValue', | |
| 26 | 26 | 'probe-types.js', | |
| 27 | - ], { cwd }, { | ||
| 27 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 28 | 28 | stdout(output) { | |
| 29 | 29 | assertProbeJson(output, { | |
| 30 | 30 | v: 2, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ spawnSyncAndAssert(process.execPath, [ | |||
| 39 | 39 | '--probe', probeArg, | |
| 40 | 40 | '--expr', 'errorValue', | |
| 41 | 41 | 'probe-types.js', | |
| 42 | - ], { cwd }, { | ||
| 42 | + ], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, { | ||
| 43 | 43 | stdout(output) { | |
| 44 | 44 | assertProbeJson(output, { | |
| 45 | 45 | v: 2, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments