Displaying and Searching std::map Contents in WinDbg

July 25, 2013

This time we’re up for a bigger challenge. We want to automatically display and possibly search and filter std::map objects in WinDbg. The script for std::vectors was relatively easy because of the flat structure of the data in a vector; maps are more complex beasts. Specifically, an map in the Visual C++ STL is implemented as a red-black tree. Each tree node has three important pointers: _Left, _Right, and _Parent. Additionally, each node has a _Myval field that contains the std::pair with the key and value represented by the node. Iterating a tree structure requires recursion, and...
tags: , ,

Displaying and Searching std::vector Contents in WinDbg

July 18, 2013

WinDbg has never been very good at visualization. While Visual Studio has always had autoexp.dat, and as of late also native debugger visualizers, WinDbg users had to settle for dumping memory areas and searching memory to identify patterns. On the other hand, Visual Studio does not offer any automation opportunities today if you’re looking to simplify your debugging process. You can’t write macros anymore as of Visual Studio 2012. WinDbg continues to offer scripting support so you can automate any mundane debugging tasks you encounter. If you make it past the initial learning curve and master WinDbg scripts,...
tags: , ,

Celebrating Our New and Existing Microsoft MVPs

July 12, 2013

It has been an amazing five years. From just one Microsoft MVP working at Sela we went up to seven, and our experts team has grown and expanded into new and exciting technologies, including Windows Azure, Windows 8, mobile, HTML 5, and many others. I am proud to be part of this team today. My best wishes and congratulations to our existing and renewed Microsoft MVPs: Alex Golesh, Silverlight MVP Ido Flatow, Microsoft Integration MVP Shai Raiten, Visual Studio ALM MVP Gil Fink, ASP.NET/IIS MVP...
no comments

Lock vs. Mutex

Here’s a quick brainteaser for you. Suppose you really want to find all the prime numbers in a certain range, and store them in a List<uint>. And also suppose that you want to parallelize that calculation to make it as quick as possible. You then need to synchronize access to the list so that it’s not corrupted by add operations performed in multiple threads. Would it be better to use a C# lock (CLR Monitor) or a Windows mutex to protect the list of primes? Parallel.For(2, 400000, n => { ...

Some Post-Build Thoughts

July 9, 2013

It has been a week and a half since I returned home from Build, and it took me a while to organize my thoughts. During the conference I’ve been hopping from session to session, meeting old friends and making new acquaintances, and haven’t really had any time to process what I was seeing. There was one thing I felt throughout the conference, which was a bit hard to put into words, but I’ll try anyway: this time, Build had a great atmosphere. Last October in Redmond we spent most of the time between sessions standing in line for...
no comments

Introduction to Performance Measurement Session

July 3, 2013

I delivered a short two-hour session today introducing performance measurement tools. We covered performance counters – including a demo of custom performance counters, the Visual Studio profiler (sampling, instrumentation, allocations, and concurrency), and finally capturing ETW information using PerfView. Introduction to .NET Performance Measurement from Sasha Goldshtein The slides and demos are available here. In the Allocations folder you’ll find an app that allocates memory rapidly because it uses string concatenation instead of StringBuilder. In the Leak folder you’ll find a classic memory leak. In the Concurrency folder you’ll find a naïve parallelization attempt...
no comments

Visual Studio 2013 Heap View

July 2, 2013

It’s always fun to add a new blog tag – VS2013. In today’s post I’d like to tell you about the Heap View feature (a.k.a. “Debug Managed Memory”) that you can use to analyze dump files in Visual Studio 2013, announced at Build last week. Although this feature is far from baked and would likely only be useful for simple investigations, I welcome any improvements to the diagnostic tooling built into Visual Studio and look forward to the day I can solve most bugs without leaving the IDE. Essentially, Heap View is a simple explorer for your application’s...

Capturing Dumps of Windows Azure Web Sites

July 1, 2013

Among the hundreds of new feature announcements at Build, one gem is hidden in plain sight: an improvement to the Kudu platform (Windows Azure Web Sites) which enables you to capture a dump file of your website’s process across the wire. No more remoting into the destination VM, fiddling around with tool downloads, and putting the dumps in a shared FTP folder. You can now generate a minidump – or even a full dump if you need to – by hitting a diagnostics endpoint on your website. Specifically, if you set up a Windows Azure Web Site at...
no comments