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

llvm-svn: 259078
This commit is contained in:
Enrico Granata 2016-01-28 19:21:38 +00:00
parent 16f7e554a1
commit 6b7427856a
2 changed files with 27 additions and 1 deletions

View File

@ -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'])

View File

@ -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))
{