After I published my post on debugging dependency properties with WinDbg, I figured out that the process that I described can be easily automated, which in turn, can be a great opportunity to take the new ClrMD library for a test drive. Thanks to ClrMD, I managed to come up pretty quick with a fairly reasonable POC. In this post, I want to introduce you to the result of that test drive: WPF Memory Dump Analyzer.
WPF Memory Dump Analyzer is a tool that scans a memory dump of a WPF application for all the dependency objects on the managed heap. For each one of them it lists the dependency properties, their default values and their effective values.
To get started, launch the application and drag a memory dump into it:
Once a memory dump was dragged into it, the following information will be shown:
The left pane shows the address and type of all the dependency objects on the managed heap. Once a dependency object is selected, the two right panes will be filled with its dependency properties and its effective values. The top pane shows the address, type, name and default value of each dependency property, as well as its unique id. The bottom pane shows all the entries in the effective values array of the dependency object, which practically means all the properties for which the object holds a local value.
Currently it does not support analysis of memory dumps for processes with different architecture than its own, which means that you cannot analyze memory dumps of 32bit applications if you compile it for 64bit, and vice versa. In order to do so seamlessly, I will need to load the memory dump in an architecture-specific, out-of-process host, which will communicate with the UI through some sort of IPC.
The application is pretty basic right now and was written mainly as a way to play with the new ClrMD library, but I will try and add some features from time to time, at least until VS2013, with its built-in memory dump analyzer for .NET application, will be released. Some of the features that comes to mind are a better support for object inspection (currently only the address is shown), filtering, and memory dump comparison. Feel free to send me feature requests or, better yet, some pull requests.
The project is hosted on GitHub.