Running WinDbg in headless mode
Asked Answered
D

1

6

Is there a way to WinDbg in pure headless mode ? My use case is that I should be able to imitate "!analyze -v" command for a minidump on command line without launching WinDbg GUI.

Deviltry answered 15/1, 2015 at 0:14 Comment(3)
How about using cdb as your debugger (console version of WinDbg) and then configure the default debugger in the registry to launch: cdb.exe -c "!analyze -v" -p %ld -e %ldVulpine
Let me give it a shot. Thanks for your prompt responseDeviltry
So I found cdb to be useful and serving my purpose. Thanks :)Deviltry
B
7

With the Debugging Tools for Windows, there is also cdb, the console debugger.

To debug a crash dump, use the -z "<dump>" option. To run a command immediately, use -c "<command>". To output everything into a file you can redirect the output with a usual DOS > <file> or open a log file using .logopen <file>. To exit CDB after the analysis, use q.

You want to make sure that you have symbols set up correctly, so include a .symfix <path>;.reload. I prefer using .symfix <symbolpath> in the command rather than -y <symbolpath>, so I can always check in the log that it has been set correctly.

Full command line (using redirect)

"<windbgpath>\cdb.exe" -z "<dumpfile>" -c ".symfix <symbolpath>;.reload;!analyze -v;q" > "<logfile>"

Disadvantage of redirect: line ending is LF only. And you get a lot of noise when the debugger starts.

Full command line (using log file)

"<windbgpath>\cdb.exe" -z "<dumpfile>" -c ".logopen <logfile>;.symfix <symbolpath>;.reload;!analyze -v;.logclose;q"
Bolme answered 24/1, 2015 at 21:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.