diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-03 09:06:12 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-03 09:06:12 +0000 |
commit | d77ea5b297a47015ed00d3e46db1f58a146edc20 (patch) | |
tree | 3e44985fd9cb791a4abbfcc10dc016d9e1997d1a /lldb/source/Commands/CommandObjectCommands.cpp | |
parent | 718f909ccd0bc088c81f8ce9f0988190b5f8e38f (diff) | |
download | llvm-d77ea5b297a47015ed00d3e46db1f58a146edc20.zip llvm-d77ea5b297a47015ed00d3e46db1f58a146edc20.tar.gz llvm-d77ea5b297a47015ed00d3e46db1f58a146edc20.tar.bz2 |
[lldb] Test 'command' commands and fix the found crashes
llvm-svn: 370712
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 11fed6e..d2f4cea 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -859,6 +859,7 @@ protected: "defined regular expression command names", GetCommandName().str().c_str()); result.SetStatus(eReturnStatusFailed); + return false; } auto command_name = args[0].ref; @@ -1724,6 +1725,12 @@ public: ~CommandObjectCommandsScriptList() override = default; bool DoExecute(Args &command, CommandReturnObject &result) override { + if (command.GetArgumentCount() != 0) { + result.AppendError("'command script list' doesn't take any arguments"); + result.SetStatus(eReturnStatusFailed); + return false; + } + m_interpreter.GetHelp(result, CommandInterpreter::eCommandTypesUserDef); result.SetStatus(eReturnStatusSuccessFinishResult); @@ -1744,6 +1751,12 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { + if (command.GetArgumentCount() != 0) { + result.AppendError("'command script clear' doesn't take any arguments"); + result.SetStatus(eReturnStatusFailed); + return false; + } + m_interpreter.RemoveAllUser(); result.SetStatus(eReturnStatusSuccessFinishResult); |