[libunwind] [Windows] Add a log message if EnumProcessModules fails

Differential Revision: https://reviews.llvm.org/D69504
This commit is contained in:
Martin Storsjö 2019-10-28 10:11:05 +02:00
parent 31784248ee
commit 08c7ff99e1
1 changed files with 5 additions and 1 deletions

View File

@ -433,8 +433,12 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
HANDLE process = GetCurrentProcess();
DWORD needed;
if (!EnumProcessModules(process, mods, sizeof(mods), &needed))
if (!EnumProcessModules(process, mods, sizeof(mods), &needed)) {
DWORD err = GetLastError();
_LIBUNWIND_TRACE_UNWINDING("findUnwindSections: EnumProcessModules failed, "
"returned error %d", (int)err);
return false;
}
for (unsigned i = 0; i < (needed / sizeof(HMODULE)); i++) {
PIMAGE_DOS_HEADER pidh = (PIMAGE_DOS_HEADER)mods[i];