diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Commands/CommandObjectWatchpointCommand.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Commands/CommandObjectWatchpointCommand.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/contrib/llvm-project/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/contrib/llvm-project/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index fe3052a775a2..1f4e95366385 100644 --- a/contrib/llvm-project/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/contrib/llvm-project/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -61,7 +61,9 @@ public: CommandObjectWatchpointCommandAdd(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "add", "Add a set of LLDB commands to a watchpoint, to be " - "executed whenever the watchpoint is hit.", + "executed whenever the watchpoint is hit. " + "The commands added to the watchpoint replace any " + "commands previously added to it.", nullptr, eCommandRequiresTarget), IOHandlerDelegateMultiline("DONE", IOHandlerDelegate::Completion::LLDBCommand), @@ -301,7 +303,7 @@ are no syntax errors may indicate that a function was declared but never called. options.SetPrintErrors(true); options.SetAddToHistory(false); - debugger.GetCommandInterpreter().HandleCommands(commands, &exe_ctx, + debugger.GetCommandInterpreter().HandleCommands(commands, exe_ctx, options, result); result.GetImmediateOutputStream()->Flush(); result.GetImmediateErrorStream()->Flush(); @@ -312,10 +314,7 @@ are no syntax errors may indicate that a function was declared but never called. class CommandOptions : public Options { public: - CommandOptions() - : Options(), m_use_commands(false), m_use_script_language(false), - m_script_language(eScriptLanguageNone), m_use_one_liner(false), - m_one_liner(), m_function_name() {} + CommandOptions() : Options(), m_one_liner(), m_function_name() {} ~CommandOptions() override = default; @@ -385,12 +384,12 @@ are no syntax errors may indicate that a function was declared but never called. // Instance variables to hold the values for command options. - bool m_use_commands; - bool m_use_script_language; - lldb::ScriptLanguage m_script_language; + bool m_use_commands = false; + bool m_use_script_language = false; + lldb::ScriptLanguage m_script_language = eScriptLanguageNone; // Instance variables to hold the values for one_liner options. - bool m_use_one_liner; + bool m_use_one_liner = false; std::string m_one_liner; bool m_stop_on_error; std::string m_function_name; @@ -405,7 +404,6 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to have commands added"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -420,7 +418,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, valid_wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -515,14 +512,12 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist to have commands deleted"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.GetArgumentCount() == 0) { result.AppendError( "No watchpoint specified from which to delete the commands"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -530,7 +525,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, valid_wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -544,7 +538,6 @@ protected: wp->ClearCallback(); } else { result.AppendErrorWithFormat("Invalid watchpoint ID: %u.\n", cur_wp_id); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -587,14 +580,12 @@ protected: if (num_watchpoints == 0) { result.AppendError("No watchpoints exist for which to list commands"); - result.SetStatus(eReturnStatusFailed); return false; } if (command.GetArgumentCount() == 0) { result.AppendError( "No watchpoint specified for which to list the commands"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -602,7 +593,6 @@ protected: if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command, valid_wp_ids)) { result.AppendError("Invalid watchpoints specification."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -634,7 +624,6 @@ protected: } else { result.AppendErrorWithFormat("Invalid watchpoint ID: %u.\n", cur_wp_id); - result.SetStatus(eReturnStatusFailed); } } } |