Switching from VS debugger to WinDbg

岁酱吖の 提交于 2019-12-23 16:45:56

问题


Given I have started a live debugging session by clicking the Play button in Visual Studio (F5) in order to launch the executable.

Say that I find an interesting situation which cannot be analyzed in Visual Studio but I know how to analyze it in WinDbg.

How would I detach Visual Studio and attach with WinDbg so that WinDbg is now the debugger?

I have tried:

  • detaching VS, but that will of course continue running the application, which I don't want
  • attaching WinDbg. Only one debugger can be attached. I'm not looking for a non-invasive attach of WinDbg.
  • I'd not like to create a crash dump in VS and then analyze that in WinDbg. I would prefer continuing the live debug session.
  • freezing the threads (interestingly they show up as unfrozen in a non-invasive WinDbg), but they will be unfrozen when detaching VS

回答1:


Here's how it worked for me:

  1. Attach a WinDbg instance in non-invasive mode (F6)
  2. Detach Visual Studio
  3. Attach a new WinDbg instance in invasive mode (F6)
  4. It will break automatically
  5. Detach the non-invasive WinDbg (.detach)

Likewise you can transfer control back to Visual Studio:

  1. Attach a WinDbg instance in non-invasive mode (F6)
  2. Detach the invasive WinDbg (.detach)
  3. Attach Visual Studio
  4. Break in Visual Studio (press Pause)
  5. Detach the non-invasive WinDbg (.detach)


来源:https://stackoverflow.com/questions/47710102/switching-from-vs-debugger-to-windbg

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