/////////////////////////////////////////////////////////////////////////////
-// Name: msw/stackwalk.cpp
+// Name: src/msw/stackwalk.cpp
// Purpose: wxStackWalker implementation for Win32
// Author: Vadim Zeitlin
-// Modified by:
+// Modified by: Artur Bac 2010-10-01 AMD64 Port
// Created: 2005-01-08
-// RCS-ID: $Id$
// Copyright: (c) 2003-2005 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
STACKFRAME sf;
wxZeroMemory(sf);
-#ifdef _M_IX86
+#if defined(_M_AMD64)
+ sf.AddrPC.Offset = ctx.Rip;
+ sf.AddrPC.Mode = AddrModeFlat;
+ sf.AddrStack.Offset = ctx.Rsp;
+ sf.AddrStack.Mode = AddrModeFlat;
+ sf.AddrFrame.Offset = ctx.Rbp;
+ sf.AddrFrame.Mode = AddrModeFlat;
+
+ dwMachineType = IMAGE_FILE_MACHINE_AMD64;
+#elif defined(_M_IX86)
sf.AddrPC.Offset = ctx.Eip;
sf.AddrPC.Mode = AddrModeFlat;
sf.AddrStack.Offset = ctx.Esp;
}
}
- // this results in crashes inside ntdll.dll when called from
- // exception handler ...
-#if 0
if ( !wxDbgHelpDLL::SymCleanup(hProcess) )
{
wxDbgHelpDLL::LogError(wxT("SymCleanup"));
}
-#endif
}
void wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip, size_t maxDepth)