summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectWatchpoint.h
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-02-08 22:37:48 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-02-08 22:37:48 +0000
commit2ffa754a6f9e640cc0bcadf51174b8c1f2ab2393 (patch)
treec1cf822a65c221d551bccda47262398e9ebd6dbf /lldb/source/Commands/CommandObjectWatchpoint.h
parent8610a59de134450ae7ef142dab2cbe0f86d615cb (diff)
downloadbcm5719-llvm-2ffa754a6f9e640cc0bcadf51174b8c1f2ab2393.tar.gz
bcm5719-llvm-2ffa754a6f9e640cc0bcadf51174b8c1f2ab2393.zip
After discussions with Jim and Greg, modify the 'watchpoint set' command to become a mutiword command
with subcommand 'expression' and 'variable'. The first subcommand is for supplying an expression to be evaluated into an address to watch for, while the second is for watching a variable. 'watchpoint set expression' is a raw command, which means that you need to use the "--" option terminator to end the '-w' or '-x' option processing and to start typing your expression. Also update several test cases to comply and add a couple of test cases into TestCompletion.py, in particular, test that 'watchpoint set ex' completes to 'watchpoint set expression ' and that 'watchpoint set var' completes to 'watchpoint set variable '. llvm-svn: 150109
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.h')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.h72
1 files changed, 43 insertions, 29 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.h b/lldb/source/Commands/CommandObjectWatchpoint.h
index ff8d613abd2..e455ac08b3e 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.h
+++ b/lldb/source/Commands/CommandObjectWatchpoint.h
@@ -247,44 +247,26 @@ private:
// CommandObjectWatchpointSet
//-------------------------------------------------------------------------
-class CommandObjectWatchpointSet : public CommandObject
+class CommandObjectWatchpointSet : public CommandObjectMultiword
{
public:
- class CommandOptions : public OptionGroup
- {
- public:
-
- CommandOptions ();
+ CommandObjectWatchpointSet (CommandInterpreter &interpreter);
- virtual
- ~CommandOptions ();
+ virtual
+ ~CommandObjectWatchpointSet ();
- virtual uint32_t
- GetNumDefinitions ();
-
- virtual const OptionDefinition*
- GetDefinitions ();
-
- virtual Error
- SetOptionValue (CommandInterpreter &interpreter,
- uint32_t option_idx,
- const char *option_value);
-
- virtual void
- OptionParsingStarting (CommandInterpreter &interpreter);
- // Options table: Required for subclasses of Options.
+};
- static OptionDefinition g_option_table[];
- bool m_do_expression;
- bool m_do_variable;
- };
+class CommandObjectWatchpointSetVariable : public CommandObject
+{
+public:
- CommandObjectWatchpointSet (CommandInterpreter &interpreter);
+ CommandObjectWatchpointSetVariable (CommandInterpreter &interpreter);
virtual
- ~CommandObjectWatchpointSet ();
+ ~CommandObjectWatchpointSetVariable ();
virtual bool
Execute (Args& command,
@@ -296,7 +278,39 @@ public:
private:
OptionGroupOptions m_option_group;
OptionGroupWatchpoint m_option_watchpoint;
- CommandOptions m_command_options;
+};
+
+class CommandObjectWatchpointSetExpression : public CommandObject
+{
+public:
+
+ CommandObjectWatchpointSetExpression (CommandInterpreter &interpreter);
+
+ virtual
+ ~CommandObjectWatchpointSetExpression ();
+
+ virtual bool
+ Execute (Args& command,
+ CommandReturnObject &result)
+ { return false; }
+
+ virtual bool
+ WantsRawCommandString() { return true; }
+
+ // Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
+ virtual bool
+ WantsCompletion() { return true; }
+
+ virtual bool
+ ExecuteRawCommandString (const char *raw_command,
+ CommandReturnObject &result);
+
+ virtual Options *
+ GetOptions ();
+
+private:
+ OptionGroupOptions m_option_group;
+ OptionGroupWatchpoint m_option_watchpoint;
};
} // namespace lldb_private
OpenPOWER on IntegriCloud