Commit 29c14957 authored by Jean-Baptiste Kempf's avatar 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 9b77e104)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent abbcafeb
......@@ -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 );
......
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