You don't need to do anything special. abort
call from C/C++ program built by Visual Studio produces the following message:
--------------------------- Microsoft Visual C++ Debug Library --------------------------- Debug Error! Program: ... R6010 - abort() has been called (Press Retry to debug the application) --------------------------- Abort Retry Ignore ---------------------------
Pressing Retry opens debugger with full call stack. This functionality is available both for Debug and Release configurations, when program runs in standalone mode and under debugger. In Release configuration the dialog is different, it contains Break button, which opens debugger, like Retry in Debug configuration.