diff options
author | Johnny Chen <johnny.chen@apple.com> | 2012-05-24 00:43:00 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2012-05-24 00:43:00 +0000 |
commit | a95ce623d830d8bb488ef28e212b42d3166faf07 (patch) | |
tree | 904a2d0be87741b3260205ca40601035ca2de31d /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | 5c7ad16fddccc4841d89ac87a3b226ad64bb39af (diff) | |
download | bcm5719-llvm-a95ce623d830d8bb488ef28e212b42d3166faf07.tar.gz bcm5719-llvm-a95ce623d830d8bb488ef28e212b42d3166faf07.zip |
rdar://problem/11457634
Supports the use-case scenario of immediately continuing the process once attached.
Add a simple completion test case from "process attach --con" to "process attach --continue ".
llvm-svn: 157361
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 3958af587ba..ce9f17e045d 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -320,6 +320,10 @@ public: bool success = false; switch (short_option) { + case 'c': + attach_info.SetContinueOnceAttached(true); + break; + case 'p': { lldb::pid_t pid = Args::StringToUInt32 (option_arg, LLDB_INVALID_PROCESS_ID, 0, &success); @@ -591,6 +595,10 @@ public: result.AppendWarningWithFormat("Architecture changed from %s to %s.\n", old_arch_spec.GetArchitectureName(), target->GetArchitecture().GetArchitectureName()); } + + // This supports the use-case scenario of immediately continuing the process once attached. + if (m_options.attach_info.GetContinueOnceAttached()) + m_interpreter.HandleCommand("process continue", false, result); } return result.Succeeded(); } @@ -610,10 +618,11 @@ protected: OptionDefinition CommandObjectProcessAttach::CommandOptions::g_option_table[] = { -{ LLDB_OPT_SET_ALL, false, "plugin", 'P', required_argument, NULL, 0, eArgTypePlugin, "Name of the process plugin you want to use."}, -{ LLDB_OPT_SET_1, false, "pid", 'p', required_argument, NULL, 0, eArgTypePid, "The process ID of an existing process to attach to."}, -{ LLDB_OPT_SET_2, false, "name", 'n', required_argument, NULL, 0, eArgTypeProcessName, "The name of the process to attach to."}, -{ LLDB_OPT_SET_2, false, "waitfor",'w', no_argument, NULL, 0, eArgTypeNone, "Wait for the the process with <process-name> to launch."}, +{ LLDB_OPT_SET_ALL, false, "continue",'c', no_argument, NULL, 0, eArgTypeNone, "Immediately continue the process once attached."}, +{ LLDB_OPT_SET_ALL, false, "plugin", 'P', required_argument, NULL, 0, eArgTypePlugin, "Name of the process plugin you want to use."}, +{ LLDB_OPT_SET_1, false, "pid", 'p', required_argument, NULL, 0, eArgTypePid, "The process ID of an existing process to attach to."}, +{ LLDB_OPT_SET_2, false, "name", 'n', required_argument, NULL, 0, eArgTypeProcessName, "The name of the process to attach to."}, +{ LLDB_OPT_SET_2, false, "waitfor", 'w', no_argument, NULL, 0, eArgTypeNone, "Wait for the the process with <process-name> to launch."}, { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; |