From f6eee16baf2b0eee5b39218cfbcdba4a9e22af1b Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 16 Apr 2025 17:36:50 +0100 Subject: [PATCH] Check for files with extra .pdb if the original filename didn't have it --- renderdoc/driver/shaders/dxbc/dxbc_container.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp index df63a51c3..61c8782b6 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp @@ -1518,6 +1518,10 @@ void DXBCContainer::TryFetchSeparateDebugInfo(bytebuf &byteCode, const rdcstr &d // opens and (optionally if we have it matches the hash we're looking for) rdcstr tempPath = originalPath; + // if the path specified does not end in a .pdb it seems like PIX appends that, so do this just + // to match. It's really fun matching behaviour in an application that is deliberately undocumented + bool hasSuffix = tempPath.endsWith(".pdb") || tempPath.endsWith(".PDB"); + while(found.empty() && !tempPath.empty()) { // while we haven't found a file, keep trying through the search paths. For i==0 @@ -1528,6 +1532,8 @@ void DXBCContainer::TryFetchSeparateDebugInfo(bytebuf &byteCode, const rdcstr &d { if(FileIO::exists(tempPath)) found.path = tempPath; + else if(!hasSuffix && FileIO::exists(tempPath + ".pdb")) + found.path = tempPath + ".pdb"; continue; } else @@ -1538,6 +1544,8 @@ void DXBCContainer::TryFetchSeparateDebugInfo(bytebuf &byteCode, const rdcstr &d if(FileIO::exists(checkPath)) found.path = checkPath; + else if(!hasSuffix && FileIO::exists(checkPath + ".pdb")) + found.path = checkPath + ".pdb"; } } @@ -1579,6 +1587,8 @@ void DXBCContainer::TryFetchSeparateDebugInfo(bytebuf &byteCode, const rdcstr &d CacheSearchDirDebugPaths(); auto it = cachedDebugFilesLookup.find(originalPath); + if(it == cachedDebugFilesLookup.end() && !hasSuffix) + it = cachedDebugFilesLookup.find(originalPath + ".pdb"); if(it != cachedDebugFilesLookup.end()) { found.path = it->second;