Author: GeorgeHuyubo
Date: 2025-04-23T15:46:12-07:00
New Revision: d72f1f92f469a5d0ee28dc89f72977634d90d111

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

LOG: Bug fix in FindModuleUUID (#137075)

In some core file, we are seeing that it's not always the case that the
ELF header would exist in the first region in NT_FILES section.
Therefore the FindModuleUUID is not able to find the module UUID by just
returning the first entry with path matching.

This fix change the behavior to continue search the NT_FILE entries
until finding a valid UUID with path matching.

Co-authored-by: George Hu <georgehuy...@gmail.com>

Added: 
    

Modified: 
    lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp 
b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 5f85f99ce7bdd..6635b15b669f1 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -289,7 +289,7 @@ void ProcessElfCore::UpdateBuildIdForNTFileEntries() {
 UUID ProcessElfCore::FindModuleUUID(const llvm::StringRef path) {
   // Returns the gnu uuid from matched NT_FILE entry
   for (NT_FILE_Entry &entry : m_nt_file_entries)
-    if (path == entry.path)
+    if (path == entry.path && entry.uuid.IsValid())
       return entry.uuid;
   return UUID();
 }


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to