Making it easier to debug .net dumps in windbg using .cmdtree


John Robbins beat me to the punch and wrote an excellent post about using .cmdtree in windbg to ease some .net debugging pain in windbg.

The windbg .cmdtree command allows you to create a popup window in windbg with commands that execute when you click on the respective link…  so you no longer have to remember all the sos commands to get around in your managed dump.

091708_1904_WinDBGcmdtr1

Read his post here and with the command tree text file he provides you will be up and running in no time…  You can also add the command .cmdtree c:\util\sos-cmdtree.txt once you have this set up, to your commands file to get it loaded automatically when you open dumps….   And of course, you can easily customize your commandtree so that you can execute any commands you like.

Really sweet,

Tess

Comments (9)

  1. Tess –

     When I add .cmdtree sos-cmdtree.txt to my commands.txt file (according to your prebvious blog post) I get an execution error:

    0:000> $<c:debuggerscommands.txt

    0:000> .loadby sos mscorwks

    0:000> .load sosex

    0:000> .cmdtree sos-cmdtree.txt

                                 ^ Syntax error in ‘.cmdtree sos-cmdtree.txt’

    I’ve tried full paths, and quotes, semi colons, extra lines, but no luck.

    Any pointers?

    FileVer for WinDbg is

    –a– W32i   APP ENU         6.8.4.0 shp    524,472 09-27-2007 windbg.exe

    Thanks!

    Chris

  2. John Robbins says:

    Chris,

    You’ve got an old version of WinDBG. Grab the 6.9.3.113 version from Microsoft and you’ll get the .cmdtree command.

    John Robbins.

  3. Tim says:

    I have the same problem that Chris does, but I have the latest version of WinDBG.  The command works if I type it at the command window, but I cannot get it to work from the commands file.  I get the ‘Syntax error in .cmdtree sos-cmdtree.txt’ error when WinDBG opens.

    Thanks,

    Tim

  4. Tess – .cmdtree worked for 6.8.4.0 without any problem it was the startup commands.txt that didn’t work.

    So for some reason, when its in a $< script, .cmdtree isn’t working for me.

  5. Bruno Aleixo says:

    Commands that are directed at windbg UI like .cmdtree don´t work from script files. Sorry

  6. @Tim

    try to specify the full path, then it works

  7. There is an undocumented feature in WinDbg that may be useful for remembering WinDbg commands and essentially