[llvm] 47302af - [Orc] Skip sections with duplicate names in DebugObjectManagerPlugin

Stefan Gränitz via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 01:17:39 PDT 2023


Author: Stefan Gränitz
Date: 2023-03-31T10:17:19+02:00
New Revision: 47302af71d57814469a3596c78381fc720ed130d

URL: https://github.com/llvm/llvm-project/commit/47302af71d57814469a3596c78381fc720ed130d
DIFF: https://github.com/llvm/llvm-project/commit/47302af71d57814469a3596c78381fc720ed130d.diff

LOG: [Orc] Skip sections with duplicate names in DebugObjectManagerPlugin

Compiler-generated section names can clash. Examples are group sections or profile counter sections.
We don't need to abort debug registration for the entire LinkGraph in such a case.
Instead, let's skip the relevant sections and add a note to the debug log.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
index 75d3344e8d89b..922c60bb5a8cc 100644
--- a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
@@ -372,11 +372,12 @@ Error ELFDebugObject::recordSection(
   if (Error Err = Section->validateInBounds(this->getBuffer(), Name.data()))
     return Err;
   auto ItInserted = Sections.try_emplace(Name, std::move(Section));
-  if (!ItInserted.second)
-    return make_error<StringError>("In " + Buffer->getBufferIdentifier() +
-				   ", encountered duplicate section \"" +
-				   Name + "\" while building debug object",
-                                   inconvertibleErrorCode());
+  LLVM_DEBUG({
+    if (!ItInserted.second)
+      dbgs() << "Skipping debug registration for section '" << Name << "' "
+             << "in object " << Buffer->getBufferIdentifier()
+             << " (duplicate name)\n";
+  });
   return Error::success();
 }
 


        


More information about the llvm-commits mailing list