[Lldb-commits] [lldb] r256033 - Add API to support retrieving the formatters category for a specific language
Enrico Granata via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 18 13:25:24 PST 2015
Author: enrico
Date: Fri Dec 18 15:25:24 2015
New Revision: 256033
URL: http://llvm.org/viewvc/llvm-project?rev=256033&view=rev
Log:
Add API to support retrieving the formatters category for a specific language
Modified:
lldb/trunk/include/lldb/API/SBDebugger.h
lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
lldb/trunk/scripts/interface/SBDebugger.i
lldb/trunk/source/API/SBDebugger.cpp
Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=256033&r1=256032&r2=256033&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Fri Dec 18 15:25:24 2015
@@ -287,6 +287,9 @@ public:
GetCategory (const char* category_name);
SBTypeCategory
+ GetCategory (lldb::LanguageType lang_type);
+
+ SBTypeCategory
CreateCategory (const char* category_name);
bool
Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py?rev=256033&r1=256032&r2=256033&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py Fri Dec 18 15:25:24 2015
@@ -290,6 +290,8 @@ class SBFormattersAPITestCase(TestBase):
self.expect("frame variable e1", substrs=["I am an empty Empty1 {}"])
self.expect("frame variable e2", substrs=["I am an empty Empty2"])
self.expect("frame variable e2", substrs=["I am an empty Empty2 {}"], matching=False)
+
+ self.assertTrue(self.dbg.GetCategory(lldb.eLanguageTypeObjC) is not None, "ObjC category is None")
@add_test_categories(['pyapi'])
def test_force_synth_off(self):
Modified: lldb/trunk/scripts/interface/SBDebugger.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBDebugger.i?rev=256033&r1=256032&r2=256033&view=diff
==============================================================================
--- lldb/trunk/scripts/interface/SBDebugger.i (original)
+++ lldb/trunk/scripts/interface/SBDebugger.i Fri Dec 18 15:25:24 2015
@@ -343,6 +343,9 @@ public:
lldb::SBTypeCategory
GetCategory (const char* category_name);
+ SBTypeCategory
+ GetCategory (lldb::LanguageType lang_type);
+
lldb::SBTypeCategory
CreateCategory (const char* category_name);
Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=256033&r1=256032&r2=256033&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Fri Dec 18 15:25:24 2015
@@ -1269,6 +1269,16 @@ SBDebugger::GetCategory (const char* cat
}
SBTypeCategory
+SBDebugger::GetCategory (lldb::LanguageType lang_type)
+{
+ TypeCategoryImplSP category_sp;
+ if (DataVisualization::Categories::GetCategory(lang_type, category_sp))
+ return SBTypeCategory(category_sp);
+ else
+ return SBTypeCategory();
+}
+
+SBTypeCategory
SBDebugger::CreateCategory (const char* category_name)
{
if (!category_name || *category_name == 0)
More information about the lldb-commits
mailing list