[Lldb-commits] [lldb] r246536 - Revert "Add support for language plugins to provide data formatters"
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 1 02:02:55 PDT 2015
Author: labath
Date: Tue Sep 1 04:02:54 2015
New Revision: 246536
URL: http://llvm.org/viewvc/llvm-project?rev=246536&view=rev
Log:
Revert "Add support for language plugins to provide data formatters"
This reverts r246515 (and related cmake fixes) as it breaks all libcxx tests.
Removed:
lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
lldb/trunk/source/DataFormatters/LanguageCategory.cpp
Modified:
lldb/trunk/cmake/LLDBDependencies.cmake
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/trunk/include/lldb/Target/Language.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/DataFormatters/CMakeLists.txt
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
lldb/trunk/source/Plugins/Language/CMakeLists.txt
lldb/trunk/source/Target/Language.cpp
Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Tue Sep 1 04:02:54 2015
@@ -20,10 +20,6 @@ set( LLDB_USED_LIBS
lldbPluginDynamicLoaderPosixDYLD
lldbPluginDynamicLoaderHexagonDYLD
lldbPluginDynamicLoaderWindowsDYLD
-
- lldbPluginCPlusPlusLanguage
- lldbPluginObjCLanguage
- lldbPluginObjCPlusPlusLanguage
lldbPluginObjectFileELF
lldbPluginObjectFileJIT
Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Tue Sep 1 04:02:54 2015
@@ -21,13 +21,11 @@
#include "lldb/DataFormatters/FormatCache.h"
#include "lldb/DataFormatters/FormatClasses.h"
#include "lldb/DataFormatters/FormattersContainer.h"
-#include "lldb/DataFormatters/LanguageCategory.h"
#include "lldb/DataFormatters/TypeCategory.h"
#include "lldb/DataFormatters/TypeCategoryMap.h"
#include <atomic>
#include <functional>
-#include <memory>
namespace lldb_private {
@@ -50,8 +48,6 @@ public:
template <typename FormatterType>
using HardcodedFormatterFinders = std::vector<HardcodedFormatterFinder<FormatterType>>;
- typedef std::map<lldb::LanguageType, LanguageCategory::UniquePointer> LanguageCategories;
-
typedef TypeCategoryMap::CallbackType CategoryCallback;
FormatManager ();
@@ -127,8 +123,11 @@ public:
}
void
- LoopThroughCategories (CategoryCallback callback, void* param);
-
+ LoopThroughCategories (CategoryCallback callback, void* param)
+ {
+ m_categories_map.LoopThrough(callback, param);
+ }
+
lldb::TypeCategoryImplSP
GetCategory (const char* category_name = NULL,
bool can_create = true)
@@ -259,9 +258,6 @@ public:
true);
return matches;
}
-
- static ConstString
- GetTypeForCache (ValueObject&, lldb::DynamicValueType);
private:
@@ -276,14 +272,10 @@ private:
bool did_strip_typedef,
bool root_level = false);
- LanguageCategory*
- GetCategoryForLanguage (lldb::LanguageType lang_type);
-
FormatCache m_format_cache;
NamedSummariesMap m_named_summaries_map;
std::atomic<uint32_t> m_last_revision;
TypeCategoryMap m_categories_map;
- LanguageCategories m_language_categories_map;
ConstString m_default_category_name;
ConstString m_system_category_name;
Removed: lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h?rev=246535&view=auto
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h (removed)
@@ -1,67 +0,0 @@
-//===-- LanguageCategory.h----------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef lldb_LanguageCategory_h_
-#define lldb_LanguageCategory_h_
-
-// C Includes
-// C++ Includes
-
-// Other libraries and framework includes
-// Project includes
-#include "lldb/lldb-public.h"
-#include "lldb/DataFormatters/FormatCache.h"
-#include "lldb/DataFormatters/FormatClasses.h"
-
-#include <memory>
-
-namespace lldb_private {
-
-class LanguageCategory
-{
-public:
- typedef std::unique_ptr<LanguageCategory> UniquePointer;
-
- LanguageCategory (lldb::LanguageType lang_type);
-
- bool
- Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::TypeFormatImplSP& format_sp);
-
- bool
- Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::TypeSummaryImplSP& format_sp);
-
- bool
- Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::SyntheticChildrenSP& format_sp);
-
- bool
- Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::TypeValidatorImplSP& format_sp);
-
- lldb::TypeCategoryImplSP
- GetCategory () const;
-
-private:
- lldb::TypeCategoryImplSP m_category_sp;
- lldb_private::FormatCache m_format_cache;
-};
-
-} // namespace lldb_private
-
-#endif // lldb_LanguageCategory_h_
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Tue Sep 1 04:02:54 2015
@@ -314,7 +314,6 @@ namespace lldb_private {
m_enabled_position = p;
}
- friend class LanguageCategory;
friend class TypeCategoryMap;
friend class FormattersContainer<ConstString, TypeFormatImpl>;
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h Tue Sep 1 04:02:54 2015
@@ -102,25 +102,21 @@ namespace lldb_private {
lldb::TypeFormatImplSP
GetFormat (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches);
+ lldb::DynamicValueType use_dynamic);
lldb::TypeSummaryImplSP
GetSummaryFormat (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches);
+ lldb::DynamicValueType use_dynamic);
#ifndef LLDB_DISABLE_PYTHON
lldb::SyntheticChildrenSP
GetSyntheticChildren (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches);
+ lldb::DynamicValueType use_dynamic);
#endif
lldb::TypeValidatorImplSP
GetValidator (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches);
+ lldb::DynamicValueType use_dynamic);
private:
Modified: lldb/trunk/include/lldb/Target/Language.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Language.h (original)
+++ lldb/trunk/include/lldb/Target/Language.h Tue Sep 1 04:02:54 2015
@@ -39,9 +39,6 @@ namespace lldb_private {
virtual lldb::LanguageType
GetLanguageType () const = 0;
- virtual lldb::TypeCategoryImplSP
- GetFormatters ();
-
protected:
//------------------------------------------------------------------
// Classes that inherit from Language can see and modify these
Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Tue Sep 1 04:02:54 2015
@@ -115,7 +115,6 @@ class IRExecutionUnit;
class JITLoader;
class JITLoaderList;
class Language;
-class LanguageCategory;
class LanguageRuntime;
class MemoryRegionInfo;
class LineTable;
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Sep 1 04:02:54 2015
@@ -726,8 +726,6 @@
941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568914E355F2003A195C /* SBTypeSynthetic.h */; settings = {ATTRIBUTES = (Public, ); }; };
94235B9E1A8D667400EB2EED /* SBVariablesOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */; };
94235B9F1A8D66D600EB2EED /* SBVariablesOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 942612F71B95000000EF842E /* LanguageCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942612F61B95000000EF842E /* LanguageCategory.cpp */; settings = {ASSET_TAGS = (); }; };
- 942612F81B952C9B00EF842E /* ObjCLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6385E1B8FB7A2004FE1E4 /* ObjCLanguage.cpp */; settings = {ASSET_TAGS = (); }; };
942829561A89614C00521B30 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942829551A89614C00521B30 /* JSON.cpp */; };
942829CC1A89839300521B30 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
942AFF0519F84ABF007B43B4 /* LibCxxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942AFF0419F84ABF007B43B4 /* LibCxxVector.cpp */; };
@@ -2409,8 +2407,6 @@
94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBVariablesOptions.h; path = include/lldb/API/SBVariablesOptions.h; sourceTree = "<group>"; };
94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBVariablesOptions.cpp; path = source/API/SBVariablesOptions.cpp; sourceTree = "<group>"; };
94235B9D1A8D601A00EB2EED /* SBVariablesOptions.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBVariablesOptions.i; sourceTree = "<group>"; };
- 942612F51B94FFE900EF842E /* LanguageCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LanguageCategory.h; path = include/lldb/DataFormatters/LanguageCategory.h; sourceTree = "<group>"; };
- 942612F61B95000000EF842E /* LanguageCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LanguageCategory.cpp; path = source/DataFormatters/LanguageCategory.cpp; sourceTree = "<group>"; };
942829541A89614000521B30 /* JSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSON.h; path = include/lldb/Utility/JSON.h; sourceTree = "<group>"; };
942829551A89614C00521B30 /* JSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSON.cpp; path = source/Utility/JSON.cpp; sourceTree = "<group>"; };
942829C01A89835300521B30 /* argdumper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = argdumper; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -5300,8 +5296,6 @@
94CB256216B069800059775D /* FormatManager.h */,
94CB255A16B069770059775D /* FormatManager.cpp */,
94EE33F218643C6900CD703B /* FormattersContainer.h */,
- 942612F51B94FFE900EF842E /* LanguageCategory.h */,
- 942612F61B95000000EF842E /* LanguageCategory.cpp */,
94D0B10A16D5535900EA9C70 /* LibCxx.cpp */,
942AFF0619F84C02007B43B4 /* LibCxxInitializerList.cpp */,
94CD704F16F8DF1C00CF1E42 /* LibCxxList.cpp */,
@@ -6203,7 +6197,6 @@
2689005C13353E0400698AC0 /* ValueObjectVariable.cpp in Sources */,
264A58EE1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp in Sources */,
8C2D6A53197A1EAF006989C9 /* MemoryHistory.cpp in Sources */,
- 942612F71B95000000EF842E /* LanguageCategory.cpp in Sources */,
2689005D13353E0400698AC0 /* VMRange.cpp in Sources */,
2689005E13353E0E00698AC0 /* ClangASTSource.cpp in Sources */,
3FDFED0F19B7D269009756A7 /* ThisThread.cpp in Sources */,
@@ -6238,7 +6231,6 @@
2689007213353E1A00698AC0 /* Mutex.cpp in Sources */,
25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */,
AF20F7661AF18F8500751A6E /* ABISysV_arm.cpp in Sources */,
- 942612F81B952C9B00EF842E /* ObjCLanguage.cpp in Sources */,
2689007313353E1A00698AC0 /* Symbols.cpp in Sources */,
26474CBC18D0CB2D0073DEBA /* RegisterContextMach_arm.cpp in Sources */,
257E47171AA56C2000A62F81 /* ModuleCache.cpp in Sources */,
Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Tue Sep 1 04:02:54 2015
@@ -41,9 +41,6 @@
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
#include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h"
#include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
-#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
-#include "Plugins/Language/ObjC/ObjCLanguage.h"
-#include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h"
#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h"
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
@@ -284,10 +281,6 @@ SystemInitializerFull::Initialize()
AppleObjCRuntimeV1::Initialize();
SystemRuntimeMacOSX::Initialize();
RenderScriptRuntime::Initialize();
-
- CPlusPlusLanguage::Initialize();
- ObjCLanguage::Initialize();
- ObjCPlusPlusLanguage::Initialize();
#if defined(_MSC_VER)
ProcessWindows::Initialize();
@@ -392,10 +385,6 @@ SystemInitializerFull::Terminate()
SystemRuntimeMacOSX::Terminate();
RenderScriptRuntime::Terminate();
- CPlusPlusLanguage::Terminate();
- ObjCLanguage::Terminate();
- ObjCPlusPlusLanguage::Terminate();
-
#if defined(__APPLE__)
ProcessMachCore::Terminate();
ProcessKDP::Terminate();
Modified: lldb/trunk/source/DataFormatters/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CMakeLists.txt?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/CMakeLists.txt (original)
+++ lldb/trunk/source/DataFormatters/CMakeLists.txt Tue Sep 1 04:02:54 2015
@@ -9,7 +9,6 @@ add_lldb_library(lldbDataFormatters
FormatCache.cpp
FormatClasses.cpp
FormatManager.cpp
- LanguageCategory.cpp
LibCxx.cpp
LibCxxInitializerList.cpp
LibCxxList.cpp
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Sep 1 04:02:54 2015
@@ -16,13 +16,10 @@
#include "lldb/Core/Debugger.h"
#include "lldb/DataFormatters/CXXFormatterFunctions.h"
-#include "lldb/DataFormatters/LanguageCategory.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Platform.h"
#include "llvm/ADT/STLExtras.h"
-#include <initializer_list>
-
using namespace lldb;
using namespace lldb_private;
@@ -475,20 +472,6 @@ FormatManager::GetValidatorForType (lldb
return validator_chosen_sp;
}
-void
-FormatManager::LoopThroughCategories (CategoryCallback callback, void* param)
-{
- m_categories_map.LoopThrough(callback, param);
- for (const auto& entry : m_language_categories_map)
- {
- if (auto category_sp = entry.second->GetCategory())
- {
- if (!callback(param, category_sp))
- break;
- }
- }
-}
-
lldb::TypeCategoryImplSP
FormatManager::GetCategory (const ConstString& category_name,
bool can_create)
@@ -613,8 +596,8 @@ FormatManager::GetValidTypeName (const C
}
ConstString
-FormatManager::GetTypeForCache (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic)
+GetTypeForCache (ValueObject& valobj,
+ lldb::DynamicValueType use_dynamic)
{
if (use_dynamic == lldb::eNoDynamicValues)
{
@@ -635,28 +618,6 @@ FormatManager::GetTypeForCache (ValueObj
return ConstString();
}
-static std::initializer_list<lldb::LanguageType>
-GetCandidateLanguages (ValueObject& valobj)
-{
- lldb::LanguageType lang_type = valobj.GetObjectRuntimeLanguage();
- switch (lang_type)
- {
- default:
- return {lang_type};
- }
-}
-
-LanguageCategory*
-FormatManager::GetCategoryForLanguage (lldb::LanguageType lang_type)
-{
- auto iter = m_language_categories_map.find(lang_type), end = m_language_categories_map.end();
- if (iter != end)
- return iter->second.get();
- LanguageCategory* lang_category = new LanguageCategory(lang_type);
- m_language_categories_map[lang_type] = LanguageCategory::UniquePointer(lang_category);
- return lang_category;
-}
-
lldb::TypeFormatImplSP
FormatManager::GetHardcodedFormat (ValueObject& valobj,
lldb::DynamicValueType use_dynamic)
@@ -694,29 +655,7 @@ FormatManager::GetFormat (ValueObject& v
if (log)
log->Printf("[FormatManager::GetFormat] Cache search failed. Going normal route");
}
-
- FormattersMatchVector matches = GetPossibleMatches(valobj, use_dynamic);
-
- retval = m_categories_map.GetFormat(valobj, use_dynamic, matches);
- if (!retval)
- {
- if (log)
- log->Printf("[FormatManager::GetFormat] Search failed. Giving language a chance.");
- for (lldb::LanguageType lang_type : GetCandidateLanguages(valobj))
- {
- if (LanguageCategory* lang_category = GetCategoryForLanguage(lang_type))
- {
- if (lang_category->Get(valobj, use_dynamic, matches, retval))
- break;
- }
- }
- if (retval)
- {
- if (log)
- log->Printf("[FormatManager::GetFormat] Language search success. Returning.");
- return retval;
- }
- }
+ retval = m_categories_map.GetFormat(valobj, use_dynamic);
if (!retval)
{
if (log)
@@ -774,29 +713,7 @@ FormatManager::GetSummaryFormat (ValueOb
if (log)
log->Printf("[FormatManager::GetSummaryFormat] Cache search failed. Going normal route");
}
-
- FormattersMatchVector matches = GetPossibleMatches(valobj, use_dynamic);
-
- retval = m_categories_map.GetSummaryFormat(valobj, use_dynamic, matches);
- if (!retval)
- {
- if (log)
- log->Printf("[FormatManager::GetSummaryFormat] Search failed. Giving language a chance.");
- for (lldb::LanguageType lang_type : GetCandidateLanguages(valobj))
- {
- if (LanguageCategory* lang_category = GetCategoryForLanguage(lang_type))
- {
- if (lang_category->Get(valobj, use_dynamic, matches, retval))
- break;
- }
- }
- if (retval)
- {
- if (log)
- log->Printf("[FormatManager::GetSummaryFormat] Language search success. Returning.");
- return retval;
- }
- }
+ retval = m_categories_map.GetSummaryFormat(valobj, use_dynamic);
if (!retval)
{
if (log)
@@ -855,29 +772,7 @@ FormatManager::GetSyntheticChildren (Val
if (log)
log->Printf("[FormatManager::GetSyntheticChildren] Cache search failed. Going normal route");
}
-
- FormattersMatchVector matches = GetPossibleMatches(valobj, use_dynamic);
-
- retval = m_categories_map.GetSyntheticChildren(valobj, use_dynamic, matches);
- if (!retval)
- {
- if (log)
- log->Printf("[FormatManager::GetSyntheticChildren] Search failed. Giving language a chance.");
- for (lldb::LanguageType lang_type : GetCandidateLanguages(valobj))
- {
- if (LanguageCategory* lang_category = GetCategoryForLanguage(lang_type))
- {
- if (lang_category->Get(valobj, use_dynamic, matches, retval))
- break;
- }
- }
- if (retval)
- {
- if (log)
- log->Printf("[FormatManager::GetSyntheticChildren] Language search success. Returning.");
- return retval;
- }
- }
+ retval = m_categories_map.GetSyntheticChildren(valobj, use_dynamic);
if (!retval)
{
if (log)
@@ -923,29 +818,7 @@ FormatManager::GetValidator (ValueObject
if (log)
log->Printf("[FormatManager::GetValidator] Cache search failed. Going normal route");
}
-
- FormattersMatchVector matches = GetPossibleMatches(valobj, use_dynamic);
-
- retval = m_categories_map.GetValidator(valobj, use_dynamic, matches);
- if (!retval)
- {
- if (log)
- log->Printf("[FormatManager::GetValidator] Search failed. Giving language a chance.");
- for (lldb::LanguageType lang_type : GetCandidateLanguages(valobj))
- {
- if (LanguageCategory* lang_category = GetCategoryForLanguage(lang_type))
- {
- if (lang_category->Get(valobj, use_dynamic, matches, retval))
- break;
- }
- }
- if (retval)
- {
- if (log)
- log->Printf("[FormatManager::GetValidator] Language search success. Returning.");
- return retval;
- }
- }
+ retval = m_categories_map.GetValidator(valobj, use_dynamic);
if (!retval)
{
if (log)
@@ -984,7 +857,6 @@ FormatManager::FormatManager() :
m_named_summaries_map(this),
m_last_revision(0),
m_categories_map(this),
- m_language_categories_map(),
m_default_category_name(ConstString("default")),
m_system_category_name(ConstString("system")),
m_gnu_cpp_category_name(ConstString("gnu-libstdc++")),
@@ -1211,7 +1083,17 @@ FormatManager::LoadLibcxxFormatters()
lldb::TypeSummaryImplSP std_wstring_summary_sp(new CXXFunctionSummaryFormat(stl_summary_flags, lldb_private::formatters::LibcxxWStringSummaryProvider, "std::wstring summary provider"));
TypeCategoryImpl::SharedPointer libcxx_category_sp = GetCategory(m_libcxx_category_name);
-
+
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::string"),
+ std_string_summary_sp);
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >"),
+ std_string_summary_sp);
+
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::wstring"),
+ std_wstring_summary_sp);
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >"),
+ std_wstring_summary_sp);
+
SyntheticChildren::Flags stl_synth_flags;
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
Removed: lldb/trunk/source/DataFormatters/LanguageCategory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LanguageCategory.cpp?rev=246535&view=auto
==============================================================================
--- lldb/trunk/source/DataFormatters/LanguageCategory.cpp (original)
+++ lldb/trunk/source/DataFormatters/LanguageCategory.cpp (removed)
@@ -1,133 +0,0 @@
-//===-- LanguageCategory.cpp ---------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/DataFormatters/LanguageCategory.h"
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/DataFormatters/FormatManager.h"
-#include "lldb/DataFormatters/TypeCategory.h"
-#include "lldb/DataFormatters/TypeFormat.h"
-#include "lldb/DataFormatters/TypeSummary.h"
-#include "lldb/DataFormatters/TypeSynthetic.h"
-#include "lldb/DataFormatters/TypeValidator.h"
-#include "lldb/Target/Language.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-LanguageCategory::LanguageCategory (lldb::LanguageType lang_type) :
- m_category_sp(),
- m_format_cache()
-{
- if (Language* language_plugin = Language::FindPlugin(lang_type))
- m_category_sp = language_plugin->GetFormatters();
- if (m_category_sp)
- m_category_sp->Enable(true, 1);
-}
-
-bool
-LanguageCategory::Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::TypeFormatImplSP& format_sp)
-{
- if (!m_category_sp)
- return false;
-
- ConstString type_name = FormatManager::GetTypeForCache(valobj, dynamic);
- if (type_name)
- {
- if (m_format_cache.GetFormat(type_name, format_sp))
- return true;
- }
- bool result = m_category_sp->Get(valobj, matches, format_sp);
- if (type_name && (!format_sp || !format_sp->NonCacheable()))
- {
- m_format_cache.SetFormat(type_name, format_sp);
- }
- return result;
-}
-
-bool
-LanguageCategory::Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::TypeSummaryImplSP& format_sp)
-{
- if (!m_category_sp)
- return false;
-
- ConstString type_name = FormatManager::GetTypeForCache(valobj, dynamic);
- if (type_name)
- {
- if (m_format_cache.GetSummary(type_name, format_sp))
- return true;
- }
- bool result = m_category_sp->Get(valobj, matches, format_sp);
- if (type_name && (!format_sp || !format_sp->NonCacheable()))
- {
- m_format_cache.SetSummary(type_name, format_sp);
- }
- return result;
-}
-
-bool
-LanguageCategory::Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::SyntheticChildrenSP& format_sp)
-{
- if (!m_category_sp)
- return false;
-
- ConstString type_name = FormatManager::GetTypeForCache(valobj, dynamic);
- if (type_name)
- {
- if (m_format_cache.GetSynthetic(type_name, format_sp))
- return true;
- }
- bool result = m_category_sp->Get(valobj, matches, format_sp);
- if (type_name && (!format_sp || !format_sp->NonCacheable()))
- {
- m_format_cache.SetSynthetic(type_name, format_sp);
- }
- return result;
-}
-
-bool
-LanguageCategory::Get (ValueObject& valobj,
- lldb::DynamicValueType dynamic,
- FormattersMatchVector matches,
- lldb::TypeValidatorImplSP& format_sp)
-{
- if (!m_category_sp)
- return false;
-
- ConstString type_name = FormatManager::GetTypeForCache(valobj, dynamic);
- if (type_name)
- {
- if (m_format_cache.GetValidator(type_name, format_sp))
- return true;
- }
- bool result = m_category_sp->Get(valobj, matches, format_sp);
- if (type_name && (!format_sp || !format_sp->NonCacheable()))
- {
- m_format_cache.SetValidator(type_name, format_sp);
- }
- return result;
-}
-
-lldb::TypeCategoryImplSP
-LanguageCategory::GetCategory () const
-{
- return m_category_sp;
-}
Modified: lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp Tue Sep 1 04:02:54 2015
@@ -219,8 +219,7 @@ TypeCategoryMap::AnyMatches (ConstString
lldb::TypeFormatImplSP
TypeCategoryMap::GetFormat (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches)
+ lldb::DynamicValueType use_dynamic)
{
Mutex::Locker locker(m_map_mutex);
@@ -229,6 +228,8 @@ TypeCategoryMap::GetFormat (ValueObject&
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ FormattersMatchVector matches = FormatManager::GetPossibleMatches(valobj, use_dynamic);
+
for (begin = m_active_categories.begin(); begin != end; begin++)
{
lldb::TypeCategoryImplSP category_sp = *begin;
@@ -246,8 +247,7 @@ TypeCategoryMap::GetFormat (ValueObject&
lldb::TypeSummaryImplSP
TypeCategoryMap::GetSummaryFormat (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches)
+ lldb::DynamicValueType use_dynamic)
{
Mutex::Locker locker(m_map_mutex);
@@ -256,6 +256,8 @@ TypeCategoryMap::GetSummaryFormat (Value
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ FormattersMatchVector matches = FormatManager::GetPossibleMatches(valobj, use_dynamic);
+
for (begin = m_active_categories.begin(); begin != end; begin++)
{
lldb::TypeCategoryImplSP category_sp = *begin;
@@ -274,8 +276,7 @@ TypeCategoryMap::GetSummaryFormat (Value
#ifndef LLDB_DISABLE_PYTHON
lldb::SyntheticChildrenSP
TypeCategoryMap::GetSyntheticChildren (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches)
+ lldb::DynamicValueType use_dynamic)
{
Mutex::Locker locker(m_map_mutex);
@@ -285,6 +286,8 @@ TypeCategoryMap::GetSyntheticChildren (V
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ FormattersMatchVector matches = FormatManager::GetPossibleMatches(valobj, use_dynamic);
+
for (begin = m_active_categories.begin(); begin != end; begin++)
{
lldb::TypeCategoryImplSP category_sp = *begin;
@@ -303,8 +306,7 @@ TypeCategoryMap::GetSyntheticChildren (V
lldb::TypeValidatorImplSP
TypeCategoryMap::GetValidator (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- FormattersMatchVector matches)
+ lldb::DynamicValueType use_dynamic)
{
Mutex::Locker locker(m_map_mutex);
@@ -313,6 +315,8 @@ TypeCategoryMap::GetValidator (ValueObje
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
+ FormattersMatchVector matches = FormatManager::GetPossibleMatches(valobj, use_dynamic);
+
for (begin = m_active_categories.begin(); begin != end; begin++)
{
lldb::TypeCategoryImplSP category_sp = *begin;
Modified: lldb/trunk/source/Plugins/Language/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CMakeLists.txt?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/CMakeLists.txt Tue Sep 1 04:02:54 2015
@@ -1,3 +1,2 @@
add_subdirectory(CPlusPlus)
add_subdirectory(ObjC)
-add_subdirectory(ObjCPlusPlus)
Modified: lldb/trunk/source/Target/Language.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Language.cpp?rev=246536&r1=246535&r2=246536&view=diff
==============================================================================
--- lldb/trunk/source/Target/Language.cpp (original)
+++ lldb/trunk/source/Target/Language.cpp Tue Sep 1 04:02:54 2015
@@ -87,12 +87,6 @@ Language::ForEach (std::function<bool(La
}
}
-lldb::TypeCategoryImplSP
-Language::GetFormatters ()
-{
- return nullptr;
-}
-
//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------
More information about the lldb-commits
mailing list