PStack  2.0
Stack trace printer for MSVC and GCC binaries
debug_help_dll.hpp
Go to the documentation of this file.
1 // ===-- include/psystem/dll/debug_help_dll.hpp ----------- -*- C++ -*- --=== //
2 // Copyright (c) 2015 Matt Bisson. All rights reserved.
3 
18 #pragma once
19 #ifndef PSYSTEM_DLL_DBGHELP_HPP
20 #define PSYSTEM_DLL_DBGHELP_HPP
21 
22 #include "psystem/psystem_ns.hpp"
23 
24 #include <DbgHelp.h>
25 
27 
28 namespace psystem {
29 
45 class debug_help_dll final
47 {
51 public:
56 
60 public:
70  void load_all_functions();
71 
75 public:
77  loaded_function<decltype(::StackWalk64)> StackWalk64;
79  loaded_function<decltype(::SymCleanup)> SymCleanup;
81  loaded_function<decltype(::SymFromAddr)> SymFromAddr;
83  loaded_function<decltype(::SymFunctionTableAccess64)> SymFunctionTableAccess64;
85  loaded_function<decltype(::SymGetModuleBase64)> SymGetModuleBase64;
87  loaded_function<decltype(::SymGetOptions)> SymGetOptions;
89  loaded_function<decltype(::SymInitialize)> SymInitialize;
91  loaded_function<decltype(::SymSetOptions)> SymSetOptions;
92 };
93 
95 extern debug_help_dll DbgHelp;
96 
97 } // namespace psystem
98 
99 #endif // PSYSTEM_DLL_DBGHELP_HPP
100 
loaded_function< decltype(::SymGetOptions)> SymGetOptions
See MSDN for details on SymGetOptions.
Definition: debug_help_dll.hpp:87
Wraps invocations into the Windows DbgHelp DLL onto a lazily-loaded version.
Definition: debug_help_dll.hpp:45
#define noexcept
Replace keyword with something useful.
Definition: platform.hpp:71
loaded_function< decltype(::SymInitialize)> SymInitialize
See MSDN for details on SymInitialize.
Definition: debug_help_dll.hpp:89
Load shared libraries into the current process for execution.
Definition: shared_library.hpp:55
loaded_function< decltype(::StackWalk64)> StackWalk64
See MSDN for details on StackWalk64.
Definition: debug_help_dll.hpp:77
loaded_function< decltype(::SymSetOptions)> SymSetOptions
See MSDN for details on SymSetOptions.
Definition: debug_help_dll.hpp:91
loaded_function< decltype(::SymFromAddr)> SymFromAddr
See MSDN for details on SymFromAddr.
Definition: debug_help_dll.hpp:81
loaded_function< decltype(::SymCleanup)> SymCleanup
See MSDN for details on SymCleanup.
Definition: debug_help_dll.hpp:79
The basic header file for the PSystem namespce.
debug_help_dll DbgHelp
The loaded instance of DbgHelp.dll.
Definition: psystem_ns.cpp:40
Define a base type to perform on-demand loading of shared libraries.
Contains the process examination "system" and basic frameworks.
Definition: pstack_event_handler.hpp:28
debug_help_dll() noexcept
Construct (without loading) an instance to wrap DbgHelp.dll.
Definition: debug_help_dll.cpp:36
loaded_function< decltype(::SymFunctionTableAccess64)> SymFunctionTableAccess64
See MSDN for details on SymFunctionTableAccess64.
Definition: debug_help_dll.hpp:83
loaded_function< decltype(::SymGetModuleBase64)> SymGetModuleBase64
See MSDN for details on SymGetModuleBase64.
Definition: debug_help_dll.hpp:85
void load_all_functions()
Populates all loaded_function instances in from the library immediately.
Definition: debug_help_dll.cpp:54