[Lldb-commits] [lldb] [lldb] Fix missing comsumeError() with LLDB_LOG in ObjectFileCOFF/PECOFF (PR #70793)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 31 13:07:06 PDT 2023


================
@@ -271,9 +271,9 @@ void ObjectFileCOFF::ParseSymtab(lldb_private::Symtab &symtab) {
     const auto COFFSymRef = m_object->getCOFFSymbol(SymRef);
 
     Expected<StringRef> NameOrErr = SymRef.getName();
-    if (auto error = NameOrErr.takeError()) {
-      LLDB_LOG(log, "ObjectFileCOFF: failed to get symbol name: {0}",
-               llvm::fmt_consume(std::move(error)));
+    if (!NameOrErr) {
+      LLDB_LOG_ERROR(log, NameOrErr.takeError(),
+                     "ObjectFileCOFF: failed to get symbol name: {0}");
----------------
medismailben wrote:

I don't think you need to specify `ObjectFileCOFF:` anymore since `LLDB_LOG_ERROR` will take care of adding the file name and the function symbol for you.

https://github.com/llvm/llvm-project/pull/70793


More information about the lldb-commits mailing list