* Returns whether the pause event is (probably) from a cross-thread step. * @see https://github.com/microsoft/vscode-js-debug/issues/223
(event: Cdp.Debugger.PausedEvent)
| 1951 | * @see https://github.com/microsoft/vscode-js-debug/issues/223 |
| 1952 | */ |
| 1953 | private isCrossThreadStep(event: Cdp.Debugger.PausedEvent) { |
| 1954 | if (!event.asyncStackTraceId || !event.asyncStackTraceId.debuggerId) { |
| 1955 | return false; |
| 1956 | } |
| 1957 | |
| 1958 | const parent = Thread.threadForDebuggerId(event.asyncStackTraceId.debuggerId); |
| 1959 | if (!parent || !parent._waitingForStepIn?.lastDetails) { |
| 1960 | return false; |
| 1961 | } |
| 1962 | |
| 1963 | const originalStack = parent._waitingForStepIn.lastDetails.stackTrace; |
| 1964 | return parent._cdp.Debugger.getStackTrace({ stackTraceId: event.asyncStackTraceId }).then( |
| 1965 | trace => { |
| 1966 | if (!trace || !trace.stackTrace.callFrames.length) { |
| 1967 | return false; |
| 1968 | } |
| 1969 | |
| 1970 | const parentFrame = StackFrame.fromRuntime(parent, trace.stackTrace.callFrames[0], false); |
| 1971 | if (!parentFrame.equivalentTo(originalStack.frames[0])) { |
| 1972 | return false; |
| 1973 | } |
| 1974 | |
| 1975 | parent._waitingForStepIn = undefined; |
| 1976 | return true; |
| 1977 | }, |
| 1978 | ); |
| 1979 | } |
| 1980 | |
| 1981 | /** |
| 1982 | * Based on whether `pause` is true, sets or unsets an instrumentation |
no test coverage detected