[Lldb-commits] [PATCH] D147669: PECOFF: consume errors properly

Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 17 07:55:54 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd87cd45e4d85: PECOFF: consume errors properly (authored by Saleem Abdulrasool <abdulras at thebrowser.company>).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147669/new/

https://reviews.llvm.org/D147669

Files:
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp


Index: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
===================================================================
--- lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -863,10 +863,14 @@
   for (const auto &entry : m_binary->export_directories()) {
     llvm::StringRef sym_name;
     if (auto err = entry.getSymbolName(sym_name)) {
-      LLDB_LOG(log,
-               "ObjectFilePECOFF::AppendFromExportTable - failed to get export "
-               "table entry name: {0}",
-               llvm::fmt_consume(std::move(err)));
+      if (log)
+        log->Format(
+            __FILE__, __func__,
+            "ObjectFilePECOFF::AppendFromExportTable - failed to get export "
+            "table entry name: {0}",
+            llvm::fmt_consume(std::move(err)));
+      else
+        llvm::consumeError(std::move(err));
       continue;
     }
     Symbol symbol;
@@ -884,10 +888,13 @@
       // it in symtab and make a note using the symbol name.
       llvm::StringRef forwarder_name;
       if (auto err = entry.getForwardTo(forwarder_name)) {
-        LLDB_LOG(log,
-                 "ObjectFilePECOFF::AppendFromExportTable - failed to get "
-                 "forwarder name of forwarder export '{0}': {1}",
-                 sym_name, llvm::fmt_consume(std::move(err)));
+        if (log)
+          log->Format(__FILE__, __func__,
+                      "ObjectFilePECOFF::AppendFromExportTable - failed to get "
+                      "forwarder name of forwarder export '{0}': {1}",
+                      sym_name, llvm::fmt_consume(std::move(err)));
+        else
+          llvm::consumeError(std::move(err));
         continue;
       }
       llvm::SmallString<256> new_name = {symbol.GetDisplayName().GetStringRef(),
@@ -899,10 +906,13 @@
 
     uint32_t function_rva;
     if (auto err = entry.getExportRVA(function_rva)) {
-      LLDB_LOG(log,
-               "ObjectFilePECOFF::AppendFromExportTable - failed to get "
-               "address of export entry '{0}': {1}",
-               sym_name, llvm::fmt_consume(std::move(err)));
+      if (log)
+        log->Format(__FILE__, __func__,
+                    "ObjectFilePECOFF::AppendFromExportTable - failed to get "
+                    "address of export entry '{0}': {1}",
+                    sym_name, llvm::fmt_consume(std::move(err)));
+      else
+        llvm::consumeError(std::move(err));
       continue;
     }
     // Skip the symbol if it doesn't look valid.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147669.514242.patch
Type: text/x-patch
Size: 2545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230417/faa42c74/attachment-0001.bin>


More information about the lldb-commits mailing list