/[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

revision 61 by william, Tue Sep 7 03:24:11 2010 UTC revision 62 by william, Tue Sep 7 11:08:22 2010 UTC
# Line 209  void wxStackFrame::OnGetParam() Line 209  void wxStackFrame::OnGetParam()
209      }      }
210  }  }
211    
212    #if wxUSE_THREADS
213    static wxMutex s_mtx_StackWalker;
214    #endif
215    
216  // ----------------------------------------------------------------------------  // ----------------------------------------------------------------------------
217  // wxStackWalker  // wxStackWalker
# Line 216  void wxStackFrame::OnGetParam() Line 219  void wxStackFrame::OnGetParam()
219    
220  void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip)  void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip)
221  {  {
222    #if wxUSE_THREADS
223            // wxDbgHelpDLL has its own mutex locks for some critical functions, but really it
224            // should have locks on ALL its functions.  So until it gets fixed, we'll use a
225            // mutex here for stackframe walking.  --air
226            
227            wxMutexLocker lock(s_mtx_StackWalker);
228    #endif
229    
230      if ( !wxDbgHelpDLL::Init() )      if ( !wxDbgHelpDLL::Init() )
231      {      {
232          // don't log a user-visible error message here because the stack trace          // don't log a user-visible error message here because the stack trace
# Line 233  void wxStackWalker::WalkFrom(const CONTE Line 244  void wxStackWalker::WalkFrom(const CONTE
244      // below which should be a real handle... so this is what we use      // below which should be a real handle... so this is what we use
245      const HANDLE hProcess = ::GetCurrentProcess();      const HANDLE hProcess = ::GetCurrentProcess();
246    
247      if ( !wxDbgHelpDLL::SymInitialize      if ( !wxDbgHelpDLL::RefreshModuleList(hProcess) ) return;
                         (  
                             hProcess,  
                             NULL,   // use default symbol search path  
                             TRUE    // load symbols for all loaded modules  
                         ) )  
     {  
         wxDbgHelpDLL::LogError(_T("SymInitialize"));  
   
         return;  
     }  
248    
249      CONTEXT ctx = *pCtx; // will be modified by StackWalk()      CONTEXT ctx = *pCtx; // will be modified by StackWalk()
250    
# Line 318  void wxStackWalker::WalkFrom(const _EXCE Line 319  void wxStackWalker::WalkFrom(const _EXCE
319    
320  void wxStackWalker::WalkFromException()  void wxStackWalker::WalkFromException()
321  {  {
322    // PCSX2 : Added wxUSE_ON_FATAL_EXCEPTION check, which was missing. --air
323    #if wxUSE_ON_FATAL_EXCEPTION
324      extern EXCEPTION_POINTERS *wxGlobalSEInformation;      extern EXCEPTION_POINTERS *wxGlobalSEInformation;
325    
326      wxCHECK_RET( wxGlobalSEInformation,      wxCHECK_RET( wxGlobalSEInformation,
# Line 325  void wxStackWalker::WalkFromException() Line 328  void wxStackWalker::WalkFromException()
328    
329      // don't skip any frames, the first one is where we crashed      // don't skip any frames, the first one is where we crashed
330      WalkFrom(wxGlobalSEInformation, 0);      WalkFrom(wxGlobalSEInformation, 0);
331    #endif
332  }  }
333    
334  void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))  void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22