[Lldb-commits] [lldb] r294114 - Clean up PlatformLinux code
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Sat Feb 4 17:04:10 PST 2017
Author: labath
Date: Sat Feb 4 19:04:10 2017
New Revision: 294114
URL: http://llvm.org/viewvc/llvm-project?rev=294114&view=rev
Log:
Clean up PlatformLinux code
don't create a platform.linux setting category, as it contains no
actual settings, and I don't forsee adding any soon. Also remove some
unused includes while I'm in there.
Modified:
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=294114&r1=294113&r2=294114&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Sat Feb 4 19:04:10 2017
@@ -19,18 +19,12 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Log.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/ModuleList.h"
-#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/State.h"
#include "lldb/Host/FileSpec.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Interpreter/OptionValueProperties.h"
-#include "lldb/Interpreter/Property.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Error.h"
@@ -48,63 +42,6 @@ using namespace lldb_private::platform_l
static uint32_t g_initialize_count = 0;
//------------------------------------------------------------------
-/// Code to handle the PlatformLinux settings
-//------------------------------------------------------------------
-
-namespace {
-class PlatformLinuxProperties : public Properties {
-public:
- PlatformLinuxProperties();
-
- ~PlatformLinuxProperties() override = default;
-
- static ConstString &GetSettingName();
-
-private:
- static const PropertyDefinition *GetStaticPropertyDefinitions();
-};
-
-typedef std::shared_ptr<PlatformLinuxProperties> PlatformLinuxPropertiesSP;
-
-} // anonymous namespace
-
-PlatformLinuxProperties::PlatformLinuxProperties() : Properties() {
- m_collection_sp.reset(new OptionValueProperties(GetSettingName()));
- m_collection_sp->Initialize(GetStaticPropertyDefinitions());
-}
-
-ConstString &PlatformLinuxProperties::GetSettingName() {
- static ConstString g_setting_name("linux");
- return g_setting_name;
-}
-
-const PropertyDefinition *
-PlatformLinuxProperties::GetStaticPropertyDefinitions() {
- static PropertyDefinition g_properties[] = {
- {NULL, OptionValue::eTypeInvalid, false, 0, NULL, NULL, NULL}};
-
- return g_properties;
-}
-
-static const PlatformLinuxPropertiesSP &GetGlobalProperties() {
- static PlatformLinuxPropertiesSP g_settings_sp;
- if (!g_settings_sp)
- g_settings_sp.reset(new PlatformLinuxProperties());
- return g_settings_sp;
-}
-
-void PlatformLinux::DebuggerInitialize(Debugger &debugger) {
- if (!PluginManager::GetSettingForPlatformPlugin(
- debugger, PlatformLinuxProperties::GetSettingName())) {
- const bool is_global_setting = true;
- PluginManager::CreateSettingForPlatformPlugin(
- debugger, GetGlobalProperties()->GetValueProperties(),
- ConstString("Properties for the PlatformLinux plug-in."),
- is_global_setting);
- }
-}
-
-//------------------------------------------------------------------
PlatformSP PlatformLinux::CreateInstance(bool force, const ArchSpec *arch) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
@@ -191,7 +128,7 @@ void PlatformLinux::Initialize() {
PluginManager::RegisterPlugin(
PlatformLinux::GetPluginNameStatic(false),
PlatformLinux::GetPluginDescriptionStatic(false),
- PlatformLinux::CreateInstance, PlatformLinux::DebuggerInitialize);
+ PlatformLinux::CreateInstance, nullptr);
}
}
Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=294114&r1=294113&r2=294114&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Sat Feb 4 19:04:10 2017
@@ -10,10 +10,6 @@
#ifndef liblldb_PlatformLinux_h_
#define liblldb_PlatformLinux_h_
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
#include "Plugins/Platform/POSIX/PlatformPOSIX.h"
namespace lldb_private {
@@ -25,8 +21,6 @@ public:
~PlatformLinux() override;
- static void DebuggerInitialize(Debugger &debugger);
-
static void Initialize();
static void Terminate();
More information about the lldb-commits
mailing list