mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Improve callstack values for cases of missing symbols
This commit is contained in:
@@ -755,9 +755,43 @@ Callstack::AddressDetails Win32CallstackResolver::GetAddr(DWORD64 addr)
|
||||
info = GetAddrInfoForModule(modules[i].moduleId, addr);
|
||||
|
||||
// if we didn't get a filename, default to the module name
|
||||
if(info.fileName[0] == 0)
|
||||
if(modules[i].moduleId == 0 || info.fileName[0] == 0)
|
||||
wcsncpy_s(info.fileName, modules[i].name.c_str(), 126);
|
||||
|
||||
if(modules[i].moduleId == 0 || info.funcName[0] == 0)
|
||||
{
|
||||
// if we didn't get a function name, at least indicate
|
||||
// the module it came from, and an offset
|
||||
wchar_t *baseName = info.fileName;
|
||||
|
||||
wchar_t *c = wcsrchr(baseName, '\\');
|
||||
if(c)
|
||||
baseName = c + 1;
|
||||
|
||||
c = wcsrchr(baseName, '/');
|
||||
if(c)
|
||||
baseName = c + 1;
|
||||
|
||||
wsprintfW(info.funcName, L"%s+0x%08I64x", baseName, addr - base);
|
||||
|
||||
c = wcsstr(info.funcName, L"pdb");
|
||||
if(c)
|
||||
{
|
||||
if(i == 0)
|
||||
{
|
||||
c[0] = 'e';
|
||||
c[1] = 'x';
|
||||
c[2] = 'e';
|
||||
}
|
||||
else
|
||||
{
|
||||
c[0] = 'd';
|
||||
c[1] = 'l';
|
||||
c[2] = 'l';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user