Base: apply clang format
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// clang-format off
|
||||
/**********************************************************************
|
||||
*
|
||||
*
|
||||
* StackWalker.cpp
|
||||
* http://stackwalker.codeplex.com/
|
||||
*
|
||||
@@ -9,14 +10,14 @@
|
||||
* http://www.codeproject.com/threads/StackWalker.asp
|
||||
* 2005-07-28 v2 - Changed the params of the constructor and ShowCallstack
|
||||
* (to simplify the usage)
|
||||
* 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL
|
||||
* 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL
|
||||
* (should also be enough)
|
||||
* - Changed to compile correctly with the PSDK of VC7.0
|
||||
* (GetFileVersionInfoSizeA and GetFileVersionInfoA is wrongly defined:
|
||||
* it uses LPSTR instead of LPCSTR as first parameter)
|
||||
* - Added declarations to support VC5/6 without using 'dbghelp.h'
|
||||
* - Added a 'pUserData' member to the ShowCallstack function and the
|
||||
* PReadProcessMemoryRoutine declaration (to pass some user-defined data,
|
||||
* - Added a 'pUserData' member to the ShowCallstack function and the
|
||||
* PReadProcessMemoryRoutine declaration (to pass some user-defined data,
|
||||
* which can be used in the readMemoryFunction-callback)
|
||||
* 2005-08-02 v4 - OnSymInit now also outputs the OS-Version by default
|
||||
* - Added example for doing an exception-callstack-walking in main.cpp
|
||||
@@ -56,26 +57,26 @@
|
||||
* Copyright (c) 2005-2013, Jochen Kalmbach
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Neither the name of Jochen Kalmbach nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Neither the name of Jochen Kalmbach nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**********************************************************************/
|
||||
@@ -102,7 +103,7 @@
|
||||
// Some missing defines (for VC5/6):
|
||||
#ifndef INVALID_FILE_ATTRIBUTES
|
||||
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static void MyStrCpy(char* szDest, size_t nMaxDestSize, const char* szSrc)
|
||||
@@ -263,7 +264,7 @@ public:
|
||||
m_szSymPath = _strdup(szSymPath);
|
||||
if (!this->pSI(m_hProcess, m_szSymPath, FALSE))
|
||||
this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0);
|
||||
|
||||
|
||||
DWORD symOptions = this->pSGO(); // SymGetOptions
|
||||
symOptions |= SYMOPT_LOAD_LINES;
|
||||
symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS;
|
||||
@@ -378,11 +379,11 @@ typedef struct IMAGEHLP_MODULE64_V2 {
|
||||
tSSO pSSO;
|
||||
|
||||
// StackWalk64()
|
||||
typedef BOOL (__stdcall *tSW)(
|
||||
DWORD MachineType,
|
||||
typedef BOOL (__stdcall *tSW)(
|
||||
DWORD MachineType,
|
||||
HANDLE hProcess,
|
||||
HANDLE hThread,
|
||||
LPSTACKFRAME64 StackFrame,
|
||||
HANDLE hThread,
|
||||
LPSTACKFRAME64 StackFrame,
|
||||
PVOID ContextRecord,
|
||||
PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine,
|
||||
PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine,
|
||||
@@ -869,7 +870,7 @@ BOOL StackWalker::LoadModules()
|
||||
|
||||
// The following is used to pass the "userData"-Pointer to the user-provided readMemoryFunction
|
||||
// This has to be done due to a problem with the "hProcess"-parameter in x64...
|
||||
// Because this class is in no case multi-threading-enabled (because of the limitations
|
||||
// Because this class is in no case multi-threading-enabled (because of the limitations
|
||||
// of dbghelp.dll) it is "safe" to use a static-variable
|
||||
static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL;
|
||||
static LPVOID s_readMemoryFunction_UserData = NULL;
|
||||
@@ -1079,7 +1080,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro
|
||||
et = firstEntry;
|
||||
bLastEntryCalled = false;
|
||||
this->OnCallstackEntry(et, csEntry);
|
||||
|
||||
|
||||
if (s.AddrReturn.Offset == 0)
|
||||
{
|
||||
bLastEntryCalled = true;
|
||||
@@ -1192,3 +1193,4 @@ void StackWalker::OnOutput(LPCSTR buffer)
|
||||
{
|
||||
OutputDebugStringA(buffer);
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
Reference in New Issue
Block a user