From: Enrico Granata Date: Thu, 24 Mar 2016 21:32:39 +0000 (+0000) Subject: Make 'type lookup' print an error message instead of complete radio silence when... X-Git-Tag: llvmorg-3.9.0-rc1~10982 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cf9ff12c51e1a446f019c001472f30024583fda;p=platform%2Fupstream%2Fllvm.git Make 'type lookup' print an error message instead of complete radio silence when it can't find a type matching user input It would be fun to make it provide suggestions (e.g. 'can't find NString, did you mean NSString instead?'), but this worries me a little bit on the account of just how thorough of a type system scan it would have to do llvm-svn: 264343 --- diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py index 1261983..774eb43 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py @@ -42,3 +42,4 @@ class TypeLookupTestCase(TestBase): self.expect('type lookup NSURL', substrs=['NSURL']) self.expect('type lookup NSArray', substrs=['NSArray']) self.expect('type lookup NSObject', substrs=['NSObject', 'isa']) + self.expect('type lookup PleaseDontBeARealTypeThatExists', substrs=["no type was found matching 'PleaseDontBeARealTypeThatExists'"]) diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index f291f11..23e3c0e9 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -3404,6 +3404,9 @@ public: } } + if (!any_found) + result.AppendMessageWithFormat("no type was found matching '%s'\n", name_of_type); + result.SetStatus (any_found ? lldb::eReturnStatusSuccessFinishResult : lldb::eReturnStatusSuccessFinishNoResult); return true; }