From eb01d2dead1f0d1fd92980baf73c6ccb173f1249 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Thu, 19 Sep 2024 11:24:18 +0100 Subject: [PATCH] DXIL Debugger find the entry point in GetLineInfo --- .../driver/shaders/dxil/dxil_reflect.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/shaders/dxil/dxil_reflect.cpp b/renderdoc/driver/shaders/dxil/dxil_reflect.cpp index 9d309dfef..013c95596 100644 --- a/renderdoc/driver/shaders/dxil/dxil_reflect.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_reflect.cpp @@ -1730,9 +1730,9 @@ rdcstr Program::GetDebugStatus() void Program::GetLineInfo(size_t instruction, uintptr_t offset, LineColumnInfo &lineInfo) const { - // TODO: Get the entry point infomation - if(instruction == ~0U) - instruction = 0; + bool getEntryPoint = (instruction == ~0U); + if(getEntryPoint) + RDCASSERT(!m_EntryPoint.empty()); lineInfo = LineColumnInfo(); @@ -1740,7 +1740,16 @@ void Program::GetLineInfo(size_t instruction, uintptr_t offset, LineColumnInfo & { const Function &f = *m_Functions[i]; - if(instruction < f.instructions.size()) + bool getLineInfo = (getEntryPoint) ? false : (instruction < f.instructions.size()); + if(getEntryPoint) + { + if(f.name == m_EntryPoint) + { + getLineInfo = true; + instruction = 0; + } + } + if(getLineInfo) { const Instruction *const inst = f.instructions[instruction]; uint32_t dbgLoc = inst->debugLoc; @@ -1771,7 +1780,7 @@ void Program::GetLineInfo(size_t instruction, uintptr_t offset, LineColumnInfo & } lineInfo.disassemblyLine = inst->disassemblyLine; - break; + return; } instruction -= f.instructions.size(); }