Search code examples
c++-clivisual-studio-debugging

How to enter in the body of a destructor in MS VS 2010?


When I try to debug a C++/CLI program in MS VS 2010 and use key F11 to enter the body of a destructor of some class the debugger skips this step.

How to force the debugger to enter the body of a destructor?


Solution

  • This is another leaky abstraction issue, you can tell what's going on when you look in the Output window after you tried to step:

    Step into: Stepping over method without symbols 'Foo.Dispose'

    Luckily the debugger still allows you to set a breakpoint on the destructor. Which is the workaround.