QOL idea: allow breakpoint toggle off on automatic breakpoints such as Debugger.Break();


I'm going to be honest, I haven't used conditional breakpoints yet. I don't know if I ever will. Instead I expose a debug flag on the object I want to break-point. 

if(debug)
   debug = debug; (break-point here)

This works great, but then you have a bunch of floating break-points that will always need to be there in the break-point list. Maybe they'll be cleared or a coworker won't have them, it becomes garbage floating code. 

A quick fix for that is to use a call to trigger a break-point manually (C# for Unity)
if(debug)
   System.Diagnostics.Debugger.Break();

But when you have a couple of these in an object and you're trying to hone in on problems, there is no way to quickly disable them. Attempting to break-point the Debugger.Break() line just doubles the effect.

I think it would be cool if these could be temporarily disabled via the same action of clicking left of the code, with a different graphic indicating it's disabled. It'd also be nice if calls like Debugger.Break() displayed a variation of the break-point graphic left of the code while enabled. 

Unity + Rider is such a dream <3

0
1 comment

Hello Jack,

Thank you for contacting Rider support.

I am not sure I clearly understand your problem. At least, why are you writing these extra snippets for debugging purposes and not just put breakpoints?

Here are some tips you might find useful:

  • There is a button in the debug toolwindow that allows muting all the breakpoints;
  • Also, you can open the Breakpoints dialog where you can enable/disable/configure specific breakpoints:
  • You can disable exact breakpoints right from the editor:
  • You can use conditional breakpoints;
  • You might want to consider using Unity pausepoints. (see this blogpost for more information);

If that doesn't help, I would appreciate it if you could elaborate on your scenario.

Have a nice day!

0

Please sign in to leave a comment.