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

Missed set StoppedEvent#hitBreakpointIds of StoppedEvent (DAP) #182

Open
VISTALL opened this issue Dec 25, 2024 · 7 comments
Open

Missed set StoppedEvent#hitBreakpointIds of StoppedEvent (DAP) #182

VISTALL opened this issue Dec 25, 2024 · 7 comments

Comments

@VISTALL
Copy link

VISTALL commented Dec 25, 2024

Hello. There no information about active breakpoint on StoppedEvent (DAP)

void VSCodeProtocol::EmitStoppedEvent(const StoppedEvent &event)

But in other protocols - breakpoint info exists (

MIProtocol::Printf("*stopped,reason=\"breakpoint-hit\",thread-id=\"%i\",stopped-threads=\"all\",bkptno=\"%u\",times=\"%u\",frame={%s}\n",
)

event.breakpoint.id
@VISTALL VISTALL changed the title Missed setting StoppedEvent#hitBreakpointIds on StoppedEvent (DAP) Missed set StoppedEvent#hitBreakpointIds of StoppedEvent (DAP) Dec 25, 2024
@viewizard
Copy link
Member

In case of DAP (see https://microsoft.github.io/debug-adapter-protocol/specification) this is optional field, plus, we don't have stop event multiple breakpoint IDs related code implemented for now. This feature still in our "TODO" list, but I have no idea when we will implement it.

@VISTALL
Copy link
Author

VISTALL commented Dec 25, 2024

Yeah, optional - but its better for IDE it helps find correct paused breakpoint. I tested it with my patch consulo@6e4b9cb

Works as expected, but not sure about implementation - need my tests

@viewizard
Copy link
Member

viewizard commented Dec 25, 2024

But you code have wrong logic. In case, for example, code line will have 2 breakpoints with conditions and both conditions will be "true" (or ... different types of breakpoints map to the same location, multiple source breakpoints get collapsed to the same instruction by the compiler/runtime, multiple function breakpoints with different function names map to the same location, ...), wrong (not full) data will be provided in this filed. This why we don't provide it at all. In case this field not provided, IDE will care about all it need with source path and line number or other data (as it usually do).

@VISTALL
Copy link
Author

VISTALL commented Dec 25, 2024

In this case MI protocol have same issue - its ignore multiple breakpoints

@viewizard
Copy link
Member

Why MI should care about multiple breakpoints? MI stop event have only one breakpoint ID (first breakpoint that triggered thread for stop).

@VISTALL
Copy link
Author

VISTALL commented Dec 25, 2024

Both of protocol implementation, implement EmitStoppedEvent(StoppedEvent) and convert StoppedEvent to the single protocol event.

Also StoppedEvent have only one Breakpoint breakpoint. It's impossible provide info about other breakpoints in this case.

@viewizard
Copy link
Member

Correct, no way for "simple fix" for this case with current code. This is why previously I wrote, that we don't have implemented related code for now. Code that find all related active breakpoints for line and interface changes for multiple breakpoints support in stop event should be added first.

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

No branches or pull requests

2 participants