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
This commit is contained in:
Enrico Granata 2016-03-24 21:32:39 +00:00
parent 8160812e26
commit 3cf9ff12c5
2 changed files with 4 additions and 0 deletions

View File

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

View File

@ -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;
}