Skip to content

Commit

Permalink
[libunwind] [Windows] Add a log message if EnumProcessModules fails
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D69504
  • Loading branch information
mstorsjo committed Oct 31, 2019
1 parent 3178424 commit 08c7ff9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libunwind/src/AddressSpace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 08c7ff9

Please sign in to comment.