I'm writing a tool window which provides a set of code context dependent information. Think a combination of various pieces of information about local variables, the current stack frame and thread, registers, etc.
Implementing IVsDebuggerEvents and IDebugEventCallback2 gets me high level information about the current mode of operation (debug vs. design) and lower level information about the debugger's operation, including interfaces to enumerate the debug properties associated with each level of the call stack. What those interfaces don't provide (which makes sense, since they're coming from the DE, which presumably isn't all that aware of how Visual Studio's UI is presenting the information) is notification when the user changes the context by switching stack frame, thread, etc.
The DTE.Events.DebuggerEvents.OnContextChanged event provides exactly the notification I'm looking for, but I'd rather not use DTE if possible, especially since it's just a wrapper around the same set of APIs available to VSPackages.
Is there an equivalent notification mechanism in the non-DTE public interfaces?
In general, what's the proper way to retrieve an IDebugThread2, IDebugProgram2, etc. for the current debug context?
The overview on MSDN makes it sound like the debugger UI (and, by extension, me) is supposed to talk to the SDM, which handles most of the communication with the DE(s), but the SDM doesn't appear to have an explicit interface.
What am I missing?
Thanks!