IVsDebuggerEvents
(Microsoft.VisualStudio.Shell.Interop.dll) provides notification when the debugger changes mode while IDebugEventCallback2
(Microsoft.VisualStudio.Debugger.Interop.dll) is used by the debug engine to send debug events. Usage of these interfaces will allow to gather required information.
UPDATE: Detailed example of how to do it is shown on my github repository where I've written Visual Studio extension which allows to attach debugger to previously debugged processes.