-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data formatter for libc++'s forward_list
Summary: This adds a data formatter for the implementation of forward_list in libc++. I've refactored the existing std::list data formatter a bit to enable more sharing of code (mainly the loop detection stuff). Reviewers: jingham, EricWF Subscribers: srhines, eugene, lldb-commits Differential Revision: https://reviews.llvm.org/D35556 llvm-svn: 316992
- Loading branch information
Showing
6 changed files
with
249 additions
and
85 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...suite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
LEVEL = ../../../../../make | ||
|
||
CXX_SOURCES := main.cpp | ||
|
||
USE_LIBCPP := 1 | ||
include $(LEVEL)/Makefile.rules |
53 changes: 53 additions & 0 deletions
53
...ta-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
""" | ||
Test lldb data formatter subsystem. | ||
""" | ||
|
||
from __future__ import print_function | ||
|
||
|
||
import lldb | ||
from lldbsuite.test.decorators import * | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test import lldbutil | ||
|
||
|
||
class TestDataFormatterLibcxxForwardList(TestBase): | ||
|
||
mydir = TestBase.compute_mydir(__file__) | ||
|
||
def setUp(self): | ||
TestBase.setUp(self) | ||
self.line = line_number('main.cpp', '// break here') | ||
ns = 'ndk' if lldbplatformutil.target_is_android() else '' | ||
self.namespace = 'std::__' + ns + '1' | ||
|
||
@add_test_categories(["libc++"]) | ||
def test(self): | ||
"""Test that std::forward_list is displayed correctly""" | ||
self.build() | ||
lldbutil.run_to_source_breakpoint(self, '// break here', | ||
lldb.SBFileSpec("main.cpp", False)) | ||
|
||
forward_list = self.namespace + '::forward_list' | ||
self.expect("frame variable empty", | ||
substrs=[forward_list, | ||
'size=0', | ||
'{}']) | ||
|
||
self.expect("frame variable one_elt", | ||
substrs=[forward_list, | ||
'size=1', | ||
'{', | ||
'[0] = 47', | ||
'}']) | ||
|
||
self.expect("frame variable five_elts", | ||
substrs=[forward_list, | ||
'size=5', | ||
'{', | ||
'[0] = 1', | ||
'[1] = 22', | ||
'[2] = 333', | ||
'[3] = 4444', | ||
'[4] = 55555', | ||
'}']) |
7 changes: 7 additions & 0 deletions
7
...suite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <forward_list> | ||
|
||
int main() | ||
{ | ||
std::forward_list<int> empty{}, one_elt{47}, five_elts{1,22,333,4444,55555}; | ||
return 0; // break here | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.