close
Skip to content

fix(debug): identify instruction breakpoints by resolved address to allow removal when instructionReference changes (#289678)#310763

Merged
connor4312 merged 1 commit intomicrosoft:mainfrom
maruthang:fix/issue-289678-disassembly-breakpoint-address-lookup
Apr 16, 2026
Merged

fix(debug): identify instruction breakpoints by resolved address to allow removal when instructionReference changes (#289678)#310763
connor4312 merged 1 commit intomicrosoft:mainfrom
maruthang:fix/issue-289678-disassembly-breakpoint-address-lookup

Conversation

@maruthang
Copy link
Copy Markdown
Contributor

What

Instruction breakpoints set from the Disassembly view could not be removed when the debug adapter returned a different instructionReference for the same memory location across disassemble requests.

Why

The Debug Adapter Protocol explicitly allows adapters to vary the instructionReference value returned for a given memory location between disassemble calls — only the resolved memory address is stable. The previous removeInstructionBreakpoints(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

  • Extended IDebugService.removeInstructionBreakpoints / DebugService.removeInstructionBreakpoints / DebugModel.removeInstructionBreakpoints with an optional third parameter address?: bigint.
  • When address is supplied, DebugModel matches on the stable resolved memory address already stored on InstructionBreakpoint, so a changed instructionReference no longer breaks removal.
  • When address is omitted, the existing reference + offset matching path is preserved unchanged — all existing callers keep their current behavior.
  • disassemblyView.ts now passes currentElement.element.address (the same address it already uses when adding the breakpoint), guaranteeing symmetric add/remove.

Test plan

  • Added a new InstructionBreakpoint suite in src/vs/workbench/contrib/debug/test/common/debugModel.test.ts with 3 tests:
    1. Regression for Unable to remove instruction breakpoints in Disassembly view when instruction reference changes #289678 — removal succeeds when instructionReference has changed but address is stable.
    2. Back-compat — when address is not supplied, the legacy reference + offset matching still works.
    3. Targeted removal — supplying address only removes the breakpoint at that address, leaving others intact.
  • npm run compile-check-ts-native passes cleanly.

Copy link
Copy Markdown
Member

@connor4312 connor4312 left a comment

Choose a reason for hiding this comment

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

thanks!

@connor4312 connor4312 enabled auto-merge (squash) April 16, 2026 16:08
@connor4312 connor4312 merged commit df87114 into microsoft:main Apr 16, 2026
26 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 16, 2026
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.

Unable to remove instruction breakpoints in Disassembly view when instruction reference changes

3 participants