diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 217 |
1 files changed, 109 insertions, 108 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index f9da370..54f2a54 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -31,15 +31,15 @@ using namespace lldb_private; // CommandObjectProcessLaunch //------------------------------------------------------------------------- #pragma mark CommandObjectProcessLaunch -class CommandObjectProcessLaunch : public CommandObject +class CommandObjectProcessLaunch : public CommandObjectParsed { public: CommandObjectProcessLaunch (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process launch", - "Launch the executable in the debugger.", - NULL), + CommandObjectParsed (interpreter, + "process launch", + "Launch the executable in the debugger.", + NULL), m_options (interpreter) { CommandArgumentEntry arg; @@ -67,8 +67,15 @@ public: return &m_options; } + virtual const char *GetRepeatCommand (Args ¤t_command_args, uint32_t index) + { + // No repeat for "process launch"... + return ""; + } + +protected: bool - Execute (Args& launch_args, CommandReturnObject &result) + DoExecute (Args& launch_args, CommandReturnObject &result) { Debugger &debugger = m_interpreter.GetDebugger(); Target *target = debugger.GetSelectedTarget().get(); @@ -256,12 +263,6 @@ public: return result.Succeeded(); } - virtual const char *GetRepeatCommand (Args ¤t_command_args, uint32_t index) - { - // No repeat for "process launch"... - return ""; - } - protected: ProcessLaunchCommandOptions m_options; }; @@ -293,7 +294,7 @@ protected: // CommandObjectProcessAttach //------------------------------------------------------------------------- #pragma mark CommandObjectProcessAttach -class CommandObjectProcessAttach : public CommandObject +class CommandObjectProcessAttach : public CommandObjectParsed { public: @@ -432,10 +433,10 @@ public: }; CommandObjectProcessAttach (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process attach", - "Attach to a process.", - "process attach <cmd-options>"), + CommandObjectParsed (interpreter, + "process attach", + "Attach to a process.", + "process attach <cmd-options>"), m_options (interpreter) { } @@ -444,8 +445,15 @@ public: { } + Options * + GetOptions () + { + return &m_options; + } + +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); @@ -603,14 +611,6 @@ public: return result.Succeeded(); } - Options * - GetOptions () - { - return &m_options; - } - -protected: - CommandOptions m_options; }; @@ -631,16 +631,16 @@ CommandObjectProcessAttach::CommandOptions::g_option_table[] = //------------------------------------------------------------------------- #pragma mark CommandObjectProcessContinue -class CommandObjectProcessContinue : public CommandObject +class CommandObjectProcessContinue : public CommandObjectParsed { public: CommandObjectProcessContinue (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process continue", - "Continue execution of all threads in the current process.", - "process continue", - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + CommandObjectParsed (interpreter, + "process continue", + "Continue execution of all threads in the current process.", + "process continue", + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) { } @@ -649,8 +649,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -719,16 +720,16 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessDetach -class CommandObjectProcessDetach : public CommandObject +class CommandObjectProcessDetach : public CommandObjectParsed { public: CommandObjectProcessDetach (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process detach", - "Detach from the current process being debugged.", - "process detach", - eFlagProcessMustBeLaunched) + CommandObjectParsed (interpreter, + "process detach", + "Detach from the current process being debugged.", + "process detach", + eFlagProcessMustBeLaunched) { } @@ -736,8 +737,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -769,7 +771,7 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessConnect -class CommandObjectProcessConnect : public CommandObject +class CommandObjectProcessConnect : public CommandObjectParsed { public: @@ -829,11 +831,11 @@ public: }; CommandObjectProcessConnect (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process connect", - "Connect to a remote debug service.", - "process connect <remote-url>", - 0), + CommandObjectParsed (interpreter, + "process connect", + "Connect to a remote debug service.", + "process connect <remote-url>", + 0), m_options (interpreter) { } @@ -843,8 +845,15 @@ public: } + Options * + GetOptions () + { + return &m_options; + } + +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { @@ -919,14 +928,6 @@ public: } return result.Succeeded(); } - - Options * - GetOptions () - { - return &m_options; - } - -protected: CommandOptions m_options; }; @@ -944,16 +945,16 @@ CommandObjectProcessConnect::CommandOptions::g_option_table[] = //------------------------------------------------------------------------- #pragma mark CommandObjectProcessLoad -class CommandObjectProcessLoad : public CommandObject +class CommandObjectProcessLoad : public CommandObjectParsed { public: CommandObjectProcessLoad (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process load", - "Load a shared library into the current process.", - "process load <filename> [<filename> ...]", - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + CommandObjectParsed (interpreter, + "process load", + "Load a shared library into the current process.", + "process load <filename> [<filename> ...]", + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) { } @@ -961,8 +962,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -1003,16 +1005,16 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessUnload -class CommandObjectProcessUnload : public CommandObject +class CommandObjectProcessUnload : public CommandObjectParsed { public: CommandObjectProcessUnload (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process unload", - "Unload a shared library from the current process using the index returned by a previous call to \"process load\".", - "process unload <index>", - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + CommandObjectParsed (interpreter, + "process unload", + "Unload a shared library from the current process using the index returned by a previous call to \"process load\".", + "process unload <index>", + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) { } @@ -1020,8 +1022,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -1069,15 +1072,15 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessSignal -class CommandObjectProcessSignal : public CommandObject +class CommandObjectProcessSignal : public CommandObjectParsed { public: CommandObjectProcessSignal (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process signal", - "Send a UNIX signal to the current process being debugged.", - NULL) + CommandObjectParsed (interpreter, + "process signal", + "Send a UNIX signal to the current process being debugged.", + NULL) { CommandArgumentEntry arg; CommandArgumentData signal_arg; @@ -1097,8 +1100,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -1154,17 +1158,17 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessInterrupt -class CommandObjectProcessInterrupt : public CommandObject +class CommandObjectProcessInterrupt : public CommandObjectParsed { public: CommandObjectProcessInterrupt (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process interrupt", - "Interrupt the current process being debugged.", - "process interrupt", - eFlagProcessMustBeLaunched) + CommandObjectParsed (interpreter, + "process interrupt", + "Interrupt the current process being debugged.", + "process interrupt", + eFlagProcessMustBeLaunched) { } @@ -1172,8 +1176,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -1217,16 +1222,16 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessKill -class CommandObjectProcessKill : public CommandObject +class CommandObjectProcessKill : public CommandObjectParsed { public: CommandObjectProcessKill (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process kill", - "Terminate the current process being debugged.", - "process kill", - eFlagProcessMustBeLaunched) + CommandObjectParsed (interpreter, + "process kill", + "Terminate the current process being debugged.", + "process kill", + eFlagProcessMustBeLaunched) { } @@ -1234,8 +1239,9 @@ public: { } +protected: bool - Execute (Args& command, + DoExecute (Args& command, CommandReturnObject &result) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); @@ -1275,15 +1281,15 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessStatus -class CommandObjectProcessStatus : public CommandObject +class CommandObjectProcessStatus : public CommandObjectParsed { public: CommandObjectProcessStatus (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process status", - "Show the current status and location of executing process.", - "process status", - 0) + CommandObjectParsed (interpreter, + "process status", + "Show the current status and location of executing process.", + "process status", + 0) { } @@ -1293,11 +1299,7 @@ public: bool - Execute - ( - Args& command, - CommandReturnObject &result - ) + DoExecute (Args& command, CommandReturnObject &result) { Stream &strm = result.GetOutputStream(); result.SetStatus (eReturnStatusSuccessFinishNoResult); @@ -1331,7 +1333,7 @@ public: //------------------------------------------------------------------------- #pragma mark CommandObjectProcessHandle -class CommandObjectProcessHandle : public CommandObject +class CommandObjectProcessHandle : public CommandObjectParsed { public: @@ -1400,10 +1402,10 @@ public: CommandObjectProcessHandle (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process handle", - "Show or update what the process and debugger should do with various signals received from the OS.", - NULL), + CommandObjectParsed (interpreter, + "process handle", + "Show or update what the process and debugger should do with various signals received from the OS.", + NULL), m_options (interpreter) { SetHelpLong ("If no signals are specified, update them all. If no update option is specified, list the current values.\n"); @@ -1503,8 +1505,9 @@ public: } } +protected: bool - Execute (Args &signal_args, CommandReturnObject &result) + DoExecute (Args &signal_args, CommandReturnObject &result) { TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget(); @@ -1618,8 +1621,6 @@ public: return result.Succeeded(); } -protected: - CommandOptions m_options; }; |