forward
| 59 | |
| 60 | class StackWalkerInternal; // forward |
| 61 | class StackWalker |
| 62 | { |
| 63 | public: |
| 64 | typedef enum StackWalkOptions |
| 65 | { |
| 66 | // No addition info will be retrieved |
| 67 | // (only the address is available) |
| 68 | RetrieveNone = 0, |
| 69 | |
| 70 | // Try to get the symbol-name |
| 71 | RetrieveSymbol = 1, |
| 72 | |
| 73 | // Try to get the line for this symbol |
| 74 | RetrieveLine = 2, |
| 75 | |
| 76 | // Try to retrieve the module-infos |
| 77 | RetrieveModuleInfo = 4, |
| 78 | |
| 79 | // Also retrieve the version for the DLL/EXE |
| 80 | RetrieveFileVersion = 8, |
| 81 | |
| 82 | // Contains all the above |
| 83 | RetrieveVerbose = 0xF, |
| 84 | |
| 85 | // Generate a "good" symbol-search-path |
| 86 | SymBuildPath = 0x10, |
| 87 | |
| 88 | // Also use the public Microsoft-Symbol-Server |
| 89 | SymUseSymSrv = 0x20, |
| 90 | |
| 91 | // Contains all the above "Sym"-options |
| 92 | SymAll = 0x30, |
| 93 | |
| 94 | // Contains all options (default) |
| 95 | OptionsAll = 0x3F |
| 96 | } StackWalkOptions; |
| 97 | |
| 98 | StackWalker(int options = OptionsAll, // 'int' is by design, to combine the enum-flags |
| 99 | LPCSTR szSymPath = NULL, |
| 100 | DWORD dwProcessId = GetCurrentProcessId(), |
| 101 | HANDLE hProcess = GetCurrentProcess()); |
| 102 | StackWalker(DWORD dwProcessId, HANDLE hProcess); |
| 103 | virtual ~StackWalker(); |
| 104 | |
| 105 | typedef BOOL(__stdcall* PReadProcessMemoryRoutine)( |
| 106 | HANDLE hProcess, |
| 107 | DWORD64 qwBaseAddress, |
| 108 | PVOID lpBuffer, |
| 109 | DWORD nSize, |
| 110 | LPDWORD lpNumberOfBytesRead, |
| 111 | LPVOID pUserData // optional data, which was passed in "ShowCallstack" |
| 112 | ); |
| 113 | |
| 114 | BOOL LoadModules(); |
| 115 | |
| 116 | BOOL ShowCallstack( |
| 117 | HANDLE hThread = GetCurrentThread(), |
| 118 | const CONTEXT* context = NULL, |
nothing calls this directly
no outgoing calls
no test coverage detected