Search code examples
windbgdbgeng

What does 'Stop Debugging' do programmatically in windbg?


I try to replicate the cleanup that is done by windbg after opening a dump, analyzing it and then 'Stop Debugging'.

When I try to do this in my own program, I leak a lot of memory. I release the com interfaces I have addref:ed and I call SymCleanup, but that does not unmap loaded images or release memory allocated by dbgeng.

The samples provided in the DDK does not seem to provide any more info here. Any secret sauce here?

What I would like is a sample demonstrating open and closing dump files including loading the corresponding images and symbols, without leaking resources.


Solution

  • IDebugClient::EndSession(DEBUG_END_PASSIVE) as @blabb suggested solved the problem.