Is it possible to attach two debugger to one process?

被刻印的时光 ゝ 提交于 2019-12-30 17:22:14

问题


Is it possible to attach two debugger to one process ?

Recently, I had developed a Metro Style App in HTML5/CSS and that was calling a Window Runtime Component written in C#. What I wanted to do was attach two debugger to same process. One at JavaScript & another at C# code.

The Step I followed:

I opened two visual studio instances targeting same solution.

  • I put a breakpoint in JavaScript code and f5/run the application via VS instance 1.
  • But, when I tried to attach 2nd debugger in C# window runtime component via VS instance 2 it gives me a dialog saying "Debugger already attached to process".

I've seen a Window Runtime presentation in which the speaker did the same successfully. Kindly, help me out with this.


回答1:


That's not possible.

See here:

For both managed-only and native-only debugging, you can only attach 1 debugger to a process.

Why?

The native debugger steals debug events from underneath the managed debugger. This confuses the managed-debugger and will cause it to crash. The native debugger has no way of coordinating with the managed-debugger here.




回答2:


You don't need 2 debuggers to do that. You can use the same debugger to debug both. Just make sure your solution contains both projects and just put your breakpoints where you need them



来源:https://stackoverflow.com/questions/12554664/is-it-possible-to-attach-two-debugger-to-one-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!