summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/API/SBDebugger.h3
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py2
-rw-r--r--lldb/scripts/interface/SBDebugger.i3
-rw-r--r--lldb/source/API/SBDebugger.cpp10
4 files changed, 18 insertions, 0 deletions
diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index f147a48551e..7588cfc9ec4 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -287,6 +287,9 @@ public:
GetCategory (const char* category_name);
SBTypeCategory
+ GetCategory (lldb::LanguageType lang_type);
+
+ SBTypeCategory
CreateCategory (const char* category_name);
bool
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
index 52aeaf848b2..de7f15f76fa 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
@@ -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):
diff --git a/lldb/scripts/interface/SBDebugger.i b/lldb/scripts/interface/SBDebugger.i
index 2abffa8ed5a..89b2882aeb9 100644
--- a/lldb/scripts/interface/SBDebugger.i
+++ b/lldb/scripts/interface/SBDebugger.i
@@ -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);
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 49eeab20686..1645294b5a3 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -1269,6 +1269,16 @@ SBDebugger::GetCategory (const char* category_name)
}
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)
OpenPOWER on IntegriCloud