Skip to content

Conversation

@DrSergei
Copy link
Contributor

Fixes #577

I added this feature based on the instuctionRefenence + offset pair, similar to the setInstuctionBreakpoint request. I don't know what to do with existing required fields (source and line). It looks like that client could set them based on the selected stack frame. And the debug adapter should be able to resolve the selected instruction to the correct location. WDYT?

},
"offset": {
"type": "integer",
"description": "The offset from the instruction reference in bytes.\nThis can be negative. Clients may set this property only if the `supportsGotoInstruction` is true."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"description": "The offset from the instruction reference in bytes.\nThis can be negative. Clients may set this property only if the `supportsGotoInstruction` is true."
"description": "The offset from the instruction reference in bytes.\nThis can be negative. This may only be provided when an `instructionReference` is included in the request."

},
"instructionReference": {
"type": "string",
"description": "The instruction reference for which the goto targets are determined.\nThis should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`. Clients may set this property only if the `supportsGotoInstruction` is true."
Copy link
Member

Choose a reason for hiding this comment

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

I'd do something like...

Suggested change
"description": "The instruction reference for which the goto targets are determined.\nThis should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`. Clients may set this property only if the `supportsGotoInstruction` is true."
"description": "The instruction reference for which the goto targets are determined.\nThis should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`. Clients may set this property only if the `supportsGotoInstruction` is true. If `instructionReference` is set, the debug adapter should ignore the `line`, `column`, and `source` on the request and clients may set them to zero or empy values."

Unfortunately making them actually optional in the types is an interface-breaking change.

"type": "boolean",
"description": "The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields."
},
"supportsGotoInstruction": {
Copy link
Member

Choose a reason for hiding this comment

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

I would name this supportsGotoInstructionTargets just in case we ever have another type of 'go to' action

@DrSergei DrSergei force-pushed the add-instruction-reference branch from c1e87e7 to f00c30f Compare December 16, 2025 20:19
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.

Goto in disassembled code

2 participants