From 5f9d310640209347c6e534a4ed97074d205e1766 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Thu, 27 Aug 2015 21:33:50 +0000 Subject: Add a new type of plugin: Language plugin The Language plugin is menat to answer language-specific questions that are not bound to the existence of a process. Those are still the domain of the LanguageRuntime plugin The Language plugin will, instead, answer questions such as providing language-specific data formatters or expression evaluation At the moment, the interface is hollowed out, and empty do-nothing plugins have been setup for ObjC, C++ and ObjC++ llvm-svn: 246212 --- lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp (limited to 'lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp') diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp new file mode 100644 index 00000000000..8f21c46bfe3 --- /dev/null +++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp @@ -0,0 +1,68 @@ +//===-- ObjCLanguage.cpp --------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "ObjCLanguage.h" + +#include "lldb/Core/ConstString.h" +#include "lldb/Core/PluginManager.h" + +using namespace lldb; +using namespace lldb_private; + +void +ObjCLanguage::Initialize() +{ + PluginManager::RegisterPlugin (GetPluginNameStatic(), + "Objective-C Language", + CreateInstance); +} + +void +ObjCLanguage::Terminate() +{ + PluginManager::UnregisterPlugin (CreateInstance); +} + +lldb_private::ConstString +ObjCLanguage::GetPluginNameStatic() +{ + static ConstString g_name("objc"); + return g_name; +} + + +//------------------------------------------------------------------ +// PluginInterface protocol +//------------------------------------------------------------------ +lldb_private::ConstString +ObjCLanguage::GetPluginName() +{ + return GetPluginNameStatic(); +} + +uint32_t +ObjCLanguage::GetPluginVersion() +{ + return 1; +} + +//------------------------------------------------------------------ +// Static Functions +//------------------------------------------------------------------ +Language * +ObjCLanguage::CreateInstance (lldb::LanguageType language) +{ + switch (language) + { + case lldb::eLanguageTypeObjC: + return new ObjCLanguage(); + default: + return nullptr; + } +} -- cgit v1.2.3