Handmade Hero»Forums»Code
Ginger Bill
222 posts / 3 projects
I am ginger thus have no soul.
WinDbg
Is there any benefit to using Visual Studio as a debugger over WinDbg?
Mārtiņš Možeiko
2559 posts / 2 projects
WinDbg
windbg is more powerful. It allows to enter much more commands to do stuff VS cannot. It is very useful if you want to debug generated native code from .NET code. It also has various plugins for ton of stuff VS cannot do. But for regular simple C/C++ code debugging VS is fine.
Ginger Bill
222 posts / 3 projects
I am ginger thus have no soul.
WinDbg
To be more clear, is the any advantage using Visual Studio for debugging C/C++ code compared to WinDbg? Is there anything Visual Studio can do for debugging that WinDbg cannot and vice versa?
Mārtiņš Možeiko
2559 posts / 2 projects
WinDbg
Edited by Mārtiņš Možeiko on
Technically you can do in VS everything you can do in WinDbg. Because VS can read and write process memory, you can analyze and figure out everything just with memory window.

But some things could be much easier done in WinDbg because of custom plugins.
Nevertheless, basic source level debugging (breakpoints, stepping, variable watches) works just fine in VS. There is no reason to switch to WinDbg for that.
Ginger Bill
222 posts / 3 projects
I am ginger thus have no soul.
WinDbg
Thank you.

I am only asking as all I use Visual Studio for is debugging and I was wondering if WinDbg could replace that entirely. WinDbg is extremely fast and does things instantly compared VS. I will try it out and see if it can replace what I need.
Mārtiņš Možeiko
2559 posts / 2 projects
WinDbg
Edited by Mārtiņš Možeiko on
Yes, it can replace VS.

By default the interface it may look a bit alien, because it is more like gdb - command prompt oriented . But you can adjust it to work like VS.

Here's how you do source code debugging. Here's how you view local variables.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
WinDbg
I would like to switch to WinDBG and have actually tried multiple times to move my workflow over to it, but I always find there are problems regarding restart or saving breakpoints across runs or various things that make it bad for workflow. I suppose it's time for me to try again (it's a bit of a ritual at this point), perhaps :)

In general, I agree with Martins, WinDBG is definitely a better _debugger_, so you definitely don't lose anything in terms of debugging features moving from Visual Studio to it. If anything it'd be the other way around. But I've always in the past found there to be workflow problems with it, as well as sometimes it being incompatible with PDBs in weird ways that are hard to decipher.

- Casey
306 posts / 1 project
None
WinDbg
Note that WinDBG can be integrated into Visual Studio (since VS2012). See http://blogs.msdn.com/b/mariohewa...-2012-and-windbg-integration.aspx

There is a ton of stuff that WinDBG can do that Visual Studio's debugger can't begin to touch. Searching memory, viewing the process' heaps, more sophisticated breakpoints, and so forth.

I also have a similar ritual for my New Year resolution: never launch Visual Studio. I go as far as to using cdb (command-line debugger that is part of the debugger tools) but, as was already said, there are always subtle issues that make it hard to stick with.
Ginger Bill
222 posts / 3 projects
I am ginger thus have no soul.
WinDbg
I am trialling it out now. It's workflow is a little annoying; I can already see the benefits but the need to start from scratch every time is really annoying.
Mārtiņš Možeiko
2559 posts / 2 projects
WinDbg
Edited by Mārtiņš Možeiko on
You can write scripts for windbg (or even C/C++ plugins). Not sure of how much is possible with it, but for sure you could automate something with it.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
WinDbg
Yeah basically if the state of your debugging could be saved, and if the fails-to-load-symbols bugginess has been resolved, then Visual Studio could go in the trash heap. If someone does do the work to figure out how to not "start from scratch every time" as gingerBill mentioned, please post about it here... I'd check it out again.

- Casey