If DIA can't find Function symbol, retry with PublicSymbol. Closes #364

* I don't see any docs on why a function wouldn't be reported as a
  function, but instead as a public symbol, but this seems to be the
  case and it fixes some problems where symbols aren't located. Oh well.
This commit is contained in:
baldurk
2016-10-13 15:57:38 +02:00
parent a1fa1c0ca6
commit d05edca3d2
+14 -2
View File
@@ -51,6 +51,7 @@ struct IDiaEnumDebugStreams;
enum SymTagEnum
{
SymTagFunction = 5,
SymTagPublicSymbol = 10,
};
struct IDiaSourceFile : public IUnknown
@@ -529,14 +530,25 @@ AddrInfo GetAddr(wstring req)
if(module > 0 && module < modules.size())
{
SymTagEnum tag = SymTagFunction;
IDiaSymbol *pFunc = NULL;
HRESULT hr = modules[module].pSession->findSymbolByVA(addr, SymTagFunction, &pFunc);
HRESULT hr = modules[module].pSession->findSymbolByVA(addr, tag, &pFunc);
if(hr != S_OK)
{
if(pFunc)
pFunc->Release();
return ret;
// try again looking for public symbols
tag = SymTagPublicSymbol;
hr = modules[module].pSession->findSymbolByVA(addr, tag, &pFunc);
if(hr != S_OK)
{
if(pFunc)
pFunc->Release();
return ret;
}
}
DWORD opts = 0;