Skip to content

[Dexter] Adapt to upcoming lldb stepping behavior #108127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,33 @@ def launch(self, cmdline):

def step(self):
self._thread.StepInto()
stop_reason = self._thread.GetStopReason()
# If we (1) completed a step and (2) are sitting at a breakpoint,
# but (3) the breakpoint is not reported as the stop reason, then
# we'll need to step once more to hit the breakpoint.
#
# dexter sets breakpoints on every source line, then steps
# each source line. Older lldb's would overwrite the stop
# reason with "breakpoint hit" when we stopped at a breakpoint,
# even if the breakpoint hadn't been exectued yet. One
# step per source line, hitting a breakpoint each time.
#
# But a more accurate behavior is that the step completes
# with step-completed stop reason, then when we step again,
# we execute the breakpoint and stop (with the pc the same) and
# a breakpoint-hit stop reason. So we need to step twice per line.
if stop_reason == self._interface.eStopReasonPlanComplete:
stepped_to_breakpoint = False
pc = self._thread.GetFrameAtIndex(0).GetPC()
for bp in self._target.breakpoints:
for bploc in bp.locations:
if (
bploc.IsEnabled()
and bploc.GetAddress().GetLoadAddress(self._target) == pc
):
stepped_to_breakpoint = True
if stepped_to_breakpoint:
self._thread.StepInto()

def go(self) -> ReturnCode:
self._process.Continue()
Expand Down
Loading