diff options
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py | 26 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py new file mode 100644 index 00000000000..8381b123743 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py @@ -0,0 +1,26 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + +class TypeSummaryListArgumentTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + @no_debug_info_test + def test_type_summary_list_with_arg(self): + """Test that the 'type summary list' command handles command line arguments properly""" + self.expect('type summary list Foo', substrs=['Category: default', 'Category: system']) + self.expect('type summary list char', substrs=['char *', 'unsigned char']) diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 2b803e7eb0d..4318c142f33 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -1384,7 +1384,7 @@ protected: if (argc == 1) { - const char* arg = command.GetArgumentAtIndex(1); + const char* arg = command.GetArgumentAtIndex(0); formatter_regex.reset(new RegularExpression()); if (!formatter_regex->Compile(arg)) { |