MCPcopy Index your code
hub / github.com/nodejs/node / setupDebugger

Function setupDebugger

test/parallel/test-inspector-break-when-eval.js:14–36  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

12const script = fixtures.path('inspector-global-function.mjs');
13
14async function setupDebugger(session) {
15 console.log('[test]', 'Setting up a debugger');
16 const commands = [
17 { 'method': 'Runtime.enable' },
18 { 'method': 'Debugger.enable' },
19 { 'method': 'Debugger.setAsyncCallStackDepth',
20 'params': { 'maxDepth': 0 } },
21 { 'method': 'Runtime.runIfWaitingForDebugger' },
22 ];
23 await session.send({ method: 'NodeRuntime.enable' });
24 await session.waitForNotification('NodeRuntime.waitingForDebugger');
25 await session.send(commands);
26 await session.send({ method: 'NodeRuntime.disable' });
27
28 await session.waitForNotification('Debugger.paused', 'Initial pause');
29
30 // NOTE(mmarchini): We wait for the second console.log to ensure we loaded
31 // every internal module before pausing. See
32 // https://bugs.chromium.org/p/chromium/issues/detail?id=1246905
33 const waitForReady = session.waitForConsoleOutput('log', 'Ready!');
34 session.send({ 'method': 'Debugger.resume' });
35 await waitForReady;
36}
37
38async function breakOnLine(session) {
39 console.log('[test]', 'Breaking in the code');

Callers 1

runTestsFunction · 0.85

Calls 4

waitForNotificationMethod · 0.80
waitForConsoleOutputMethod · 0.80
sendMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…