Skip to content
Permalink
Browse files

Use correct PDBDiaFile instance.

  • Loading branch information...
ZehMatt authored and mrexodia committed Feb 12, 2018
1 parent 45b4999 commit c8af1f9144cdc3820b0778ec56dc0f60e867333a
Showing with 11 additions and 17 deletions.
  1. +10 −15 src/dbg/symbolsourcedia.cpp
  2. +1 −2 src/dbg/symbolsourcedia.h
@@ -6,7 +6,8 @@
SymbolSourceDIA::SymbolSourceDIA()
: _requiresShutdown(false),
_imageBase(0),
_loadCounter(0)
_loadCounter(0),
_isOpen(false)
{
}

@@ -16,11 +17,6 @@ SymbolSourceDIA::~SymbolSourceDIA()
{
cancelLoading();
}

if(_pdb.isOpen())
{
_pdb.close();
}
}

static void SetThreadDescription(std::thread & thread, WString name)
@@ -42,10 +38,12 @@ bool SymbolSourceDIA::loadPDB(const std::string & path, duint imageBase, duint i
return false;
}

bool res = _pdb.open(path.c_str(), 0, validationData);
PDBDiaFile pdb; // Instance used for validation only.
_isOpen = pdb.open(path.c_str(), 0, validationData);
#if 1 // Async loading.
if(res)
if(_isOpen)
{

_imageSize = imageSize;
_imageBase = imageBase;
_requiresShutdown = false;
@@ -56,12 +54,12 @@ bool SymbolSourceDIA::loadPDB(const std::string & path, duint imageBase, duint i
SetThreadDescription(_symbolsThread, L"SourceLinesThread");
}
#endif
return res;
return _isOpen;
}

bool SymbolSourceDIA::isOpen() const
{
return _pdb.isOpen();
return _isOpen;
}

bool SymbolSourceDIA::isLoading() const
@@ -158,7 +156,7 @@ bool SymbolSourceDIA::loadSymbolsAsync(String path)
return true;
};

bool res = _pdb.enumerateLexicalHierarchy(query);
bool res = pdb.enumerateLexicalHierarchy(query);

if(!res)
{
@@ -238,7 +236,7 @@ bool SymbolSourceDIA::loadSourceLinesAsync(String path)

std::map<uint64_t, DiaLineInfo_t> lines;

bool res = _pdb.getFunctionLineNumbers(rva, rangeSize, _imageBase, lines);
bool res = pdb.getFunctionLineNumbers(rva, rangeSize, _imageBase, lines);
for(const auto & line : lines)
{
if(_requiresShutdown)
@@ -367,9 +365,6 @@ void SymbolSourceDIA::enumSymbols(const CbEnumSymbol & cbEnum)

bool SymbolSourceDIA::findSourceLineInfo(duint rva, LineInfo & lineInfo)
{
if(isOpen() == false)
return false;

ScopedSpinLock lock(_lockLines);

auto it = _lines.find(rva);
@@ -54,8 +54,7 @@ class SymbolSourceDIA : public SymbolSourceBase
};

private:
PDBDiaFile _pdb;

bool _isOpen;
std::vector<SymbolInfo> _symData;

struct AddrIndex

0 comments on commit c8af1f9

Please sign in to comment.
You can’t perform that action at this time.