]> git.saurik.com Git - wxWidgets.git/commitdiff
build fixes for wxUSE_ON_FATAL_EXCEPTION==0 (#9937)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Sep 2008 00:26:29 +0000 (00:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Sep 2008 00:26:29 +0000 (00:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/stackwalk.h
include/wx/stackwalk.h
include/wx/unix/stackwalk.h
src/common/debugrpt.cpp
src/msw/stackwalk.cpp

index a5f7e322acd5f165984ad3dc689a2fa0dfed0472..ad981d7b454386430cabf2dd61d3da76c8f51067 100644 (file)
@@ -91,7 +91,9 @@ public:
     wxStackWalker(const char * WXUNUSED(argv0) = NULL) { }
 
     virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
+#if wxUSE_ON_FATAL_EXCEPTION
     virtual void WalkFromException(size_t maxDepth = 200);
+#endif // wxUSE_ON_FATAL_EXCEPTION
 
 
     // enumerate stack frames from the given context
index 8bb237149834bad5a35f44ca1f612c55dc7f6b8b..2a652b0759fff07dfcbb170feed67e266762fdec 100644 (file)
@@ -132,10 +132,12 @@ public:
     // notice that Walk() frame itself is not included if skip >= 1)
     virtual void Walk(size_t skip = 1, size_t maxDepth = 200) = 0;
 
+#if wxUSE_ON_FATAL_EXCEPTION
     // enumerate stack frames from the location of uncaught exception
     //
     // this version can only be called from wxApp::OnFatalException()
     virtual void WalkFromException(size_t maxDepth = 200) = 0;
+#endif // wxUSE_ON_FATAL_EXCEPTION
 
 protected:
     // this function must be overrided to process the given frame
index 96dc1ed7021b9fe0c5cccc01a38abf6292da4629..2d1a6b53b5a1d86328316ae60584547f3c5c235b 100644 (file)
@@ -74,7 +74,9 @@ public:
     }
 
     virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
+#if wxUSE_ON_FATAL_EXCEPTION
     virtual void WalkFromException(size_t maxDepth = 200) { Walk(2, maxDepth); }
+#endif // wxUSE_ON_FATAL_EXCEPTION
 
     static const wxString& GetExePath() { return ms_exepath; }
 
index 2fa3683d07ad4baed89dd435496948c2e3a4b96f..e9044154a70eca3e170761c249058583beeab566 100644 (file)
@@ -478,11 +478,13 @@ bool wxDebugReport::AddContext(wxDebugReport::Context ctx)
 #if wxUSE_STACKWALKER
     wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, _T("stack"));
     XmlStackWalker sw(nodeStack);
+#if wxUSE_ON_FATAL_EXCEPTION
     if ( ctx == Context_Exception )
     {
         sw.WalkFromException();
     }
     else // Context_Current
+#endif // wxUSE_ON_FATAL_EXCEPTION
     {
         sw.Walk();
     }
index 212c2eda6919da527ac9ffa72c818353dd54c42e..c620eae6693a93a74f7ebaa28773d7c4de41cf8f 100644 (file)
@@ -315,6 +315,8 @@ void wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip, size_t
     WalkFrom(ep->ContextRecord, skip, maxDepth);
 }
 
+#if wxUSE_ON_FATAL_EXCEPTION
+
 void wxStackWalker::WalkFromException(size_t maxDepth)
 {
     extern EXCEPTION_POINTERS *wxGlobalSEInformation;
@@ -326,13 +328,15 @@ void wxStackWalker::WalkFromException(size_t maxDepth)
     WalkFrom(wxGlobalSEInformation, 0, maxDepth);
 }
 
+#endif // wxUSE_ON_FATAL_EXCEPTION
+
 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
     //
     // note:
-    //  1. we additionally skip RaiseException() and WalkFromException() frames
+    //  1. we additionally skip RaiseException() and WalkFrom() frames
     //  2. explicit cast to EXCEPTION_POINTERS is needed with VC7.1 even if it
     //     shouldn't have been according to the docs
     __try
@@ -342,7 +346,8 @@ void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))
     __except( WalkFrom((EXCEPTION_POINTERS *)GetExceptionInformation(),
                        skip + 2), EXCEPTION_CONTINUE_EXECUTION )
     {
-        // never executed because of WalkFromException() return value
+        // never executed because the above expression always evaluates to
+        // EXCEPTION_CONTINUE_EXECUTION
     }
 }
 
@@ -399,9 +404,11 @@ wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS * WXUNUSED(ep),
 {
 }
 
+#if wxUSE_ON_FATAL_EXCEPTION
 void wxStackWalker::WalkFromException(size_t WXUNUSED(maxDepth))
 {
 }
+#endif // wxUSE_ON_FATAL_EXCEPTION
 
 void wxStackWalker::Walk(size_t WXUNUSED(skip), size_t WXUNUSED(maxDepth))
 {