/[pcsx2_0.9.7]/trunk/3rdparty/wxWidgets/src/msw/stackwalk.cpp
ViewVC logotype

Diff of /trunk/3rdparty/wxWidgets/src/msw/stackwalk.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/3rdparty/wxWidgets/src/msw/stackwalk.cpp	2010/09/07 03:24:11	31
+++ trunk/3rdparty/wxWidgets/src/msw/stackwalk.cpp	2010/09/07 11:08:22	62
@@ -209,6 +209,9 @@
     }
 }
 
+#if wxUSE_THREADS
+static wxMutex s_mtx_StackWalker;
+#endif
 
 // ----------------------------------------------------------------------------
 // wxStackWalker
@@ -216,6 +219,14 @@
 
 void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip)
 {
+#if wxUSE_THREADS
+	// wxDbgHelpDLL has its own mutex locks for some critical functions, but really it
+	// should have locks on ALL its functions.  So until it gets fixed, we'll use a
+	// mutex here for stackframe walking.  --air
+	
+	wxMutexLocker lock(s_mtx_StackWalker);
+#endif
+
     if ( !wxDbgHelpDLL::Init() )
     {
         // don't log a user-visible error message here because the stack trace
@@ -233,17 +244,7 @@
     // below which should be a real handle... so this is what we use
     const HANDLE hProcess = ::GetCurrentProcess();
 
-    if ( !wxDbgHelpDLL::SymInitialize
-                        (
-                            hProcess,
-                            NULL,   // use default symbol search path
-                            TRUE    // load symbols for all loaded modules
-                        ) )
-    {
-        wxDbgHelpDLL::LogError(_T("SymInitialize"));
-
-        return;
-    }
+    if ( !wxDbgHelpDLL::RefreshModuleList(hProcess) ) return;
 
     CONTEXT ctx = *pCtx; // will be modified by StackWalk()
 
@@ -318,6 +319,8 @@
 
 void wxStackWalker::WalkFromException()
 {
+// PCSX2 : Added wxUSE_ON_FATAL_EXCEPTION check, which was missing. --air
+#if wxUSE_ON_FATAL_EXCEPTION
     extern EXCEPTION_POINTERS *wxGlobalSEInformation;
 
     wxCHECK_RET( wxGlobalSEInformation,
@@ -325,6 +328,7 @@
 
     // don't skip any frames, the first one is where we crashed
     WalkFrom(wxGlobalSEInformation, 0);
+#endif
 }
 
 void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))

 

  ViewVC Help
Powered by ViewVC 1.1.22