Skip to content

Commit 08c7ff9

Browse files
committed
[libunwind] [Windows] Add a log message if EnumProcessModules fails
Differential Revision: https://reviews.llvm.org/D69504
1 parent 3178424 commit 08c7ff9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libunwind/src/AddressSpace.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,12 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
433433
HANDLE process = GetCurrentProcess();
434434
DWORD needed;
435435

436-
if (!EnumProcessModules(process, mods, sizeof(mods), &needed))
436+
if (!EnumProcessModules(process, mods, sizeof(mods), &needed)) {
437+
DWORD err = GetLastError();
438+
_LIBUNWIND_TRACE_UNWINDING("findUnwindSections: EnumProcessModules failed, "
439+
"returned error %d", (int)err);
437440
return false;
441+
}
438442

439443
for (unsigned i = 0; i < (needed / sizeof(HMODULE)); i++) {
440444
PIMAGE_DOS_HEADER pidh = (PIMAGE_DOS_HEADER)mods[i];

0 commit comments

Comments
 (0)