Author: enrico Date: Thu Jan 28 13:21:38 2016 New Revision: 259078 URL: http://llvm.org/viewvc/llvm-project?rev=259078&view=rev Log: Fix an issue where the type <formatter> list command would not accept a valid argument and instead error out complaining about a malformed regex
rdar://problem/24380025 Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py Modified: lldb/trunk/source/Commands/CommandObjectType.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py?rev=259078&view=auto ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py Thu Jan 28 13:21:38 2016 @@ -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']) Modified: lldb/trunk/source/Commands/CommandObjectType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=259078&r1=259077&r2=259078&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectType.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectType.cpp Thu Jan 28 13:21:38 2016 @@ -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)) { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits