-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add a "type" field for SourceBreakpoints #454
Comments
Questions:
|
|
Agreed that, for most implementations at least, we don't need 'hardware vs. software' for data breakpoints. But since this is for a custom extension point that doesn't need to be used for just hardware vs. software maybe we want it anyway? Or maybe we just wait for a scenario? I still think we want it for all the instruction breakpoint types. |
So if you provide |
I think we should suggest that clients take the first-presented mode as the "default" and offer alternative actions for the other modes. Adapters should also treat breakpoints without a mode (sent from clients who don't support breakpointModes) as being set at the first mode. Update with these discussions: interface Capabilities {
// ... in addition to existing properties:
/**
* Modes of breakpoints supported by the debug adapter. If present, the client
* may allow the user to select a mode and include it in its `setBreakpoints`
* request.
*
* Clients may present the first mode in this array as the 'default' mode
* in gestures that set breakpoints.
*/
breakpointModes?: BreakpointMode[];
// ...
}
// borrowing properties from the `ExceptionBreakpointsFilter`:
interface BreakpointMode {
/**
* The internal ID of the breakpoint mode. This value is passed to the
* `setBreakpoints` request.
*/
mode: string;
/**
* The name of the breakpoint mode. This is shown in the UI.
*/
label: string;
/**
* A help text providing additional information about the breakpoint mode.
* This string is typically shown as a hover and can be translated.
*/
description?: string;
}
interface SourceBreakpoint {
// ... in addition to existing properties:
/**
* The mode of this breakpoint. If defined, this must be one of the
* `breakpointModes` the debug adapter advertised in its Capabilities.
*/
mode?: string;
}
interface InstructionBreakpoint {
// ... in addition to existing properties:
/**
* The mode of this breakpoint. If defined, this must be one of the
* `breakpointModes` the debug adapter advertised in its Capabilities.
*/
mode?: string;
} If we add this and later need modes to apply to different types of breakpoints, we could add some |
Seems reasonable to me. Definitely a niche usecase but this makes sense. |
As one of the authors of the original request, I would like to confirm that the proposition with the recent addition to have a default breakpoint mode to be the first one in the list looks fine for me. |
Rather than the first one in the list, why don't we make the default value as unspecified, and then the debug adapter is free to choose whatever is the appropriate default? Example where I think this would be helpful: suppose we add mode to all breakpoint types, the debug adapter wants to have a mode for hardware vs software breakpoints, and suppose only hardware breakpoints are supported for data breakpoints. The debug adapter could then ignore mode for data breakpoints, but fail if the user explicitly tried to set the mode to software. |
It sounds like both of these are getting at the same point. I think defining the default is useful for clients when implementing the feature. In VS Code, we would not want to open a picker when a user clicks in the glyph margin to add a breakpoint for a line, so we'd have that in the "default mode". But if we then have an option to "change breakpoint mode" for a given breakpoint, we would show a select box listing the modes, and would want to show the current mode as the default value in the box. If the default value is unspecified, would we just show "unknown" there? That seems like a poor experience. That same problem is faced for other UI indicator of breakpoint mode such as tooltips, icons, or groupings.
If this comes up I think that's a good use case for adding a |
Hi there, thank you for looking into this. When determining hardware breakpoints it is important to clarify the overall numbers available. In some IDE you see the available resources shown in a view somewhere. Will the debug adaptor have this kind of interface? Some of the complexity with this feature comes back to how the IDE will handle it. So while the DAP interface is simple the feature is a bit less so. But that is not so important here. For example users can set breakpoints when they are not connected to the hardware and it is not until the code is downloaded that the exact locations and numbers of breakpoints can be determined in some cases. |
From my comment in the other issue: I think the easiest way to handle this in the existing protocol, without introducing a lot of complexity around counts, is returning further breakpoints as |
Thank you, I understand how it would work when trying to set a breakpoint. But this method does not inform users how many resources they have available until they hit the limit. Probably not hyper important from a priority point of view but something which we have now in our tools. |
I'm not sure how/if I would implement it in VS Code since it's gnarly when we have multiple concurrent debug sessions/types, but I think the need is sensible since all hardware generally has a breakpoint limit. We could add some property for that for clients who can support it: interface BreakpointMode {
/**
* An positive integer indicating the number of breakpoints of this mode the
* adapter supports.
*/
limit?: number;
// ... ...but this is sent before the "launch" request so I'm not sure if that's sufficient for your use case |
Thinking about it this also introduces the problem of multicore context as well. The facilities can differ depending on the core you are setting it on. I don't think that BreakpointMode interface is sufficiently complex. |
DAP does not have any representation of a breakpoint set only for a specific thread or core, so I'm not sure whether that would be in-scope for this change. |
For participants, I have adopted |
The original authors requested the capability to present hard vs soft breakpoints.
Hardware breakpoints are useful in a variety of low-level and embedded computing scenarios. They are supported on major architectures and by debugging such as gdb (the
hbreak
family of commands).Unlike software breakpoints, they are usually limited in number. I do not think we need any new way to express this limit, as DA's can already return a
message
explaining why a Breakpoint may not have been verified. This I propose the following additions:The text was updated successfully, but these errors were encountered: