summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-03-31 09:52:22 +0000
committerTamas Berghammer <tberghammer@google.com>2015-03-31 09:52:22 +0000
commitdb264a6d09b04f6794e786078bf727c1c10c798a (patch)
tree9da2cc27520248bda09229b65a3c1b5b8fc68964 /lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
parent96d1779e23fad278e9f48ebb0ae6450e7395d6e7 (diff)
downloadbcm5719-llvm-db264a6d09b04f6794e786078bf727c1c10c798a.tar.gz
bcm5719-llvm-db264a6d09b04f6794e786078bf727c1c10c798a.zip
Move several plugin to its own namespace
Affected paths: * Plugins/Platform/Android/* * Plugins/Platform/Linux/* * Plugins/Platform/gdb-server/* * Plugins/Process/Linux/* * Plugins/Process/gdb-remote/* Differential revision: http://reviews.llvm.org/D8654 llvm-svn: 233679
Diffstat (limited to 'lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp')
-rw-r--r--lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp109
1 files changed, 60 insertions, 49 deletions
diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
index cfa604aa739..7497c52511f 100644
--- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -44,6 +44,8 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_private::platform_linux;
+using namespace lldb_private::process_linux;
static uint32_t g_initialize_count = 0;
@@ -58,56 +60,66 @@ namespace
ePropertyUseLlgsForLocal = 0,
};
- const PropertyDefinition*
- GetStaticPropertyDefinitions ()
+ class PlatformLinuxProperties : public Properties
{
- static PropertyDefinition
- g_properties[] =
- {
- { "use-llgs-for-local" , OptionValue::eTypeBoolean, true, true, NULL, NULL, "Control whether the platform uses llgs for local debug sessions." },
- { NULL , OptionValue::eTypeInvalid, false, 0 , NULL, NULL, NULL }
- };
+ public:
+ static ConstString&
+ GetSettingName ();
- // Allow environment variable to disable llgs-local.
- if (getenv("PLATFORM_LINUX_DISABLE_LLGS_LOCAL"))
- g_properties[ePropertyUseLlgsForLocal].default_uint_value = false;
+ PlatformLinuxProperties();
- return g_properties;
- }
-}
+ virtual
+ ~PlatformLinuxProperties() = default;
-class PlatformLinuxProperties : public Properties
-{
-public:
+ bool
+ GetUseLlgsForLocal() const;
- static ConstString &
- GetSettingName ()
- {
- static ConstString g_setting_name("linux");
- return g_setting_name;
- }
+ private:
+ static const PropertyDefinition*
+ GetStaticPropertyDefinitions();
+ };
- PlatformLinuxProperties() :
+ typedef std::shared_ptr<PlatformLinuxProperties> PlatformLinuxPropertiesSP;
+
+} // anonymous namespace
+
+PlatformLinuxProperties::PlatformLinuxProperties() :
Properties ()
- {
- m_collection_sp.reset (new OptionValueProperties(GetSettingName ()));
- m_collection_sp->Initialize (GetStaticPropertyDefinitions ());
- }
+{
+ m_collection_sp.reset (new OptionValueProperties(GetSettingName ()));
+ m_collection_sp->Initialize (GetStaticPropertyDefinitions ());
+}
- virtual
- ~PlatformLinuxProperties()
- {
- }
+ConstString&
+PlatformLinuxProperties::GetSettingName ()
+{
+ static ConstString g_setting_name("linux");
+ return g_setting_name;
+}
+
+bool
+PlatformLinuxProperties::GetUseLlgsForLocal() const
+{
+ const uint32_t idx = ePropertyUseLlgsForLocal;
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, GetStaticPropertyDefinitions()[idx].default_uint_value != 0);
+}
- bool
- GetUseLlgsForLocal() const
+const PropertyDefinition*
+PlatformLinuxProperties::GetStaticPropertyDefinitions()
+{
+ static PropertyDefinition
+ g_properties[] =
{
- const uint32_t idx = ePropertyUseLlgsForLocal;
- return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, GetStaticPropertyDefinitions()[idx].default_uint_value != 0);
- }
-};
+ { "use-llgs-for-local" , OptionValue::eTypeBoolean, true, true, NULL, NULL, "Control whether the platform uses llgs for local debug sessions." },
+ { NULL , OptionValue::eTypeInvalid, false, 0 , NULL, NULL, NULL }
+ };
-typedef std::shared_ptr<PlatformLinuxProperties> PlatformLinuxPropertiesSP;
+ // Allow environment variable to disable llgs-local.
+ if (getenv("PLATFORM_LINUX_DISABLE_LLGS_LOCAL"))
+ g_properties[ePropertyUseLlgsForLocal].default_uint_value = false;
+
+ return g_properties;
+}
static const PlatformLinuxPropertiesSP &
GetGlobalProperties()
@@ -119,7 +131,7 @@ GetGlobalProperties()
}
void
-PlatformLinux::DebuggerInitialize (lldb_private::Debugger &debugger)
+PlatformLinux::DebuggerInitialize (Debugger &debugger)
{
if (!PluginManager::GetSettingForPlatformPlugin (debugger, PlatformLinuxProperties::GetSettingName()))
{
@@ -137,7 +149,7 @@ PlatformLinux::DebuggerInitialize (lldb_private::Debugger &debugger)
PlatformSP
PlatformLinux::CreateInstance (bool force, const ArchSpec *arch)
{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
+ Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
if (log)
{
const char *arch_name;
@@ -209,7 +221,7 @@ PlatformLinux::CreateInstance (bool force, const ArchSpec *arch)
}
-lldb_private::ConstString
+ConstString
PlatformLinux::GetPluginNameStatic (bool is_host)
{
if (is_host)
@@ -233,7 +245,7 @@ PlatformLinux::GetPluginDescriptionStatic (bool is_host)
return "Remote Linux user platform plug-in.";
}
-lldb_private::ConstString
+ConstString
PlatformLinux::GetPluginName()
{
return GetPluginNameStatic(IsHost());
@@ -673,7 +685,7 @@ PlatformLinux::DebugProcess (ProcessLaunchInfo &launch_info,
Target *target, // Can be NULL, if NULL create a new target, else use existing one
Error &error)
{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
+ Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
if (log)
log->Printf ("PlatformLinux::%s entered (target %p)", __FUNCTION__, static_cast<void*>(target));
@@ -844,10 +856,9 @@ PlatformLinux::CalculateTrapHandlerSymbolNames ()
}
Error
-PlatformLinux::LaunchNativeProcess (
- ProcessLaunchInfo &launch_info,
- lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
- NativeProcessProtocolSP &process_sp)
+PlatformLinux::LaunchNativeProcess (ProcessLaunchInfo &launch_info,
+ NativeProcessProtocol::NativeDelegate &native_delegate,
+ NativeProcessProtocolSP &process_sp)
{
#if !defined(__linux__)
return Error("Only implemented on Linux hosts");
@@ -883,7 +894,7 @@ PlatformLinux::LaunchNativeProcess (
Error
PlatformLinux::AttachNativeProcess (lldb::pid_t pid,
- lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+ NativeProcessProtocol::NativeDelegate &native_delegate,
NativeProcessProtocolSP &process_sp)
{
#if !defined(__linux__)
OpenPOWER on IntegriCloud