#if wxUSE_STACKWALKER
+#ifndef WX_PRECOMP
+ #include "wx/string.h"
+#endif
+
#include "wx/stackwalk.h"
#include "wx/msw/debughlp.h"
wxZeroMemory(symbolBuffer);
PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)symbolBuffer;
- pSymbol->SizeOfStruct = sizeof(symbolBuffer);
+ pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
pSymbol->MaxNameLen = MAX_NAME_LEN;
DWORD64 symDisplacement = 0;
void wxStackFrame::OnParam(PSYMBOL_INFO pSymInfo)
{
- m_paramTypes.Add(_T(""));
+ m_paramTypes.Add(wxEmptyString);
m_paramNames.Add(wxString::FromAscii(pSymInfo->Name));
// if symbol information is corrupted and we crash, the exception is going
// to be ignored when we're called from WalkFromException() because of the
- // except handler there returning EXCEPTION_CONTINUE_EXECUTION, but we'd be
- // left in an inconsistent state, so deal with it explicitely here (even if
- // normally we should never crash, of course...)
+ // exception handler there returning EXCEPTION_CONTINUE_EXECUTION, but we'd
+ // be left in an inconsistent state, so deal with it explicitly here (even
+ // if normally we should never crash, of course...)
#ifdef _CPPUNWIND
try
#else
__except ( EXCEPTION_EXECUTE_HANDLER )
#endif
{
- m_paramValues.Add(_T(""));
+ m_paramValues.Add(wxEmptyString);
}
}
{
frame->OnParam(pSymInfo);
}
-
+
// return true to continue enumeration, false would have stopped it
return TRUE;
}
{
if ( !wxDbgHelpDLL::Init() )
{
- wxLogError(_("Failed to get stack backtrace:\n%s"),
+ // don't log a user-visible error message here because the stack trace
+ // is only needed for debugging/diagnostics anyhow and we shouldn't
+ // confuse the user by complaining that we couldn't generate it
+ wxLogDebug(_T("Failed to get stack backtrace: %s"),
wxDbgHelpDLL::GetErrorMessage().c_str());
+ return;
}
// according to MSDN, the first parameter should be just a unique value and
WalkFrom(wxGlobalSEInformation, 0);
}
-void wxStackWalker::Walk(size_t skip)
+void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))
{
// to get a CONTEXT for the current location, simply force an exception and
// get EXCEPTION_POINTERS from it
#else // !wxUSE_DBGHELP
-// TODO: implement stubs
+// ============================================================================
+// stubs
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxStackFrame
+// ----------------------------------------------------------------------------
+
+void wxStackFrame::OnGetName()
+{
+}
+
+void wxStackFrame::OnGetLocation()
+{
+}
+
+bool
+wxStackFrame::GetParam(size_t WXUNUSED(n),
+ wxString * WXUNUSED(type),
+ wxString * WXUNUSED(name),
+ wxString * WXUNUSED(value)) const
+{
+ return false;
+}
+
+void wxStackFrame::OnParam(_SYMBOL_INFO * WXUNUSED(pSymInfo))
+{
+}
+
+void wxStackFrame::OnGetParam()
+{
+}
+
+// ----------------------------------------------------------------------------
+// wxStackWalker
+// ----------------------------------------------------------------------------
+
+void
+wxStackWalker::WalkFrom(const CONTEXT * WXUNUSED(pCtx), size_t WXUNUSED(skip))
+{
+}
+
+void
+wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS * WXUNUSED(ep),
+ size_t WXUNUSED(skip))
+{
+}
+
+void wxStackWalker::WalkFromException()
+{
+}
+
+void wxStackWalker::Walk(size_t WXUNUSED(skip), size_t WXUNUSED(maxDepth))
+{
+}
#endif // wxUSE_DBGHELP/!wxUSE_DBGHELP