mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 07:58:23 +08:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user