Skip to content

Commit dc05c5d

Browse files
authored
[Dexter] Use continue when resuming lldb execution to reach breakpoint (#156481)
Currently, Dexter's interface for lldb and lldb-dap has a post-step hook that checks to see whether lldb reports that we stopped because we completed a step, and if so checks to see whether the current $pc address also matches a known breakpoint whose conditions (if any) are met, and if so it requests to "step in", so that we "resume" execution, stopping again at the current address, such that lldb now reports that we have hit a breakpoint and provides the list of breakpoints that were hit. This logic has a flaw however: the call to "step in" sets an implicit breakpoint on the next line. In Dexter's default stepping mode this is not an issue, as we intend to step there eventually. When we use DexContinue, however, we set a breakpoint from which we wish to continue to the next user-specified breakpoint, rather than stepping. Currently, there is a bug where Dexter sets a DexContinue breakpoint, arrives at that bp from a step, requests "step in" so that LLDB gives us the hit breakpoint ID, requests "continue" to hit the next user breakpoint, and then arrives at the next line after the continue due to the earlier "step in" request. This effectively negates the DexContinue command. This patch fixes this behaviour by using "continue" instead of "step in" in the post-step hook, ensuring that no implicit breakpoint is set so that we do not incorrectly stop at the next line.
1 parent 298764a commit dc05c5d

File tree

1 file changed

+2
-2
lines changed
  • cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb

1 file changed

+2
-2
lines changed

cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def step_in(self):
232232
):
233233
stepped_to_breakpoint = True
234234
if stepped_to_breakpoint:
235-
self._thread.StepInto()
235+
self._process.Continue()
236236

237237
def go(self) -> ReturnCode:
238238
self._process.Continue()
@@ -441,7 +441,7 @@ def _post_step_hook(self):
441441
# Step again now to get to the breakpoint.
442442
step_req_id = self.send_message(
443443
self.make_request(
444-
"stepIn", {"threadId": self._debugger_state.thread}
444+
"continue", {"threadId": self._debugger_state.thread}
445445
)
446446
)
447447
response = self._await_response(step_req_id)

0 commit comments

Comments
 (0)