[vlc-commits] Win32: display stacktrace before modules list

Jean-Baptiste Kempf git at videolan.org
Thu Aug 23 17:16:20 CEST 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug 23 16:01:27 2012 +0200| [29c14957ca1e811c0e47a267b2140f9d0db91332] | committer: Jean-Baptiste Kempf

Win32: display stacktrace before modules list

Stacktraces are more important than modules list, and we cut the data
after 10k...

(cherry picked from commit 9b77e1043394420137c674d47d9d9d265708eba2)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=29c14957ca1e811c0e47a267b2140f9d0db91332
---

 bin/winvlc.c |   33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 277277b..797fd43 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -341,23 +341,6 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
                         pContext->Ebp,pContext->Eip,pContext->Esp );
 #endif
 
-        HANDLE hpid = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
-                                        FALSE, GetCurrentProcessId());
-        if (hpid) {
-            HMODULE mods[1024];
-            DWORD size;
-            if (EnumProcessModules(hpid, mods, sizeof(mods), &size)) {
-                fwprintf( fd, L"\n\n[modules]\n" );
-                for (unsigned int i = 0; i < size / sizeof(HMODULE); i++) {
-                    wchar_t module[ 256 ];
-                    GetModuleFileName(mods[i], module, 256);
-                    fwprintf( fd, L"%p|%s\n", mods[i], module);
-                }
-            }
-            CloseHandle(hpid);
-        }
-
-
         fwprintf( fd, L"\n[stacktrace]\n#EIP|base|module\n" );
 
 #ifdef WIN64
@@ -382,6 +365,22 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
             pBase = *pBase;
         }
 
+        HANDLE hpid = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+                                        FALSE, GetCurrentProcessId());
+        if (hpid) {
+            HMODULE mods[1024];
+            DWORD size;
+            if (EnumProcessModules(hpid, mods, sizeof(mods), &size)) {
+                fwprintf( fd, L"\n\n[modules]\n" );
+                for (unsigned int i = 0; i < size / sizeof(HMODULE); i++) {
+                    wchar_t module[ 256 ];
+                    GetModuleFileName(mods[i], module, 256);
+                    fwprintf( fd, L"%p|%s\n", mods[i], module);
+                }
+            }
+            CloseHandle(hpid);
+        }
+
         fclose( fd );
         fflush( stderr );
         exit( 1 );



More information about the vlc-commits mailing list