summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
authorOleksiy Vyalov <ovyalov@google.com>2015-03-13 18:44:56 +0000
committerOleksiy Vyalov <ovyalov@google.com>2015-03-13 18:44:56 +0000
commit6474721c10394e88fa631df644563da2d6ca55c0 (patch)
treec860152282746dc7ab54276a34e6ef4e18085b46 /lldb/source/Target/Platform.cpp
parent6afcfce2d9bd298b83a0259ced8d64b72c24c3a8 (diff)
downloadbcm5719-llvm-6474721c10394e88fa631df644563da2d6ca55c0.tar.gz
bcm5719-llvm-6474721c10394e88fa631df644563da2d6ca55c0.zip
Extend Platform(s) in order to cache remote executables using ModuleCache and make POSIX dynamic loader to use this flow when attaching to a remote target.
http://reviews.llvm.org/D8306 llvm-svn: 232194
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r--lldb/source/Target/Platform.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index f5941706377..d8ad8c7b719 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -1752,6 +1752,43 @@ Platform::GetTrapHandlerSymbolNames ()
return m_trap_handlers;
}
+Error
+Platform::GetCachedExecutable (ModuleSpec &module_spec,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ Platform &remote_platform)
+{
+ const auto platform_spec = module_spec.GetFileSpec ();
+ const auto error = LoadCachedExecutable (module_spec,
+ module_sp,
+ module_search_paths_ptr,
+ remote_platform);
+ if (error.Success ())
+ {
+ module_spec.GetFileSpec () = module_sp->GetFileSpec ();
+ module_spec.GetPlatformFileSpec () = platform_spec;
+ }
+
+ return error;
+}
+
+Error
+Platform::LoadCachedExecutable (const ModuleSpec &module_spec,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ Platform &remote_platform)
+{
+ if (GetGlobalPlatformProperties ()->GetUseModuleCache ())
+ {
+ if (GetCachedSharedModule (module_spec, module_sp))
+ return Error ();
+ }
+
+ return remote_platform.ResolveExecutable (module_spec,
+ module_sp,
+ module_search_paths_ptr);
+}
+
bool
Platform::GetCachedSharedModule (const ModuleSpec &module_spec,
lldb::ModuleSP &module_sp)
OpenPOWER on IntegriCloud