microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.39k stars 28.62k forks source link

Vscode Sets breakpoint in both sessions in multicore debugging with single Debug Configuration #181794

Open asitsahoo351 opened 1 year ago

asitsahoo351 commented 1 year ago

In multicore debugging with a single debug configuration when we try setting breakpoints in either of the sessions it sets breakpoints for both of the debug sessions. For Example, Consider the Following case:

When we set a breakpoint in one Session which turns out to be an outbound breakpoint, then it tries to resolve the breakpoint to a random location in the other Debug Session, which results in an exception. So if we can stop setting breakpoint in both sessions and instead set them only in the user-requested session, we can overcome this problem.

roblourens commented 1 year ago

What language? Adding a breakpoint always sets it in all debug sessions, but if it's not a valid location for some debug session that should be ignored.

asitsahoo351 commented 1 year ago

If we set breakpoint always in all debug sessions, It might create an issue in case of Disassemly Debugging. The location of the breakpoints is the Instructions Addresses in disassembly Debugging. The Instruction addresses of one Session might resolve with the Instruction address of another Session. Hence, it might hit the breakpoint in an unexpected location.

To resolve such conflicts, we can set them only in the user-requested session.

roblourens commented 1 year ago

I think you're right and that could possibly be an issue, just looking at DAP, but we don't have a way to avoid this right now

connor4312 commented 1 year ago

We would have to introduce the notion of session or config-specific breakpoints, which is a good idea but a bigger change