aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/pdb/dbghelp.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-05-17 06:00:20 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-05-17 06:00:20 +0300
commitc67055bad3cdfc93e2ac57d87f36c6e0993af690 (patch)
treeda8759c66f1af00415784e5824e6bfc2195aee92 /include/pdb/dbghelp.hpp
downloadwinapi-debug-c67055bad3cdfc93e2ac57d87f36c6e0993af690.tar.gz
winapi-debug-c67055bad3cdfc93e2ac57d87f36c6e0993af690.zip
initial commit
Diffstat (limited to 'include/pdb/dbghelp.hpp')
-rw-r--r--include/pdb/dbghelp.hpp44
1 files changed, 44 insertions, 0 deletions
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 <Egor.Tensin@gmail.com>
+// 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 <Windows.h>
+
+#include <functional>
+#include <string>
+
+namespace pdb
+{
+ class DbgHelp
+ {
+ public:
+ DbgHelp();
+ ~DbgHelp();
+
+ ModuleInfo load_pdb(const std::string& path) const;
+
+ typedef std::function<void (const SymbolInfo&)> 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;
+ };
+}