-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[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
base: main
Are you sure you want to change the base?
Conversation
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."
)
|
73804d1
to
2bb714e
Compare
f537f45
to
7089cfd
Compare
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? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
This LGTM overall. I'll let @SLTozer do the final approval |
No description provided.