fix(debug): identify instruction breakpoints by resolved address to allow removal when instructionReference changes (#289678)#310763
Merged
connor4312 merged 1 commit intomicrosoft:mainfrom Apr 16, 2026
Conversation
…llow removal when instructionReference changes (microsoft#289678)
dmitrivMS
approved these changes
Apr 16, 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.
What
Instruction breakpoints set from the Disassembly view could not be removed when the debug adapter returned a different
instructionReferencefor the same memory location acrossdisassemblerequests.Why
The Debug Adapter Protocol explicitly allows adapters to vary the
instructionReferencevalue returned for a given memory location betweendisassemblecalls — only the resolved memory address is stable. The previousremoveInstructionBreakpoints(reference, offset)lookup compared the (possibly new) reference+offset against the breakpoint's original reference+offset, so the match failed and the toggle-off click was a no-op.Fixes #289678
How
IDebugService.removeInstructionBreakpoints/DebugService.removeInstructionBreakpoints/DebugModel.removeInstructionBreakpointswith an optional third parameteraddress?: bigint.addressis supplied,DebugModelmatches on the stable resolved memory address already stored onInstructionBreakpoint, so a changedinstructionReferenceno longer breaks removal.addressis omitted, the existingreference + offsetmatching path is preserved unchanged — all existing callers keep their current behavior.disassemblyView.tsnow passescurrentElement.element.address(the same address it already uses when adding the breakpoint), guaranteeing symmetric add/remove.Test plan
InstructionBreakpointsuite insrc/vs/workbench/contrib/debug/test/common/debugModel.test.tswith 3 tests:instructionReferencehas changed butaddressis stable.addressis not supplied, the legacyreference + offsetmatching still works.addressonly removes the breakpoint at that address, leaving others intact.npm run compile-check-ts-nativepasses cleanly.