When a thread reaches a breakpoint at the return address set by `ThreadPlanStepOut`, `ThreadPlanStepOut::ShouldStop()` calls `ThreadPlanShouldStopHere::InvokeShouldStopHereCallback()`, and if it returns `false`, `ThreadPlanShouldStopHere::QueueStepOutFromHerePlan()` is called to queue a new plan to skip the corresponding range. Once the new plan finishes, `ThreadPlanStepOut::ShouldStop()` should recheck the stop condition; however, there is no code path in the method that sets `done` to `true`. Before #126838, if `done` was `false`, the method checked if a suitable frame had been reached. After the patch, the check is only performed at a breakpoint; thus, the execution continues. This patch causes `ThreadPlanStepOut::ShouldStop()` to recheck the stop condition when `m_step_out_further_plan_sp` completes.
12 lines
197 B
C
12 lines
197 B
C
int step_out_of_here(int a) {
|
|
return a + 5; // Set breakpoint here
|
|
}
|
|
|
|
int main() {
|
|
#line 0
|
|
int v = step_out_of_here(3) + 7;
|
|
#line 9
|
|
v += 11; // Should stop here
|
|
return v; // Ran too far
|
|
}
|