Freigeben über


Need to debug in both of Native and Managed together, but don't want to use InterOp mode debugging....

VS7.x debugger has awesome feature which is known as InterOp, debugging managed and native codes together. it will let you step between different program types. so you can step from Native code to Manage and Manage to Native. also you can see mixed call stacks.

However, this feature is not flawless. it is slower than native only and managed only debugging. and in some cases, your native debugging is limited by InterOp mode debugging. but you still need to debug your process with both of them.

Well, I got this kind of situation some times and I was thinking how I can do this. and I figured out a way to do this. Normally VS7.x debugger checks whether there is any other debugger in place or not before starting debugging. so with general way, you will just get an error message.

But, if you start managed debugging first and attach to the process via MSVCMON for native debugging with other instance of debugger, you still can debug one process with two different debug modes(both of Native and Managed).

However when native debugger gets into break mode, because it is hard mode break your managed side debugger can't do any thing at all until you release the Native side debugger to get into run mode.

if you remember this, when your InterOp mode debugger doesn't fit into your situation, you still can do debugging in both way at same time.

Hope it help you.