From c67055bad3cdfc93e2ac57d87f36c6e0993af690 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 17 May 2017 06:00:20 +0300 Subject: initial commit --- include/pdb/dbghelp.hpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/pdb/dbghelp.hpp (limited to 'include/pdb/dbghelp.hpp') diff --git a/include/pdb/dbghelp.hpp b/include/pdb/dbghelp.hpp new file mode 100644 index 0000000..7b018bc --- /dev/null +++ b/include/pdb/dbghelp.hpp @@ -0,0 +1,44 @@ +// Copyright (c) 2017 Egor Tensin +// This file is part of the "PDB repository" project. +// For details, see https://github.com/egor-tensin/pdb-repo. +// Distributed under the MIT License. + +#pragma once + +#include "address.hpp" +#include "module.hpp" +#include "symbol.hpp" + +#include + +#include +#include + +namespace pdb +{ + class DbgHelp + { + public: + DbgHelp(); + ~DbgHelp(); + + ModuleInfo load_pdb(const std::string& path) const; + + typedef std::function OnSymbol; + void enum_symbols(const ModuleInfo&, const OnSymbol&) const; + + SymbolInfo resolve_symbol(Address) const; + SymbolInfo resolve_symbol(const std::string&) const; + + void close(); + + private: + ModuleInfo get_module_info(Address offline_base) const; + + const HANDLE id = GetCurrentProcess(); + bool closed = false; + + DbgHelp(const DbgHelp&) = delete; + DbgHelp& operator=(const DbgHelp&) = delete; + }; +} -- cgit v1.2.3