diff options
author | Jim Ingham <jingham@apple.com> | 2014-07-08 19:28:57 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-07-08 19:28:57 +0000 |
commit | 7a88ec9ac05c4f9e4cc03bd9e84af9e6da73c8b9 (patch) | |
tree | 5cd45aabe66d329352fb8e8ae2080c3268b5ae2c /lldb/source/Commands/CommandObjectThread.cpp | |
parent | c60b6eadecb2d41c7b7d4661dbffedff764ca8d1 (diff) | |
download | bcm5719-llvm-7a88ec9ac05c4f9e4cc03bd9e84af9e6da73c8b9.tar.gz bcm5719-llvm-7a88ec9ac05c4f9e4cc03bd9e84af9e6da73c8b9.zip |
Add the ability to provide a "count" option to the various "thread step-*" operations. Only
step-inst and step-inst are currently supported, the rest just warn that they are not supported
if you try to provide a count.
llvm-svn: 212559
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 5dbdb164c22..36b5208bae1 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -371,6 +371,14 @@ public: } break; + case 'c': + { + m_step_count = Args::StringToUInt32(option_arg, UINT32_MAX, 0); + if (m_step_count == UINT32_MAX) + error.SetErrorStringWithFormat ("invalid ignore count '%s'", option_arg); + break; + } + break; case 'm': { OptionEnumValueElement *enum_values = g_option_table[option_idx].enum_values; @@ -408,6 +416,7 @@ public: m_run_mode = eOnlyDuringStepping; m_avoid_regexp.clear(); m_step_in_target.clear(); + m_step_count = 1; } const OptionDefinition* @@ -426,6 +435,7 @@ public: RunMode m_run_mode; std::string m_avoid_regexp; std::string m_step_in_target; + int32_t m_step_count; }; CommandObjectThreadStepWithTypeAndScope (CommandInterpreter &interpreter, @@ -603,6 +613,14 @@ protected: { new_plan_sp->SetIsMasterPlan (true); new_plan_sp->SetOkayToDiscard (false); + + if (m_options.m_step_count > 1) + { + if (new_plan_sp->SetIterationCount(m_options.m_step_count) != m_options.m_step_count) + { + result.AppendWarning ("step operation does not support iteration count."); + } + } process->GetThreadList().SetSelectedThreadByID (thread->GetID()); process->Resume (); @@ -664,6 +682,7 @@ CommandObjectThreadStepWithTypeAndScope::CommandOptions::g_option_table[] = { { LLDB_OPT_SET_1, false, "step-in-avoids-no-debug", 'a', OptionParser::eRequiredArgument, NULL, 0, eArgTypeBoolean, "A boolean value that sets whether stepping into functions will step over functions with no debug information."}, { LLDB_OPT_SET_1, false, "step-out-avoids-no-debug", 'A', OptionParser::eRequiredArgument, NULL, 0, eArgTypeBoolean, "A boolean value, if true stepping out of functions will continue to step out till it hits a function with debug information."}, +{ LLDB_OPT_SET_1, false, "count", 'c', OptionParser::eRequiredArgument, NULL, 1, eArgTypeCount, "How many times to perform the stepping operation - currently only supported for step-inst and next-inst."}, { LLDB_OPT_SET_1, false, "run-mode", 'm', OptionParser::eRequiredArgument, g_tri_running_mode, 0, eArgTypeRunMode, "Determine how to run other threads while stepping the current thread."}, { LLDB_OPT_SET_1, false, "step-over-regexp",'r', OptionParser::eRequiredArgument, NULL, 0, eArgTypeRegularExpression, "A regular expression that defines function names to not to stop at when stepping in."}, { LLDB_OPT_SET_1, false, "step-in-target", 't', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFunctionName, "The name of the directly called function step in should stop at when stepping into."}, |