BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Introducing Rodney Viana’s WinDbg Extension for .NET Debugging

by Jonathan Allen on Nov 08, 2013 |

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.

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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT