Published on, Time to read
🕒 1 min read

Breakpoint evaluation and logging in Rider

Authors
  • avatar
    Name
    Dariusz Woźniak

When it comes to debugging, there might be a case when the load of calls to the breakpoint is significant. Or, we want to log some data while debugging. In this case, it is useful to do not suspend the execution and evaluate the breakpoint condition and log the result (In JetBrains Rider).

That kind of trick is helpful in scenarios where debugger stops multiple time and we have an interest on certain property values.

It can be achieved in Rider in a following way:

  1. Set a breakpoint.
  2. Click on More in the breakpoint window.
  3. Set "Evaluate and log" with the code you want to output.
  4. Optionally, you may suspend execution, so the breakpoint will not be stopped while debugging. In this case, breakpoint will appear as yellow.
  5. See the output in the Debug > Debug Output window.

See the screenshot below:

Breakpoint evaluation and logging
Image: Breakpoint evaluation and logging

And the Debug Output for my case:

DefaultBlockController: Loading HeroBlock
DefaultBlockController: Loading ButtonBlock
DefaultBlockController: Loading TextBlock
DefaultBlockController: Loading HeroBlock
DefaultBlockController: Loading ButtonBlock
DefaultBlockController: Loading HeroBlock
DefaultBlockController: Loading ButtonBlock