What do I do to run Windbg/dbeng.dll commands from within the Visual Studio debugger and the Immediate Window?
Asked Answered
H

1

4

I saw in a video talk by Bart de Smet where he was running Windbg commands by typing them into the Immediate Window in Visual Studio when running the project in debug mode inside the Visual Studio debugger.

So, I wanted to try that myself. So here's what I did:

  1. I went to the Project Properties dialog and then selected the Debug tab, then checked the Enable native code debugging in the Enable Debuggers section.

enter image description here

  1. I set a breakpoint on one of the lines and then launched the project with debugging by hitting F5. When the breakpoint was hit, I opened the Immediate Window and typed the .load command to load sos.dll.

enter image description here

But the message I got as a result read:

.load "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll"
error CS1525: Invalid expression term '.'

Is there something else I need to do?

I am using Visual Studio 2015 Community edition.

Herrin answered 7/4, 2017 at 21:21 Comment(1)
No longer supported since, oh, VS2012 or so. You can try spinning the wheel of fortune with the old debugging engine, but don't expect miracles.Gratulation
C
0
  1. Run your application without debugging
  2. Choose Debug/attach to process ...
  3. Choose "Windows User Mode Debugger" as transport
  4. Click "Refresh"
  5. Choose your application
  6. Click "Attach"
  7. Open the "Immediate Window", which will labelled be "Debugger Immediate Window"
  8. Enter WinDbg commands
Castellated answered 7/4, 2017 at 23:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.