diff options
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX')
9 files changed, 40 insertions, 92 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index b3775d410ae..b958e0fe870 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -232,7 +232,7 @@ PlatformDarwin::ResolveExecutable (const FileSpec &exe_file, { error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s", exe_file.GetPath().c_str(), - GetShortPluginName(), + GetPluginName().GetCString(), arch_names.GetString().c_str()); } } @@ -501,7 +501,7 @@ PlatformDarwin::ConnectRemote (Args& args) Error error; if (IsHost()) { - error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetShortPluginName()); + error.SetErrorStringWithFormat ("can't connect to the host platform '%s', always connected", GetPluginName().GetCString()); } else { @@ -539,7 +539,7 @@ PlatformDarwin::DisconnectRemote () if (IsHost()) { - error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetShortPluginName()); + error.SetErrorStringWithFormat ("can't disconnect from the host platform '%s', always connected", GetPluginName().GetCString()); } else { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 6b6b8030608..104285f19b6 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -53,7 +53,7 @@ PlatformDarwinKernel::Initialize () { if (g_initialize_count++ == 0) { - PluginManager::RegisterPlugin (PlatformDarwinKernel::GetShortPluginNameStatic(), + PluginManager::RegisterPlugin (PlatformDarwinKernel::GetPluginNameStatic(), PlatformDarwinKernel::GetDescriptionStatic(), PlatformDarwinKernel::CreateInstance, PlatformDarwinKernel::DebuggerInitialize); @@ -147,16 +147,11 @@ PlatformDarwinKernel::CreateInstance (bool force, const ArchSpec *arch) } -const char * +lldb_private::ConstString PlatformDarwinKernel::GetPluginNameStatic () { - return "PlatformDarwinKernel"; -} - -const char * -PlatformDarwinKernel::GetShortPluginNameStatic() -{ - return "darwin-kernel"; + static ConstString g_name("darwin-kernel"); + return g_name; } const char * diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h index 0b9b93677e5..3d2035f64f9 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h @@ -40,13 +40,10 @@ public: static void Terminate (); - static const char * + static lldb_private::ConstString GetPluginNameStatic (); static const char * - GetShortPluginNameStatic(); - - static const char * GetDescriptionStatic(); //------------------------------------------------------------ @@ -60,18 +57,12 @@ public: //------------------------------------------------------------ // lldb_private::PluginInterface functions //------------------------------------------------------------ - virtual const char * + virtual lldb_private::ConstString GetPluginName() { return GetPluginNameStatic(); } - virtual const char * - GetShortPluginName() - { - return GetShortPluginNameStatic(); - } - virtual uint32_t GetPluginVersion() { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index cf783119a1d..16bcafd97b8 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -41,7 +41,7 @@ PlatformMacOSX::Initialize () default_platform_sp->SetSystemArchitecture (Host::GetArchitecture()); Platform::SetDefaultPlatform (default_platform_sp); #endif - PluginManager::RegisterPlugin (PlatformMacOSX::GetShortPluginNameStatic(false), + PluginManager::RegisterPlugin (PlatformMacOSX::GetPluginNameStatic(false), PlatformMacOSX::GetDescriptionStatic(false), PlatformMacOSX::CreateInstance); } @@ -115,20 +115,19 @@ PlatformMacOSX::CreateInstance (bool force, const ArchSpec *arch) return NULL; } - -const char * -PlatformMacOSX::GetPluginNameStatic () -{ - return "PlatformMacOSX"; -} - -const char * -PlatformMacOSX::GetShortPluginNameStatic (bool is_host) +lldb_private::ConstString +PlatformMacOSX::GetPluginNameStatic (bool is_host) { if (is_host) - return Platform::GetHostPlatformName (); + { + static ConstString g_host_name(Platform::GetHostPlatformName ()); + return g_host_name; + } else - return "remote-macosx"; + { + static ConstString g_remote_name("remote-macosx"); + return g_remote_name; + } } const char * diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h index 3a5eaf0072a..b93c5fa6921 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h @@ -32,11 +32,8 @@ public: static void Terminate (); - static const char * - GetPluginNameStatic (); - - static const char * - GetShortPluginNameStatic(bool is_host); + static lldb_private::ConstString + GetPluginNameStatic (bool is_host); static const char * GetDescriptionStatic(bool is_host); @@ -52,16 +49,10 @@ public: //------------------------------------------------------------ // lldb_private::PluginInterface functions //------------------------------------------------------------ - virtual const char * + virtual lldb_private::ConstString GetPluginName() { - return GetPluginNameStatic (); - } - - virtual const char * - GetShortPluginName() - { - return GetShortPluginNameStatic (IsHost()); + return GetPluginNameStatic (IsHost()); } virtual uint32_t diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index fe6d358e6fc..7969aa819cf 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -65,7 +65,7 @@ PlatformRemoteiOS::Initialize () { if (g_initialize_count++ == 0) { - PluginManager::RegisterPlugin (PlatformRemoteiOS::GetShortPluginNameStatic(), + PluginManager::RegisterPlugin (PlatformRemoteiOS::GetPluginNameStatic(), PlatformRemoteiOS::GetDescriptionStatic(), PlatformRemoteiOS::CreateInstance); } @@ -148,16 +148,11 @@ PlatformRemoteiOS::CreateInstance (bool force, const ArchSpec *arch) } -const char * +lldb_private::ConstString PlatformRemoteiOS::GetPluginNameStatic () { - return "PlatformRemoteiOS"; -} - -const char * -PlatformRemoteiOS::GetShortPluginNameStatic() -{ - return "remote-ios"; + static ConstString g_name("remote-ios"); + return g_name; } const char * @@ -279,7 +274,7 @@ PlatformRemoteiOS::ResolveExecutable (const FileSpec &exe_file, { error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s", exe_file.GetPath().c_str(), - GetShortPluginName(), + GetPluginName().GetCString(), arch_names.GetString().c_str()); } } @@ -661,7 +656,7 @@ PlatformRemoteiOS::GetSymbolFile (const FileSpec &platform_file, error.SetErrorStringWithFormat ("unable to locate a platform file for '%s' in platform '%s'", platform_file_path, - GetPluginName()); + GetPluginName().GetCString()); } else { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h index d52c6b09df7..ef59b124d8e 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h @@ -34,13 +34,10 @@ public: static void Terminate (); - static const char * + static lldb_private::ConstString GetPluginNameStatic (); static const char * - GetShortPluginNameStatic(); - - static const char * GetDescriptionStatic(); //------------------------------------------------------------ @@ -54,18 +51,12 @@ public: //------------------------------------------------------------ // lldb_private::PluginInterface functions //------------------------------------------------------------ - virtual const char * + virtual lldb_private::ConstString GetPluginName() { return GetPluginNameStatic(); } - virtual const char * - GetShortPluginName() - { - return GetShortPluginNameStatic(); - } - virtual uint32_t GetPluginVersion() { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp index 5f1cfc8dc86..806eb7d60ea 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -42,7 +42,7 @@ PlatformiOSSimulator::Initialize () { if (g_initialize_count++ == 0) { - PluginManager::RegisterPlugin (PlatformiOSSimulator::GetShortPluginNameStatic(), + PluginManager::RegisterPlugin (PlatformiOSSimulator::GetPluginNameStatic(), PlatformiOSSimulator::GetDescriptionStatic(), PlatformiOSSimulator::CreateInstance); } @@ -124,16 +124,11 @@ PlatformiOSSimulator::CreateInstance (bool force, const ArchSpec *arch) } -const char * +lldb_private::ConstString PlatformiOSSimulator::GetPluginNameStatic () { - return "PlatformiOSSimulator"; -} - -const char * -PlatformiOSSimulator::GetShortPluginNameStatic() -{ - return "ios-simulator"; + static ConstString g_name("ios-simulator"); + return g_name; } const char * @@ -242,7 +237,7 @@ PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file, { error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s", exe_file.GetPath().c_str(), - GetShortPluginName(), + GetPluginName().GetCString(), arch_names.GetString().c_str()); } } @@ -352,7 +347,7 @@ PlatformiOSSimulator::GetFile (const FileSpec &platform_file, } error.SetErrorStringWithFormat ("unable to locate a platform file for '%s' in platform '%s'", platform_file_path, - GetPluginName()); + GetPluginName().GetCString()); } else { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h index 36b554b5404..ce818c431a7 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h @@ -32,13 +32,10 @@ public: static void Terminate (); - static const char * + static lldb_private::ConstString GetPluginNameStatic (); static const char * - GetShortPluginNameStatic(); - - static const char * GetDescriptionStatic(); //------------------------------------------------------------ @@ -52,18 +49,12 @@ public: //------------------------------------------------------------ // lldb_private::PluginInterface functions //------------------------------------------------------------ - virtual const char * + virtual lldb_private::ConstString GetPluginName() { return GetPluginNameStatic(); } - virtual const char * - GetShortPluginName() - { - return GetShortPluginNameStatic(); - } - virtual uint32_t GetPluginVersion() { |

