Add Windbg (kd>) Commands to Program Default for Dump Files
Info
Add Windbg (kd>) Commands to Program Default for Dump Files
This will show you how to set up default Windbg commands that will then automatically execute each time you run Windbg.
I use these commands; you can use any commands that you wish to.
Code:
!analyze -v;r;kv;lmtn;lmtsmn;.bugcheck
We're all familiar with the !analyze -v
r = registers
kv = display stack backtrace (verbose mode)
lmtn = list modules in order of memory addresses
lmtsmn = list modules in alphabetic order
.bugcheck = Bugcheck + P1, P2, P3, P4
Most of us have Windbg set up as the default program for dump files - 2. Set Windbg File Associations
Did you know that you can also add kd commands to run by default as well?
Simply setting up Windbg as the default program leaves Windbg at this point after double-clicking on a dump file -- waiting for you to enter additional commands at the kd> line such as !analyze -v -
Code:
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
Use !analyze -v to get detailed debugging information.
BugCheck 50, {fffff80011b0e74d, 8, fffff80011b0e74d, 2}
Could not read faulting driver name
Probably caused by : ntkrnlmp.exe ( nt! ?? ::FNODOBFM::`string'+43346 )
Followup: MachineOwner
---------
I changed my default set up to include these commands -
Code:
!analyze -v;r;kv;lmtn;lmtsmn;.bugcheck
So, when I double-click on a dump file, all of the basic commands that I like to run do so without me having to enter them at the kd> command line.
Try it out!
Back up your registry first (I opted to create a system restore point).
Maneuver to this registry key and add your default Windbg commands -
Code:
HKLM\SOFTWARE\Classes\WinDbg.DumpFile.1\shell\Open\command
The (Default) should look something like this (by default):
Code:
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbg.exe" -z "%1"
You will be adding the following:
Code:
-c "!analyze -v;r;kv;lmtn;lmtsmn;.bugcheck"
I added the kd commands that I mentioned above after the %1:
Code:
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbg.exe" -z "%1" -c "!analyze -v;r;kv;lmtn;lmtsmn;.bugcheck"
Double-clicking on a dump file now runs all of the commands in RED by default.
Regards. . .
John
Attachments
Last edited by a moderator: