MCPcopy
hub / github.com/microsoft/vscode-js-debug / _createPausedDetails

Method _createPausedDetails

src/adapter/threads.ts:1410–1592  ·  view source on GitHub ↗
(event: Cdp.Debugger.PausedEvent)

Source from the content-addressed store, hash-verified

1408 }
1409
1410 private async _createPausedDetails(event: Cdp.Debugger.PausedEvent): Promise<IPausedDetails> {
1411 // When hitting breakpoint in compiled source, we ignore source maps during the stepping
1412 // sequence (or exceptions) until user resumes or hits another breakpoint-alike pause.
1413 // TODO: this does not work for async stepping just yet.
1414 const sameDebuggingSequence = event.reason === 'assert'
1415 || event.reason === 'exception'
1416 || event.reason === 'promiseRejection'
1417 || event.reason === 'other'
1418 || event.reason === 'ambiguous';
1419
1420 const hitBreakpoints =
1421 event.hitBreakpoints?.filter(bp => !this._breakpointManager.isEntrypointCdpBreak(bp)) || [];
1422
1423 if (hitBreakpoints.length || !sameDebuggingSequence) {
1424 this._sourceContainer.clearDisabledSourceMaps();
1425 }
1426
1427 if (event.hitBreakpoints && this._sourceMapDisabler) {
1428 for (const sourceToDisable of this._sourceMapDisabler(event.hitBreakpoints)) {
1429 this._sourceContainer.disableSourceMapForSource(sourceToDisable);
1430 }
1431 }
1432
1433 const stackTrace = StackTrace.fromDebugger(
1434 this,
1435 event.callFrames,
1436 event.asyncStackTrace,
1437 event.asyncStackTraceId,
1438 );
1439
1440 if (event.data?.__rewriteAs === 'breakpoint') {
1441 return {
1442 thread: this,
1443 event,
1444 stackTrace,
1445 reason: 'breakpoint',
1446 description: l10n.t('Paused on breakpoint'),
1447 };
1448 }
1449
1450 if (event.data?.__rewriteAs === 'step') {
1451 return {
1452 thread: this,
1453 event,
1454 stackTrace,
1455 reason: 'step',
1456 description: l10n.t('Paused'),
1457 };
1458 }
1459
1460 switch (event.reason) {
1461 case 'assert':
1462 return {
1463 thread: this,
1464 event,
1465 stackTrace,
1466 reason: 'exception',
1467 description: l10n.t('Paused on assert'),

Callers 2

refreshStackTraceMethod · 0.95
_onPausedMethod · 0.95

Calls 11

fileUrlToAbsolutePathFunction · 0.90
isEntrypointCdpBreakMethod · 0.80
hasAtLocationMethod · 0.80
sourceMethod · 0.65
filterMethod · 0.45
fromDebuggerMethod · 0.45

Tested by

no test coverage detected