问题
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