Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 3bb6355

Browse files
author
Enrico Granata
committedDec 18, 2015
Add API to support retrieving the formatters category for a specific language
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@256033 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 5c470fe commit 3bb6355

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed
 

‎include/lldb/API/SBDebugger.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ class LLDB_API SBDebugger
286286
SBTypeCategory
287287
GetCategory (const char* category_name);
288288

289+
SBTypeCategory
290+
GetCategory (lldb::LanguageType lang_type);
291+
289292
SBTypeCategory
290293
CreateCategory (const char* category_name);
291294

‎packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ def cleanup():
290290
self.expect("frame variable e1", substrs=["I am an empty Empty1 {}"])
291291
self.expect("frame variable e2", substrs=["I am an empty Empty2"])
292292
self.expect("frame variable e2", substrs=["I am an empty Empty2 {}"], matching=False)
293+
294+
self.assertTrue(self.dbg.GetCategory(lldb.eLanguageTypeObjC) is not None, "ObjC category is None")
293295

294296
@add_test_categories(['pyapi'])
295297
def test_force_synth_off(self):

‎scripts/interface/SBDebugger.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ public:
343343
lldb::SBTypeCategory
344344
GetCategory (const char* category_name);
345345

346+
SBTypeCategory
347+
GetCategory (lldb::LanguageType lang_type);
348+
346349
lldb::SBTypeCategory
347350
CreateCategory (const char* category_name);
348351

‎source/API/SBDebugger.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,16 @@ SBDebugger::GetCategory (const char* category_name)
12681268
return SBTypeCategory();
12691269
}
12701270

1271+
SBTypeCategory
1272+
SBDebugger::GetCategory (lldb::LanguageType lang_type)
1273+
{
1274+
TypeCategoryImplSP category_sp;
1275+
if (DataVisualization::Categories::GetCategory(lang_type, category_sp))
1276+
return SBTypeCategory(category_sp);
1277+
else
1278+
return SBTypeCategory();
1279+
}
1280+
12711281
SBTypeCategory
12721282
SBDebugger::CreateCategory (const char* category_name)
12731283
{

0 commit comments

Comments
 (0)
This repository has been archived.