[Lldb-commits] [lldb] 4e090b6 - [lldb] Re-insert code to search for a binary by filepath if provided

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 17 17:41:39 PDT 2025


Author: Jason Molenda
Date: 2025-06-17T17:41:31-07:00
New Revision: 4e090b6e84e33e2a442e3951253ca570f8f842f8

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

LOG: [lldb] Re-insert code to search for a binary by filepath if provided

July 14 2024 I landed a change to update progress reporting when
loading kernel/firmware binaries
https://github.com/llvm/llvm-project/pull/98845
In DynamicLoader::LoadBinaryWithUUIDAndAddress I removed code that
was setting the ModuleSpec to the provided name, if the name provided
is that of a file on disk.  With this code missing, if a filepath
name is passed in, this code will fail to find that binary on the local
disk.  There's nothing in the PR / intention that would lead to this
change, it was unintentional.

Added: 
    

Modified: 
    lldb/source/Core/DynamicLoader.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp
index 291e6b73a2c39..4be9f3eb9abc5 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -229,6 +229,8 @@ ModuleSP DynamicLoader::LoadBinaryWithUUIDAndAddress(
   ModuleSpec module_spec;
   module_spec.GetUUID() = uuid;
   FileSpec name_filespec(name);
+  if (FileSystem::Instance().Exists(name_filespec))
+    module_spec.GetFileSpec() = name_filespec;
 
   if (uuid.IsValid()) {
     Progress progress("Locating binary", prog_str.GetString().str());


        


More information about the lldb-commits mailing list