diff options
author | Greg Clayton <gclayton@apple.com> | 2011-03-23 00:09:55 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-03-23 00:09:55 +0000 |
commit | d314e810a70e9104c8d30d9b0719bc5a3dc0acab (patch) | |
tree | 0d881e5b16df61aa732dea1555adecf675db83e8 /lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp | |
parent | 7ca3ddc2333a05f60be578cffc93610a34638602 (diff) | |
download | bcm5719-llvm-d314e810a70e9104c8d30d9b0719bc5a3dc0acab.tar.gz bcm5719-llvm-d314e810a70e9104c8d30d9b0719bc5a3dc0acab.zip |
Added new platform commands:
platform connect <args>
platform disconnect
Each platform can decide the args they want to use for "platform connect". I
will need to add a function that gets the connect options for the current
platform as each one can have different options and argument counts.
Hooked up more functionality in the PlatformMacOSX and PlatformRemoteiOS.
Also started an platform agnostic PlatformRemoteGDBServer.cpp which can end
up being used by one or more actual platforms. It can also be specialized and
allow for platform specific commands.
llvm-svn: 128123
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp | 89 |
1 files changed, 79 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index c0bece1f207..fa6fcdc3d4a 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -1,4 +1,4 @@ -//===-- Platform.cpp --------------------------------------------*- C++ -*-===// +//===-- PlatformRemoteiOS.cpp -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -27,18 +27,28 @@ using namespace lldb; using namespace lldb_private; + +static bool g_initialized = false; void PlatformRemoteiOS::Initialize () { - static bool g_initialized = false; - if (g_initialized == false) { g_initialized = true; - PluginManager::RegisterPlugin (GetShortPluginNameStatic(), - GetDescriptionStatic(), - CreateInstance); + PluginManager::RegisterPlugin (PlatformRemoteiOS::GetShortPluginNameStatic(), + PlatformRemoteiOS::GetDescriptionStatic(), + PlatformRemoteiOS::CreateInstance); + } +} + +void +PlatformRemoteiOS::Terminate () +{ + if (g_initialized) + { + g_initialized = false; + PluginManager::UnregisterPlugin (PlatformRemoteiOS::CreateInstance); } } @@ -48,10 +58,6 @@ PlatformRemoteiOS::CreateInstance () return new PlatformRemoteiOS (); } -void -PlatformRemoteiOS::Terminate () -{ -} const char * PlatformRemoteiOS::GetPluginNameStatic () @@ -358,6 +364,7 @@ PlatformRemoteiOS::GetDeviceSupportDirectoryForOSVersion() Error PlatformRemoteiOS::GetFile (const FileSpec &platform_file, + const UUID *uuid_ptr, FileSpec &local_file) { Error error; @@ -442,6 +449,29 @@ PlatformRemoteiOS::GetProcessInfo (lldb::pid_t pid, ProcessInfo &process_info) return false; } +const char * +PlatformRemoteiOS::GetRemoteInstanceName () +{ + if (m_remote_instance_name.empty()) + { + const char *device_support_dir = GetDeviceSupportDirectory(); + if (device_support_dir) + { + std::string latest_device_support_dir; + latest_device_support_dir.assign (device_support_dir); + latest_device_support_dir.append ("/Platforms/iPhoneOS.platform/DeviceSupport/Latest"); + const bool resolve_path = true; + FileSpec file_spec (m_device_support_directory_for_os_version.c_str(), resolve_path); + // We are using the resolved basename of the "Latest" symlink (which + // is usually the latest and greatest SDK version and the update + // which is something like: "4.0 (8A123)" + if (file_spec.Exists()) + m_remote_instance_name.assign (file_spec.GetFilename().GetCString()); + } + } + return m_remote_instance_name.c_str(); +} + bool PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) { @@ -549,6 +579,13 @@ PlatformRemoteiOS::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch return false; } +bool +PlatformRemoteiOS::FetchRemoteOSVersion () +{ + return false; +} + + size_t PlatformRemoteiOS::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite *bp_site) { @@ -610,3 +647,35 @@ PlatformRemoteiOS::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSi return 0; } + +Error +PlatformRemoteiOS::ConnectRemote (Args& args) +{ + Error error; + error.SetErrorStringWithFormat ("'platform connect' is not implemented yet for platform '%s'", GetShortPluginNameStatic()); + +// if (args.GetArgumentCount() == 1) +// { +// const char *remote_url = args.GetArgumentAtIndex(0); +// ConnectionStatus status = m_gdb_client.Connect(remote_url, &error); +// if (status == eConnectionStatusSuccess) +// { +// m_gdb_client.GetHostInfo(); +// } +// } +// else +// { +// error.SetErrorString ("\"platform connect\" takes a single argument: <connect-url>"); +// } + + return error; +} + +Error +PlatformRemoteiOS::DisconnectRemote () +{ + Error error; + error.SetErrorStringWithFormat ("'platform disconnect' is not implemented yet for platform '%s'", GetShortPluginNameStatic()); +// m_gdb_client.Disconnect(&error); + return error; +} |