From b49d7982d68f87d4ef4054f5697bf3efe86efbbf Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 13 Sep 2022 15:34:39 +0100 Subject: [PATCH] When looking for the start of an line, ignore if there's no debug info * When searching for the start of a range of instructions mapped to a single line when stepping backwards, we need to ignore instructions that don't have any debug info because they will look like a 'different' smaller stack. --- qrenderdoc/Windows/ShaderViewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index bd7e0685f..2d88c79eb 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -2170,8 +2170,8 @@ bool ShaderViewer::step(bool forward, StepMode mode) // keep going until we hit the closest instruction of any block that maps to this function while(!IsFirstState() && !targetInsts.contains(GetCurrentState().nextInstruction)) { - if((oldStack == GetPreviousState().callstack || - oldStack.size() > GetPreviousState().callstack.size()) && + const rdcarray &prevStack = GetPreviousState().callstack; + if((oldStack == prevStack || (!prevStack.empty() && oldStack.size() > prevStack.size())) && !oldLine.SourceEqual(GetPreviousInstInfo().lineInfo)) { // if we hit this case, it means we jumped to an instruction in the same call which maps