[Lldb-commits] [lldb] [LLDB] Fix remote executables load and caching (PR #98623)

Vladislav Dzhidzhoev via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 12 05:28:20 PDT 2024


https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/98623

>From b86d6f9ea1b54cbd5ac54b8aae8971862c6536b5 Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Thu, 11 Jul 2024 17:53:08 +0200
Subject: [PATCH] [LLDB] Fix remote executables load and caching

Seemingly, #96256 removed the only call to
Platform::GetCachedExecutable, which broke the resolution of executable
modules in the remote debugging mode
(https://github.com/llvm/llvm-project/issues/97410).

This commit fixes that.
---
 lldb/source/Target/Platform.cpp            | 3 ++-
 lldb/source/Target/RemoteAwarePlatform.cpp | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index bb90c377d86b2..ab80fe4c8ba24 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -1446,7 +1446,8 @@ Platform::GetCachedExecutable(ModuleSpec &module_spec,
   Status error = GetRemoteSharedModule(
       module_spec, nullptr, module_sp,
       [&](const ModuleSpec &spec) {
-        return ResolveExecutable(spec, module_sp, module_search_paths_ptr);
+        return Platform::ResolveExecutable(spec, module_sp,
+                                           module_search_paths_ptr);
       },
       nullptr);
   if (error.Success()) {
diff --git a/lldb/source/Target/RemoteAwarePlatform.cpp b/lldb/source/Target/RemoteAwarePlatform.cpp
index 5fc2d63876b92..cac738ea67b4c 100644
--- a/lldb/source/Target/RemoteAwarePlatform.cpp
+++ b/lldb/source/Target/RemoteAwarePlatform.cpp
@@ -46,6 +46,9 @@ Status RemoteAwarePlatform::ResolveExecutable(
 
     if (!FileSystem::Instance().Exists(resolved_file_spec))
       FileSystem::Instance().ResolveExecutableLocation(resolved_file_spec);
+  } else if (m_remote_platform_sp) {
+    return GetCachedExecutable(resolved_module_spec, exe_module_sp,
+                               module_search_paths_ptr);
   }
 
   return Platform::ResolveExecutable(resolved_module_spec, exe_module_sp,



More information about the lldb-commits mailing list