Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to step inside an overloaded operator while debugging?

Take for example the following code:

    public static void Main()
    {          
        Console.WriteLine(Integer.zero - new Integer(5));             
    }

I'm trying to debug what happened when the - (minus operation) is called but when I try to debug by pressing F11 (step into) it just goes inside the constructor and toString()...

How can I debug inside the overloaded - operator?

like image 364
vmp Avatar asked Jul 29 '26 20:07

vmp


1 Answers

The debugger steps over properties and operators in managed code by default. In most cases, this provides a better debugging experience.

To enable stepping into properties or operators, choose Debug > Options and Settings. On the Debugging > General page, clear the Step over properties and operators (Managed only) checkbox.

like image 185
vmp Avatar answered Aug 01 '26 12:08

vmp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!