[Lldb-commits] [lldb] Bug fix in FindModuleUUID (PR #137075)

via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 23 15:30:06 PDT 2025


https://github.com/GeorgeHuyubo created https://github.com/llvm/llvm-project/pull/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.

>From 2542d34b2259f2540ca319f9b46e4f898427146e Mon Sep 17 00:00:00 2001
From: George Hu <georgehuyubo at gmail.com>
Date: Wed, 23 Apr 2025 15:24:55 -0700
Subject: [PATCH] Bug fix in FindModuleUUID

---
 lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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();
 }



More information about the lldb-commits mailing list