diff options
Diffstat (limited to 'source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | source/Commands/CommandObjectWatchpoint.cpp | 62 |
1 files changed, 17 insertions, 45 deletions
diff --git a/source/Commands/CommandObjectWatchpoint.cpp b/source/Commands/CommandObjectWatchpoint.cpp index d2600a462203..98e758b7ef6a 100644 --- a/source/Commands/CommandObjectWatchpoint.cpp +++ b/source/Commands/CommandObjectWatchpoint.cpp @@ -1,9 +1,8 @@ //===-- CommandObjectWatchpoint.cpp -----------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -143,21 +142,14 @@ bool CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( return !in_range; } -//------------------------------------------------------------------------- // CommandObjectWatchpointList -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- // CommandObjectWatchpointList::Options -//------------------------------------------------------------------------- #pragma mark List::CommandOptions static constexpr OptionDefinition g_watchpoint_list_options[] = { - // clang-format off - { LLDB_OPT_SET_1, false, "brief", 'b', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Give a brief description of the watchpoint (no location info)." }, - { LLDB_OPT_SET_2, false, "full", 'f', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Give a full description of the watchpoint and its locations." }, - { LLDB_OPT_SET_3, false, "verbose", 'v', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Explain everything we know about the watchpoint (for debugging debugger bugs)." } - // clang-format on +#define LLDB_OPTIONS_watchpoint_list +#include "CommandOptions.inc" }; #pragma mark List @@ -230,7 +222,7 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); if (target == nullptr) { result.AppendError("Invalid target. No current target or watchpoints."); result.SetStatus(eReturnStatusSuccessFinishNoResult); @@ -296,9 +288,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointEnable -//------------------------------------------------------------------------- #pragma mark Enable class CommandObjectWatchpointEnable : public CommandObjectParsed { @@ -320,7 +310,7 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); if (!CheckTargetForWatchpointOperations(target, result)) return false; @@ -367,9 +357,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointDisable -//------------------------------------------------------------------------- #pragma mark Disable class CommandObjectWatchpointDisable : public CommandObjectParsed { @@ -392,7 +380,7 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); if (!CheckTargetForWatchpointOperations(target, result)) return false; @@ -442,9 +430,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointDelete -//------------------------------------------------------------------------- #pragma mark Delete class CommandObjectWatchpointDelete : public CommandObjectParsed { @@ -466,7 +452,7 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); if (!CheckTargetForWatchpointOperations(target, result)) return false; @@ -518,15 +504,12 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointIgnore -//------------------------------------------------------------------------- #pragma mark Ignore::CommandOptions static constexpr OptionDefinition g_watchpoint_ignore_options[] = { - // clang-format off - { LLDB_OPT_SET_ALL, true, "ignore-count", 'i', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeCount, "Set the number of times this watchpoint is skipped before stopping." } - // clang-format on +#define LLDB_OPTIONS_watchpoint_ignore +#include "CommandOptions.inc" }; class CommandObjectWatchpointIgnore : public CommandObjectParsed { @@ -590,7 +573,7 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); if (!CheckTargetForWatchpointOperations(target, result)) return false; @@ -639,16 +622,13 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointModify -//------------------------------------------------------------------------- #pragma mark Modify::CommandOptions static constexpr OptionDefinition g_watchpoint_modify_options[] = { - // clang-format off - { LLDB_OPT_SET_ALL, false, "condition", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeExpression, "The watchpoint stops only if this condition expression evaluates to true." } - // clang-format on +#define LLDB_OPTIONS_watchpoint_modify +#include "CommandOptions.inc" }; #pragma mark Modify @@ -719,7 +699,7 @@ public: protected: bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); if (!CheckTargetForWatchpointOperations(target, result)) return false; @@ -770,9 +750,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointSetVariable -//------------------------------------------------------------------------- #pragma mark SetVariable class CommandObjectWatchpointSetVariable : public CommandObjectParsed { @@ -839,7 +817,7 @@ protected: } bool DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); StackFrame *frame = m_exe_ctx.GetFramePtr(); // If no argument is present, issue an error message. There's no way to @@ -960,9 +938,7 @@ private: OptionGroupWatchpoint m_option_watchpoint; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointSetExpression -//------------------------------------------------------------------------- #pragma mark Set class CommandObjectWatchpointSetExpression : public CommandObjectRaw { @@ -1026,7 +1002,7 @@ protected: m_option_group.NotifyOptionParsingStarting( &exe_ctx); // This is a raw command, so notify the option group - Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); + Target *target = GetDebugger().GetSelectedTarget().get(); StackFrame *frame = m_exe_ctx.GetFramePtr(); OptionsWithRaw args(raw_command); @@ -1128,9 +1104,7 @@ private: OptionGroupWatchpoint m_option_watchpoint; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointSet -//------------------------------------------------------------------------- #pragma mark Set class CommandObjectWatchpointSet : public CommandObjectMultiword { @@ -1151,9 +1125,7 @@ public: ~CommandObjectWatchpointSet() override = default; }; -//------------------------------------------------------------------------- // CommandObjectMultiwordWatchpoint -//------------------------------------------------------------------------- #pragma mark MultiwordWatchpoint CommandObjectMultiwordWatchpoint::CommandObjectMultiwordWatchpoint( |