Breakpoints in c++ lambdas triggered when defined rather than executed
E.g. code below stops on line following definition of lambda while setting up the lambdas instead of on the line with the breakpoint when it's later executed.
Not posted as a bug as this is a very common debugging situation, 100% repro - so suspect I'm doing something wrong.
(Latest non EAP release, Unreal Engine, Windows, FWIW).

Please sign in to leave a comment.
Hello Stebboko,
Thank you for contacting Rider support.
We are sorry to hear that you experience difficulties with debugging.
Regrettably, I was not able to reproduce the issue. Would you mind sharing additional information as described below, so that we can take a deeper look?
thread info,breakpoint listand share the output;Have a nice day!
Yes, I shall indeed do that next time I'm debugging an area with lambdas. Happens everytime fortunately.
I've just seen this happen with a breakpoint under Slate code, and although there are square brackets involved like lambdas, I noticed this time it was engine file. They may have been engine files when I noticed the problem with lambdas as well.

With the DebugGameEditor configuration, these engine files will of course be optimized during compiling.
If you feel this shouldn't happen even for optimized files, LMK and I can collect the required logs.
Dmitry Kazantsev This issue has been happening again, and wasn't related to optimized engine files.
I've uploaded the requested data, Upload ID: 2023_11_19_Vg3o27mXxCig4Xdhj5goj7
Hello Stebboko,
Thank you for the details shared.
Indeed, there is a problem and our debugger can't properly resolve such a breakpoint. I reproduced the issue and registered it on our tracker: Wrong breakpoint resolve in non-executable branch of Slate code.
Regrettably, I have no workaround to suggest at this time, except not to placing breakpoints on such code constructions. Apologies for the inconvenience. We would appreciate it if you could upvote the issue to demonstrate your interest. Feel free to share any information if I missed anything.
If there is anything else I can assist you with, please tell me.
Have a nice day!
Just to add, I have a similar issue with lambdas (Rider 2023.3.1):
The whole method is surrounded with `#pragma optimize("", off)`.
For reference, VS clearly states that it cannot do it (which is preferred over a valid-breakpoint-visual-but-not-breaking-there imo):