Skip to content
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

Debug adapter protocol: Allow for breakpoints to resolve to multiple locations #13

Closed
ebluestein opened this issue Oct 2, 2018 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@ebluestein
Copy link

Currently, the protocol allows the debug adapter to respond to a SetBreakpoints request with a response that contains a Breakpoint (https://github.com/Microsoft/vscode-debugadapter-node/blob/master/protocol/src/debugProtocol.ts#L1462)

Breakpoint, if representing a Verified breakpoint, has a single notion of the breakpoint's resolved location. But for many debug adapters, a single breakpoint might actually resolve to n locations. This is especially true for native debuggers where a function in a header file might be inlined all over the program.

The debug adapter can maintain this mapping internally and not share it with the UX, but then the user can't accurately see the location(s) a breakpoint resolved to.

Would it be possible to add something like an optional array of resolved locations to Breakpoint? Maybe something like:

export interface BreakpointLocation {
    /** The source where the breakpoint is located. */
    source?: Source;
    /** The start line of the actual range covered by the breakpoint. */
    line?: number;
    /** An optional start column of the actual range covered by the breakpoint. */
    column?: number;
    /** An optional end line of the actual range covered by the breakpoint. */
    endLine?: number;
    /** An optional end column of the actual range covered by the breakpoint. If no end line is given, then the end column is assumed to be in the start line. */
    endColumn?: number;
}
@isidorn isidorn assigned weinand and unassigned isidorn Oct 3, 2018
@weinand weinand transferred this issue from microsoft/vscode Nov 7, 2018
@microsoft microsoft deleted a comment from vscodebot bot Nov 7, 2018
@weinand weinand added the feature-request Request for new features or functionality label Nov 7, 2018
@weinand weinand assigned roblourens and unassigned weinand Nov 2, 2022
@tromey
Copy link

tromey commented Jul 27, 2023

I wonder if this is a dup of #114. That one has a more complete proposal in it.

Anyway, this problem came up during the gdb DAP implementation. Currently gdb will just report the first location, but that's not really very good -- the IDE may want to display some marker at all the locations, not just the first one.

@roblourens
Copy link
Member

Yeah, we can probably merge this into #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants