BT

InfoQ Homepage News Introducing Rodney Viana’s WinDbg Extension for .NET Debugging

Introducing Rodney Viana’s WinDbg Extension for .NET Debugging

Bookmarks

When a .NET application fails in production the developer is often left with just a memory dump. Since Visual Studio cannot handle dumps, you have to instead look at a tool called WinDbg. This is often used with SOS.dll or Psscor4.dll, which are extensions that expose .NET specific details. Though powerful, these can be difficult to use so developers occasionally create their own extensions. Once such developer is Rodney Viana, who has just released netext 1.6.1 as an open source project.

An interesting feature of netext is the ability to query the heap using a SQL-like syntax. For example, say you wanted to see a list of recent web requests that failed. Since the HttpContext objects are cached you can look for failed queries using this syntax:

!wfrom -type *.HttpContext |
where ( ($contains(_request._url.m_String, "http:")) && (_response._statuscode != 0n200) )
select $addr(), _request._url.m_String, _response._statusCode

Here is a list of the supported commands:

Commands to Show Object Details

  • !wdo - Display ad-hoc objects or arrays from GAC or Stack
  • !wselect - Display ad-hoc fields (and level fields) for an object or for all item in an array
  • !wfrom - Perform SQL-like analysis of Heap objects enabling comparison, expression evaluation and indexed filtering.

Enumerate objects

  • !windex - index and display objects based in different filters like object with of type HttpContext
  • !wstack - dump unique stack objects
  • !wheap - list objects without indexing and show thottled heap sampling
  • !wgchandles - Dump GC root handles

Special Purpose

  • !wdict - Display dictionary objects
  • !whash - Display HashTable objects
  • !whttp - List HttpContext Objects
  • !wconfig - Show all .config file lines in memory
  • !wservice - List WCF service Objects
  • !weval - Evaluate expression list
  • !wclass - Show "reflected" class definition (fields, properties and methods)

Netext also supports functions for working with aggregation, strings, XML, arrays, and reflection.

Netext is offered under the GNU General Public License version 2. Though Rodney Viana is a Microsoft employee, this considered to be a personal project and is not supported by Microsoft.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.