Add option to reset callstack frame symbols to the unresolved state

The new `-R` option of tracy-update sets every callstack frame back to `[unresolved]` / `[unknown]`. Since failed lookups leave frames untouched and the image-relative offset in `symAddr` survives patching, this makes it possible to chain several resolution passes over the same capture, each with different `-p` path substitutions (e.g. one pass per symbol directory).
This commit is contained in:
Clément Grégoire
2026-06-05 09:02:17 +02:00
parent 2b11785b05
commit 55d5436fb9
3 changed files with 41 additions and 2 deletions

View File

@@ -47,6 +47,33 @@ tracy::StringIdx AddSymbolString( tracy::Worker& worker, const std::string& str
return tracy::StringIdx( location.idx );
}
void ResetSymbols( tracy::Worker& worker )
{
std::cout << "Resetting callstack frame symbols to the unresolved state..." << std::endl;
const tracy::StringIdx unresolvedName = AddSymbolString( worker, "[unresolved]" );
const tracy::StringIdx unknownFile = AddSymbolString( worker, "[unknown]" );
uint64_t frameCount = 0;
auto& callstackFrameMap = worker.GetCallstackFrameMap();
for( auto it = callstackFrameMap.begin(); it != callstackFrameMap.end(); ++it )
{
if( !it->second ) continue;
tracy::CallstackFrameData& frameData = *it->second;
for( uint8_t f = 0; f < frameData.size; f++ )
{
tracy::CallstackFrame& frame = frameData.data[f];
frame.name = unresolvedName;
frame.file = unknownFile;
frame.line = 0;
++frameCount;
}
}
std::cout << "Reset " << frameCount << " callstack frames." << std::endl;
}
bool PatchSymbolsWithRegex( tracy::Worker& worker, const PathSubstitutionList& pathSubstitutionlist,
const std::string& addr2lineToolPath, const std::string& addr2lineArgs, bool verbose )
{