[libcxx-commits] [PATCH] D69504: [libunwind] [Windows] Add a log message if EnumProcessModules fails

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 28 04:27:31 PDT 2019


mstorsjo created this revision.
mstorsjo added reviewers: rnk, EricWF, ldionne, mclow.lists.
Herald added subscribers: dexonsmith, christof.

Repository:
  rUNW libunwind

https://reviews.llvm.org/D69504

Files:
  libunwind/src/AddressSpace.hpp


Index: libunwind/src/AddressSpace.hpp
===================================================================
--- libunwind/src/AddressSpace.hpp
+++ libunwind/src/AddressSpace.hpp
@@ -433,8 +433,12 @@
   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];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69504.226638.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191028/2e2f4001/attachment-0001.bin>


More information about the libcxx-commits mailing list