(event: Cdp.Debugger.PausedEvent)
| 808 | } |
| 809 | |
| 810 | _createPausedDetails(event: Cdp.Debugger.PausedEvent): IPausedDetails { |
| 811 | // When hitting breakpoint in compiled source, we ignore source maps during the stepping |
| 812 | // sequence (or exceptions) until user resumes or hits another breakpoint-alike pause. |
| 813 | // TODO: this does not work for async stepping just yet. |
| 814 | const sameDebuggingSequence = |
| 815 | event.reason === 'assert' || |
| 816 | event.reason === 'exception' || |
| 817 | event.reason === 'promiseRejection' || |
| 818 | event.reason === 'other' || |
| 819 | event.reason === 'ambiguous'; |
| 820 | |
| 821 | const hitAnyBreakpoint = !!(event.hitBreakpoints && event.hitBreakpoints.length); |
| 822 | if (hitAnyBreakpoint || !sameDebuggingSequence) this._sourceContainer.clearDisabledSourceMaps(); |
| 823 | |
| 824 | if (event.hitBreakpoints && this._sourceMapDisabler) { |
| 825 | for (const sourceToDisable of this._sourceMapDisabler(event.hitBreakpoints)) |
| 826 | this._sourceContainer.disableSourceMapForSource(sourceToDisable); |
| 827 | } |
| 828 | |
| 829 | const stackTrace = StackTrace.fromDebugger( |
| 830 | this, |
| 831 | event.callFrames, |
| 832 | event.asyncStackTrace, |
| 833 | event.asyncStackTraceId, |
| 834 | ); |
| 835 | |
| 836 | switch (event.reason) { |
| 837 | case 'assert': |
| 838 | return { |
| 839 | thread: this, |
| 840 | stackTrace, |
| 841 | reason: 'exception', |
| 842 | description: localize('pause.assert', 'Paused on assert'), |
| 843 | }; |
| 844 | case 'debugCommand': |
| 845 | return { |
| 846 | thread: this, |
| 847 | stackTrace, |
| 848 | reason: 'pause', |
| 849 | description: localize('pause.debugCommand', 'Paused on debug() call'), |
| 850 | }; |
| 851 | case 'DOM': |
| 852 | return { |
| 853 | thread: this, |
| 854 | stackTrace, |
| 855 | reason: 'data breakpoint', |
| 856 | description: localize('pause.DomBreakpoint', 'Paused on DOM breakpoint'), |
| 857 | }; |
| 858 | case 'EventListener': |
| 859 | return this._resolveEventListenerBreakpointDetails(stackTrace, event); |
| 860 | case 'exception': |
| 861 | return { |
| 862 | thread: this, |
| 863 | stackTrace, |
| 864 | reason: 'exception', |
| 865 | description: localize('pause.exception', 'Paused on exception'), |
| 866 | exception: event.data as Cdp.Runtime.RemoteObject | undefined, |
| 867 | }; |
no test coverage detected