Sunday, 22 November 2009

Debugging Tools for Windows


Debugging Tools for Windows - Overview

Looking for updates and drivers for your personal computer?

You can use Debugging Tools for Windows to debug drivers, applications, and services on systems that are running Windows NT 4.0, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. You can also use Debugging Tools for Windows to debug the operating system itself. Versions of the Debugging Tools for Windows package are available for 32-bit x86, native Intel Itanium, and native x64 platforms.

The latest release of Debugging Tools for Windows is available for download (see the Using Debugging Tools for Windows section on this page). You can also install the package from the Windows Driver Kit (WDK), the Platform SDK, or a Customer Support Diagnostics CD.

Note: If you have a system with a 64-bit processor and you are debugging an application on it, you must use one of the native 64-bit packages.

---------------------------


Command

.loadby sos mscorwks

~*e!drstack

1 comment:

admin said...

We can use Windebug to detect memory leak and hang problem. Here are steps to use it:

Step1: Dump memory of a process to dump file

- Run cmd and cd to windebug folder, there is vbs file name adplus.vbs

- Run it by command:

o cscript.exe adplus.vbs -hang -pn [ProcessName] or

o cscript.exe adplus.vbs -hang -p [ProcessId]

Step2: Open windebug GUI and attach the dump file at location \ Program Files\Debugging Tools for Windows (x86)\Hang …..

Step3: load sos extension to debug managed application

- .loadby sos mscorwks

Step4: dump stack track for all managed thread, list all threads

- ~*e!clrstack

- !threads

Step5: dump object count for all type or specific type

- !dumpheap -stat

- !dumpheap -stat -type [NameFilter]

Step6: dump object data

- !do [ObjectAddress]