Fix debugger to attribute breakpoint stops correctly - #382
Open
MaxDesiatov wants to merge 1 commit into
Open
Conversation
MaxDesiatov
force-pushed
the
maxd/lldb-requested-address
branch
2 times, most recently
from
July 22, 2026 20:54
2f5a18c to
7ff9258
Compare
| // Requested and resolved addresses diverge when the requested address lands on an elided | ||
| // instruction (e.g. local.get) that resolves forward; the host expects stop replies at the | ||
| // address it set the breakpoint on, not the resolved one. | ||
| private var resolvedToRequestedBreakpoint = [Int: Int]() |
Member
There was a problem hiding this comment.
Hmm, this smells a bit. Don't we already track the same state in Debugger?
The handler reported every stop as `reason:trace` at the resolved instruction, so LLDB mapped hits to `eStopReasonTrace` and never attributed them to a breakpoint. It now tracks each host-requested address, replies with `reason:breakpoint` at that address on a real hit while keeping step and entrypoint landings as `trace`, and removes breakpoints at their resolved address. Added a `WasmKitGDBHandlerTests` target covering the stop reason, reported address, and removal. # Conflicts: # Tests/WasmKitGDBHandlerTests/WasmKitGDBHandlerTests.swift
MaxDesiatov
force-pushed
the
maxd/lldb-requested-address
branch
from
July 23, 2026 13:45
7ff9258 to
00bacc8
Compare
kateinoigakukun
added this pull request to the merge queue
Jul 26, 2026
kateinoigakukun
removed this pull request from the merge queue due to a manual request
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The handler reported every stop as
reason:traceat the resolved instruction, so LLDB mapped hits toeStopReasonTraceand never attributed them to a breakpoint. It now tracks each host-requested address, replies withreason:breakpointat that address on a real hit while keeping step and entrypoint landings astrace, and removes breakpoints at their resolved address. Added aWasmKitGDBHandlerTeststarget covering the stop reason, reported address, and removal.