[PATCH] D109401: Log to the right stream in DwarfTransformer::handleDie().

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 16:12:41 PDT 2021


clayborg created this revision.
clayborg added reviewers: aadsm, wallace.
Herald added a subscriber: hiraditya.
clayborg requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Since we might end up using multiple threads when logging information in the DWARFTransformer, the handleDie() method must use the supplied stream named "OS" when logging warnings and errors. When we use multiple threads, we log to a thread specific stream buffer and then use a mutex to ensure our output doesn't overlap when we emit warnings and errors after a thread is done.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109401

Files:
  llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp


Index: llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
===================================================================
--- llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -392,11 +392,11 @@
         if (Range.LowPC != 0) {
           if (!Gsym.isQuiet()) {
             // Unexpected invalid address, emit a warning
-            Log << "warning: DIE has an address range whose start address is "
-                   "not in any executable sections ("
-                << *Gsym.GetValidTextRanges()
-                << ") and will not be processed:\n";
-            Die.dump(Log, 0, DIDumpOptions::getForSingleDIE());
+            OS << "warning: DIE has an address range whose start address is "
+                  "not in any executable sections ("
+               << *Gsym.GetValidTextRanges()
+               << ") and will not be processed:\n";
+            Die.dump(OS, 0, DIDumpOptions::getForSingleDIE());
           }
         }
         break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109401.371210.patch
Type: text/x-patch
Size: 1003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210907/c5d0fac3/attachment.bin>


More information about the llvm-commits mailing list