diff options
author | Jim Ingham <jingham@apple.com> | 2012-12-12 19:58:40 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-12-12 19:58:40 +0000 |
commit | c627682ef7b5c67222c3a08f3e982697feb564d7 (patch) | |
tree | 947414007c0eac254436c8e952ac3e00243da590 /lldb/source/Commands/CommandObjectThread.cpp | |
parent | e11ab3aafedc9fdaecc5ed5e91741897bd0009cf (diff) | |
download | bcm5719-llvm-c627682ef7b5c67222c3a08f3e982697feb564d7.tar.gz bcm5719-llvm-c627682ef7b5c67222c3a08f3e982697feb564d7.zip |
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index b5fa5192371..7a58441fb3c 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -325,6 +325,13 @@ public: } break; + case 't': + { + m_step_in_target.clear(); + m_step_in_target.assign(option_arg); + + } + break; default: error.SetErrorStringWithFormat("invalid short option character '%c'", short_option); break; @@ -339,6 +346,7 @@ public: m_avoid_no_debug = true; m_run_mode = eOnlyDuringStepping; m_avoid_regexp.clear(); + m_step_in_target.clear(); } const OptionDefinition* @@ -355,6 +363,7 @@ public: bool m_avoid_no_debug; RunMode m_run_mode; std::string m_avoid_regexp; + std::string m_step_in_target; }; CommandObjectThreadStepWithTypeAndScope (CommandInterpreter &interpreter, @@ -469,9 +478,10 @@ protected: if (frame->HasDebugInformation ()) { - new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans, m_step_type, + new_plan = thread->QueueThreadPlanForStepInRange (abort_other_plans, frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, - frame->GetSymbolContext(eSymbolContextEverything), + frame->GetSymbolContext(eSymbolContextEverything), + m_options.m_step_in_target.c_str(), stop_other_threads, m_options.m_avoid_no_debug); if (new_plan && !m_options.m_avoid_regexp.empty()) @@ -489,12 +499,10 @@ protected: StackFrame *frame = thread->GetStackFrameAtIndex(0).get(); if (frame->HasDebugInformation()) - new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans, - m_step_type, - frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, - frame->GetSymbolContext(eSymbolContextEverything), - stop_other_threads, - false); + new_plan = thread->QueueThreadPlanForStepOverRange (abort_other_plans, + frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, + frame->GetSymbolContext(eSymbolContextEverything), + stop_other_threads); else new_plan = thread->QueueThreadPlanForStepSingleInstruction (true, abort_other_plans, @@ -595,7 +603,8 @@ CommandObjectThreadStepWithTypeAndScope::CommandOptions::g_option_table[] = { { LLDB_OPT_SET_1, false, "avoid-no-debug", 'a', required_argument, NULL, 0, eArgTypeBoolean, "A boolean value that sets whether step-in will step over functions with no debug information."}, { LLDB_OPT_SET_1, false, "run-mode", 'm', required_argument, 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', required_argument, NULL, 0, eArgTypeRegularExpression, "A regular expression that defines function names to step over."}, +{ LLDB_OPT_SET_1, false, "step-over-regexp",'r', required_argument, 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', required_argument, NULL, 0, eArgTypeFunctionName, "The name of the directly called function step in should stop at when stepping into."}, { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } }; |