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
This commit is contained in:
Jim Ingham
2012-12-12 19:58:40 +00:00
parent e11ab3aafe
commit c627682ef7
11 changed files with 265 additions and 58 deletions

View File

@@ -564,13 +564,10 @@ SBThread::StepOver (lldb::RunMode stop_other_threads)
if (frame_sp->HasDebugInformation ())
{
SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans,
eStepTypeOver,
sc.line_entry.range,
sc,
stop_other_threads,
false);
new_plan = thread->QueueThreadPlanForStepOverRange (abort_other_plans,
sc.line_entry.range,
sc,
stop_other_threads);
}
else
{
@@ -587,6 +584,12 @@ SBThread::StepOver (lldb::RunMode stop_other_threads)
void
SBThread::StepInto (lldb::RunMode stop_other_threads)
{
StepInto (NULL, stop_other_threads);
}
void
SBThread::StepInto (const char *target_name, lldb::RunMode stop_other_threads)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -594,8 +597,11 @@ SBThread::StepInto (lldb::RunMode stop_other_threads)
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
if (log)
log->Printf ("SBThread(%p)::StepInto (stop_other_threads='%s')", exe_ctx.GetThreadPtr(),
log->Printf ("SBThread(%p)::StepInto (target_name='%s', stop_other_threads='%s')",
exe_ctx.GetThreadPtr(),
target_name? target_name: "<NULL>",
Thread::RunModeAsCString (stop_other_threads));
if (exe_ctx.HasThreadScope())
{
bool abort_other_plans = false;
@@ -608,12 +614,12 @@ SBThread::StepInto (lldb::RunMode stop_other_threads)
{
bool avoid_code_without_debug_info = true;
SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans,
eStepTypeInto,
sc.line_entry.range,
sc,
stop_other_threads,
avoid_code_without_debug_info);
new_plan = thread->QueueThreadPlanForStepInRange (abort_other_plans,
sc.line_entry.range,
sc,
target_name,
stop_other_threads,
avoid_code_without_debug_info);
}
else
{