[Lldb-commits] [lldb] 5d372ea - [LLDB][DYLD] Remove logic around not rebasing when main executable has a load address (#110885)

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 7 09:46:00 PDT 2024


Author: Jacob Lalonde
Date: 2024-10-07T09:45:56-07:00
New Revision: 5d372ea6a1e438b8e9583391d40cfcf34210d4f7

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

LOG: [LLDB][DYLD] Remove logic around not rebasing when main executable has a load address (#110885)

This is a part of #109477 that I'm making into it's own patch. Here we
remove logic from the DYLD that prevents it's logic from running if the
main executable already has a load address. Instead we let the DYLD
fully determine what should be loaded and what shouldn't.

Added: 
    

Modified: 
    lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 51e4b3e6728f23..b9c0e174c3be68 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -108,21 +108,6 @@ void DynamicLoaderPOSIXDYLD::DidAttach() {
   // if we dont have a load address we cant re-base
   bool rebase_exec = load_offset != LLDB_INVALID_ADDRESS;
 
-  // if we have a valid executable
-  if (executable_sp.get()) {
-    lldb_private::ObjectFile *obj = executable_sp->GetObjectFile();
-    if (obj) {
-      // don't rebase if the module already has a load address
-      Target &target = m_process->GetTarget();
-      Address addr = obj->GetImageInfoAddress(&target);
-      if (addr.GetLoadAddress(&target) != LLDB_INVALID_ADDRESS)
-        rebase_exec = false;
-    }
-  } else {
-    // no executable, nothing to re-base
-    rebase_exec = false;
-  }
-
   // if the target executable should be re-based
   if (rebase_exec) {
     ModuleList module_list;


        


More information about the lldb-commits mailing list