aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-06-08 21:56:10 +0000
committerJim Ingham <jingham@apple.com>2012-06-08 21:56:10 +0000
commit5a988416736b906931cf6076d38f5b960110ed81 (patch)
treebbd923b8bcc49eb2e456290706df5452f4bcd250 /lldb/source/Commands/CommandObjectFrame.cpp
parentc5adccab1ae914f439593f8588a6a95669783bad (diff)
downloadllvm-5a988416736b906931cf6076d38f5b960110ed81.zip
llvm-5a988416736b906931cf6076d38f5b960110ed81.tar.gz
llvm-5a988416736b906931cf6076d38f5b960110ed81.tar.bz2
Make raw & parsed commands subclasses of CommandObject rather than having the raw version implement an
Execute which was never going to get run and another ExecuteRawCommandString. Took the knowledge of how to prepare raw & parsed commands out of CommandInterpreter and put it in CommandObject where it belongs. Also took all the cases where there were the subcommands of Multiword commands declared in the .h file for the overall command and moved them into the .cpp file. Made the CommandObject flags work for raw as well as parsed commands. Made "expr" use the flags so that it requires you to be paused to run "expr". llvm-svn: 158235
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp60
1 files changed, 29 insertions, 31 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index b59cd633..4dc4aa8 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -52,16 +52,16 @@ using namespace lldb_private;
// CommandObjectFrameInfo
//-------------------------------------------------------------------------
-class CommandObjectFrameInfo : public CommandObject
+class CommandObjectFrameInfo : public CommandObjectParsed
{
public:
CommandObjectFrameInfo (CommandInterpreter &interpreter) :
- CommandObject (interpreter,
- "frame info",
- "List information about the currently selected frame in the current thread.",
- "frame info",
- eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
+ CommandObjectParsed (interpreter,
+ "frame info",
+ "List information about the currently selected frame in the current thread.",
+ "frame info",
+ eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
{
}
@@ -69,8 +69,9 @@ public:
{
}
+protected:
bool
- Execute (Args& command,
+ DoExecute (Args& command,
CommandReturnObject &result)
{
ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
@@ -95,7 +96,7 @@ public:
// CommandObjectFrameSelect
//-------------------------------------------------------------------------
-class CommandObjectFrameSelect : public CommandObject
+class CommandObjectFrameSelect : public CommandObjectParsed
{
public:
@@ -155,11 +156,11 @@ public:
};
CommandObjectFrameSelect (CommandInterpreter &interpreter) :
- CommandObject (interpreter,
- "frame select",
- "Select a frame by index from within the current thread and make it the current frame.",
- NULL,
- eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
+ CommandObjectParsed (interpreter,
+ "frame select",
+ "Select a frame by index from within the current thread and make it the current frame.",
+ NULL,
+ eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
m_options (interpreter)
{
CommandArgumentEntry arg;
@@ -188,8 +189,9 @@ public:
}
+protected:
bool
- Execute (Args& command,
+ DoExecute (Args& command,
CommandReturnObject &result)
{
ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
@@ -319,21 +321,21 @@ CommandObjectFrameSelect::CommandOptions::g_option_table[] =
//----------------------------------------------------------------------
// List images with associated information
//----------------------------------------------------------------------
-class CommandObjectFrameVariable : public CommandObject
+class CommandObjectFrameVariable : public CommandObjectParsed
{
public:
CommandObjectFrameVariable (CommandInterpreter &interpreter) :
- CommandObject (interpreter,
- "frame variable",
- "Show frame variables. All argument and local variables "
- "that are in scope will be shown when no arguments are given. "
- "If any arguments are specified, they can be names of "
- "argument, local, file static and file global variables. "
- "Children of aggregate variables can be specified such as "
- "'var->child.x'.",
- NULL,
- eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
+ CommandObjectParsed (interpreter,
+ "frame variable",
+ "Show frame variables. All argument and local variables "
+ "that are in scope will be shown when no arguments are given. "
+ "If any arguments are specified, they can be names of "
+ "argument, local, file static and file global variables. "
+ "Children of aggregate variables can be specified such as "
+ "'var->child.x'.",
+ NULL,
+ eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
m_option_group (interpreter),
m_option_variable(true), // Include the frame specific options by passing "true"
m_option_format (eFormatDefault),
@@ -370,13 +372,9 @@ public:
return &m_option_group;
}
-
+protected:
virtual bool
- Execute
- (
- Args& command,
- CommandReturnObject &result
- )
+ DoExecute (Args& command, CommandReturnObject &result)
{
ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
StackFrame *frame = exe_ctx.GetFramePtr();