diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp index 908c898d7403..db67df4dc80a 100644 --- a/libunwind/src/AddressSpace.hpp +++ b/libunwind/src/AddressSpace.hpp @@ -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];