4 ms·
I don't know about C#, but in my Java IDE when I set a breakpoint on an exception I can set a filter not only on the class being throw, but also on the class th
by mrighele 2y ago
I don't know about C#, but in my Java IDE when I set a breakpoint on an exception I can set a filter not only on the class being throw, but also on the class that catch it, the one that throws it and the caller method, and to trigger only after another breakpoint is hit or it is the nth times it has been passed. With this you can make it trigger only when needed in a farly easy way
- CharlieDigital 2y agoIt's the same for the mainstream debuggers for .NET.
- aqueueaqueue 2y agoBut if that class is thrown again and again it is less useful which I see in a lot of codebases. The go equivalent is "catch the exception when it happens here" A debugger feature for that would be nice. I guess it is a debugger concern not an exceptions issue per se.
- CharlieDigital 2y agoThere is a `justMyCode` option even in VSC: https://code.visualstudio.com/docs/csharp/debugger-settings#_just-my-code https://code.visualstudio.com/docs/csharp/debugger-settings#...
- PeeMcGee 2y agoConditional breakpoints exist in Intellij and work well with Java in my experience. You craft a little boolean expression on the breakpoint that references variables in-scope, and the debugger skips the breakpoint unless the expression evaluates to true. Every time I've used this feature has been one of the darkest times of my life.
- renewiltord 2y agoIt also slows down execution so much. Agreed that it is a dark day if I'm forced to use that. If it's not in library code I just put the condition in an if and put the breakpoint inside it.