Added more platform support. There are now some new commands:
platform status -- gets status information for the selected platform
platform create <platform-name> -- creates a new instance of a remote platform
platform list -- list all available platforms
platform select -- select a platform instance as the current platform (not working yet)
When using "platform create" it will create a remote platform and make it the
selected platform. For instances for iPhone OS debugging on Mac OS X one can
do:
(lldb) platform create remote-ios --sdk-version=4.0
Remote platform: iOS platform
SDK version: 4.0
SDK path: "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0"
Not connected to a remote device.
(lldb) file ~/Documents/a.out
Current executable set to '~/Documents/a.out' (armv6).
(lldb) image list
[ 0] /Volumes/work/gclayton/Documents/devb/attach/a.out
[ 1] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/dyld
[ 2] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/libSystem.B.dylib
Note that this is all happening prior to running _or_ connecting to a remote
platform. Once connected to a remote platform the OS version might change which
means we will need to update our dependecies. Also once we run, we will need
to match up the actualy binaries with the actualy UUID's to files in the
SDK, or download and cache them locally.
This is just the start of the remote platforms, but this modification is the
first iteration in getting the platforms really doing something.
llvm-svn: 127934
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 3d8849f..60f2e2d 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -39,8 +39,9 @@
//----------------------------------------------------------------------
// Target constructor
//----------------------------------------------------------------------
-Target::Target(Debugger &debugger) :
+Target::Target(Debugger &debugger, const lldb::PlatformSP &platform_sp) :
Broadcaster("lldb.target"),
+ m_platform_sp (platform_sp),
TargetInstanceSettings (*GetSettingsController()),
m_debugger (debugger),
m_mutex (Mutex::eMutexTypeRecursive),
@@ -418,33 +419,21 @@
FileSpecList dependent_files;
ObjectFile *executable_objfile = executable_sp->GetObjectFile();
- assert (executable_objfile);
- // TODO: remote assertion above after verifying that it doesn't fire off
- // after the platform changes. The platform is what should be selecting
- // the right slice of an executable file, and it also should be the one
- // to resolve any executables in their bundles.
-// if (executable_objfile == NULL)
-// {
-//
-// FileSpec bundle_executable(executable_sp->GetFileSpec());
-// if (Host::ResolveExecutableInBundle (bundle_executable))
-// {
-// ModuleSP bundle_exe_module_sp(GetSharedModule(bundle_executable,
-// exe_arch));
-// SetExecutableModule (bundle_exe_module_sp, get_dependent_files);
-// if (bundle_exe_module_sp->GetObjectFile() != NULL)
-// executable_sp = bundle_exe_module_sp;
-// return;
-// }
-// }
if (executable_objfile)
{
executable_objfile->GetDependentModules(dependent_files);
for (uint32_t i=0; i<dependent_files.GetSize(); i++)
{
- ModuleSP image_module_sp(GetSharedModule(dependent_files.GetFileSpecPointerAtIndex(i),
- exe_arch));
+ FileSpec dependent_file_spec (dependent_files.GetFileSpecPointerAtIndex(i));
+ FileSpec platform_dependent_file_spec;
+ if (m_platform_sp)
+ m_platform_sp->GetFile (dependent_file_spec, platform_dependent_file_spec);
+ else
+ platform_dependent_file_spec = dependent_file_spec;
+
+ ModuleSP image_module_sp(GetSharedModule (platform_dependent_file_spec,
+ exe_arch));
if (image_module_sp.get())
{
//image_module_sp->Dump(&s);// REMOVE THIS, DEBUG ONLY