Skip to content

Commit

Permalink
Use unique ids for DbgHelp calls
Browse files Browse the repository at this point in the history
  • Loading branch information
yjugl committed Oct 7, 2022
1 parent ad2e3bf commit 56572b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mitimon/src/symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#include "symbols.h"
#include "winkrabs.h"

std::atomic<uint32_t> Symbolicator::nextSymbolicatorId{ 1 };

Symbolicator::Symbolicator(const ProcessData&& processData, const std::wstring& symDir, const std::wstring& symPath) :
mProcessData{ processData },
mProcess{ reinterpret_cast<HANDLE>(processData.pid()) },
mProcess{ reinterpret_cast<HANDLE>(nextSymbolicatorId++) },
mModuleMap{}
{
::SymSetOptions(SYMOPT_IGNORE_NT_SYMPATH);
Expand Down
3 changes: 3 additions & 0 deletions mitimon/src/symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Symbolicator {
std::unordered_map<void*, DWORD64> mModuleMap;

bool load(const ImageData& imageData);

private:
static std::atomic<uint32_t> nextSymbolicatorId;
};

#endif // SYMBOLS_H

0 comments on commit 56572b8

Please sign in to comment.