This commit reworks how the thread plan's ShouldStopHere mechanism works, so that it is useful not only
for customizing "step-in" behavior (e.g. step-in doesn't step into code with no debug info), but also the behavior of step-in/step-out and step-over when they step out of the frame they started in. I also added as a proof of concept of this reworking a mode for stepping where stepping out of a frame into a frame with no debug information will continue stepping out till it arrives at a frame that does have debug information. This is useful when you are debugging callback based code where the callbacks are separated from the code that initiated them by some library glue you don't care about, among other things. llvm-svn: 203747
This commit is contained in:
@@ -601,11 +601,13 @@ SBThread::StepOver (lldb::RunMode stop_other_threads)
|
||||
{
|
||||
if (frame_sp->HasDebugInformation ())
|
||||
{
|
||||
const LazyBool avoid_no_debug = eLazyBoolCalculate;
|
||||
SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
|
||||
new_plan_sp = thread->QueueThreadPlanForStepOverRange (abort_other_plans,
|
||||
sc.line_entry.range,
|
||||
sc,
|
||||
stop_other_threads);
|
||||
stop_other_threads,
|
||||
avoid_no_debug);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -650,14 +652,16 @@ SBThread::StepInto (const char *target_name, lldb::RunMode stop_other_threads)
|
||||
|
||||
if (frame_sp && frame_sp->HasDebugInformation ())
|
||||
{
|
||||
bool avoid_code_without_debug_info = true;
|
||||
const LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate;
|
||||
const LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate;
|
||||
SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
|
||||
new_plan_sp = thread->QueueThreadPlanForStepInRange (abort_other_plans,
|
||||
sc.line_entry.range,
|
||||
sc,
|
||||
target_name,
|
||||
stop_other_threads,
|
||||
avoid_code_without_debug_info);
|
||||
step_in_avoids_code_without_debug_info,
|
||||
step_out_avoids_code_without_debug_info);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -690,13 +694,15 @@ SBThread::StepOut ()
|
||||
|
||||
Thread *thread = exe_ctx.GetThreadPtr();
|
||||
|
||||
const LazyBool avoid_no_debug = eLazyBoolCalculate;
|
||||
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut (abort_other_plans,
|
||||
NULL,
|
||||
false,
|
||||
stop_other_threads,
|
||||
eVoteYes,
|
||||
eVoteNoOpinion,
|
||||
0));
|
||||
0,
|
||||
avoid_no_debug));
|
||||
|
||||
// This returns an error, we should use it!
|
||||
ResumeNewPlan (exe_ctx, new_plan_sp.get());
|
||||
|
||||
Reference in New Issue
Block a user