Merge pull request #143649 from xisui-MSFT/dev/xisui/different_top_frame

Allow stack frame without source as top stack frame when using disassembly view
This commit is contained in:
Rob Lourens 2022-03-14 16:39:18 -07:00 committed by GitHub
commit 7fb18b6633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -511,7 +511,10 @@ export class Thread implements IThread {
getTopStackFrame(): IStackFrame | undefined {
const callStack = this.getCallStack();
const firstAvailableStackFrame = callStack.find(sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize'));
// Allow stack frame without source and with instructionReferencePointer as top stack frame when using disassembly view.
const firstAvailableStackFrame = callStack.find(sf => !!(sf &&
((this.stoppedDetails?.reason === 'instruction breakpoint' || (this.stoppedDetails?.reason === 'step' && this.lastSteppingGranularity === 'instruction')) && sf.instructionPointerReference) ||
(sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize')));
return firstAvailableStackFrame || (callStack.length > 0 ? callStack[0] : undefined);
}