Skip to content

[Dexter] Add DAP instruction and function breakpoint handling #152718

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

OCHyams
Copy link
Contributor

@OCHyams OCHyams commented Aug 8, 2025

No description provided.

Copy link

github-actions bot commented Aug 8, 2025

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r HEAD~1...HEAD cross-project-tests/debuginfo-tests/dexter/dex/debugger/DAP.py cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerBase.py cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py
View the diff from darker here.
--- DAP.py	2025-08-12 16:31:17.000000 +0000
+++ DAP.py	2025-08-12 16:33:31.603482 +0000
@@ -613,13 +613,11 @@
         self.file_to_bp[file].append(new_id)
         self.bp_info[new_id] = (file, line, condition)
         self.pending_breakpoints = True
         return new_id
 
-    def _update_breakpoint_ids_after_request(
-        self, dex_bp_ids: list, response: dict
-    ):
+    def _update_breakpoint_ids_after_request(self, dex_bp_ids: list, response: dict):
         dap_bp_ids = [bp["id"] for bp in response["body"]["breakpoints"]]
         if len(dex_bp_ids) != len(dap_bp_ids):
             self.context.logger.error(
                 f"Sent request to set {len(dex_bp_ids)} breakpoints, but received {len(dap_bp_ids)} in response."
             )

@OCHyams OCHyams requested review from jmorse and SLTozer August 8, 2025 13:36
@OCHyams OCHyams marked this pull request as ready for review August 8, 2025 13:36
@OCHyams OCHyams force-pushed the users/OCHyams/2d54aad7d403 branch from 73804d1 to 2bb714e Compare August 12, 2025 09:53
@OCHyams OCHyams marked this pull request as draft August 12, 2025 11:05
@OCHyams OCHyams changed the base branch from users/OCHyams/2d54aad7d403 to main August 12, 2025 11:06
@OCHyams OCHyams force-pushed the users/OCHyams/dexter-new-bps branch from f537f45 to 7089cfd Compare August 12, 2025 11:08
@OCHyams OCHyams marked this pull request as ready for review August 12, 2025 11:10
self.dap_id_to_dex_ids[dap_bp_id] = [dex_bp_id]
visited_dap_ids.add(dap_bp_id)
self.pending_breakpoints = False
# Is this right? Are we guarenteed the order of the outgoing/incoming lists?
Copy link
Contributor

@SLTozer SLTozer Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the specification only explicitly says "The breakpoints returned are in the same order as the elements of the breakpoints (or the deprecated lines) array in the arguments." for source breakpoints*. However, I'd be very surprised if any debugger chose to do it differently, given that the response is not guaranteed to contain sufficient information to otherwise map the requested breakpoints to the received breakpoints - it would effectively be a useless feature otherwise.

*Function and instruction breakpoints have the wording "The [response] array elements correspond to the elements of the breakpoints array.", which I take to mean that the ordering should be the same, but it's not as explicit as the source breakpoints case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, thanks for the info. I've updated the comments to be more certain

@walter-erquinigo
Copy link
Member

This LGTM overall. I'll let @SLTozer do the final approval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants