Add a commnad to set a condition for a watchpoint. Example:
watchpoint modify -c 'global==5'
modifies the last created watchpoint so that the condition expression
is evaluated at the stop point to decide whether we should proceed with
the stopping.
Also add SBWatchpont::SetCondition(const char *condition) to set condition
programmatically.
Test cases to come later.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142227 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectWatchpoint.h b/source/Commands/CommandObjectWatchpoint.h
index 508188e..399aa1a 100644
--- a/source/Commands/CommandObjectWatchpoint.h
+++ b/source/Commands/CommandObjectWatchpoint.h
@@ -190,6 +190,58 @@
CommandOptions m_options;
};
+//-------------------------------------------------------------------------
+// CommandObjectWatchpointModify
+//-------------------------------------------------------------------------
+
+class CommandObjectWatchpointModify : public CommandObject
+{
+public:
+
+ CommandObjectWatchpointModify (CommandInterpreter &interpreter);
+
+ virtual
+ ~CommandObjectWatchpointModify ();
+
+ virtual bool
+ Execute (Args& command,
+ CommandReturnObject &result);
+
+ virtual Options *
+ GetOptions ();
+
+ class CommandOptions : public Options
+ {
+ public:
+
+ CommandOptions (CommandInterpreter &interpreter);
+
+ virtual
+ ~CommandOptions ();
+
+ virtual Error
+ SetOptionValue (uint32_t option_idx, const char *option_arg);
+
+ void
+ OptionParsingStarting ();
+
+ const OptionDefinition*
+ GetDefinitions ();
+
+ // Options table: Required for subclasses of Options.
+
+ static OptionDefinition g_option_table[];
+
+ // Instance variables to hold the values for command options.
+
+ std::string m_condition;
+ bool m_condition_passed;
+ };
+
+private:
+ CommandOptions m_options;
+};
+
} // namespace lldb_private
#endif // liblldb_CommandObjectWatchpoint_h_