Commit 9b77e104 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Win32: display stacktrace before modules list

parent 04d5562b
...@@ -357,23 +357,6 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo) ...@@ -357,23 +357,6 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
pContext->Ebp,pContext->Eip,pContext->Esp ); pContext->Ebp,pContext->Eip,pContext->Esp );
#endif #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" ); fwprintf( fd, L"\n[stacktrace]\n#EIP|base|module\n" );
#ifdef WIN64 #ifdef WIN64
...@@ -398,6 +381,22 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo) ...@@ -398,6 +381,22 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
pBase = *pBase; 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 ); fclose( fd );
fflush( stderr ); fflush( stderr );
exit( 1 ); exit( 1 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment