I've written small VSIX plugin which is able to attach debugger to particular process. This process is written using c# and c++ code, so I need to attach to it using both managed and native engines. From Visual Studio it can be achieved simply by selecting these engines from window opened by DEBUG -> Attach to process... -> Select...:
Below, I've shown the code sample which basically does the same thing, using Process2.Attach2
(MSDN):
EnvDTE80.DTE2 dte = GetService(typeof(SDTE)) as EnvDTE80.DTE2;
EnvDTE80.Debugger2 dteDebugger = dte.Debugger as EnvDTE80.Debugger2;
EnvDTE80.Transport transport = dteDebugger.Transports.Item("default");
EnvDTE80.Engine[] engines = new[] { transport.Engines.Item("managed/native") };
process.Attach2(engines);
Unfortunately, the very same code which works for VS2012, doesn't work for VS2013 (Update 1).
What I've noticed is keyboard problems. Visual Studio doesn't react for pressing key shortcuts. For example, if I press F10, debugger does nothing. If I want to step over any breakpoint, I need to use mouse instead and access context menu: DEBUG -> Step Over, etc.
It's annoying, I need the keyboard to control debugger. Has anyone noticed this problem and solved it already?
BTW: If I use managed engine only (transport.Engines.Item("managed")
), the keyboard starts to work correctly. But because I need to debug through unmanaged code also, I need additional engine - the native one.
EDIT: I've reported it also to Microsoft Connect network.