For several releases now, the native debugger has supported a pseudo-register @clk. @clk can be used as a quick and dirty profiler. As you step along, it can give you some sort of guess as to how long each function is taking. Prior to VS 8.0, the simple way to do this was to add…


Parental Leave

Monday was my first day back at work after twelve weeks of parental leave.  It was a wonderful experience that I highly recommend. In case anyone else cares, I figured I would give a few recommendations. Take parental leave. It is a great time to be with your son/daughter. Take the full 12 weeks if…


Func eval and System.Windows.Forms.Form

If you ever try to debug a multi-threaded Windows Forms application, today’s blog is for you. A customer asked me about this issue, and since I have also run into this problem, I decided to talk about it. What is func eval? If you already know what func eval is, or don’t care, skip to…


Process listing APIs on Windows

There are a bunch of different process listing APIs on Windows. They all have their plusses and minuses. However, I have never seen a summary of them, so I figured I would take a shot at it. ntdll!NtQuerySystemInformation(SYSTEM_PROCESS_INFORMATION, …) – This is the internal, mostly undocumented NT API that should not be used directly. However,…


Dvorak and why you shouldn’t bother

Last week Jensen Harris had a pro-dovak post. I am on parental leave, and just got around to reading it. As another Dvorak typist, I figured I would post as well. I have a very similar story to Jensen. I also learned Dvorak shortly after coming to Microsoft, and I also learned Dvorak to combat…


Reflections on 64-bit

We are getting really darn close to shipping Visual Studio 2005. Visual Studio 2005 is the first released VS-based debugger to support 64-bit. This is a feature that has taken an amazingly long time to ship. The first 64-bit work was done ~8 years ago. 64-bit debugging work was going on well before we actually…


Don’t compare file names

Yesterday I talked about writing a file name comparison algorithm. There are certainly some code bases (and debuggers are certainly one of them) that need to compare file names. That being said, today I wanted to talk about why you shouldn’t compare file names. First of all, file names can come in many forms. You…


Comparing file names in native code

There are new recommendations for comparing strings with the 2.0 .NET Framework (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/StringsinNET20.asp). You can now use OrdinalIgnoreCase to accurately compare file names, user names, etc. The new APIs are great. For the first time there is an easy way to compare strings in the same way that much of the operating system compares strings….


Debug.ListCallStack /AllThreads

One little known feature of the Visual Studio debugger is how to list the callstacks of all threads. Switch to the Command Window Tab. In the general profile, it defaults to a dockable window in the tab group on the bottom right. Debug.ListCallStack /AllThreads Find the thread you want Debug.SetCurrentThread <index> Example output:>Debug.ListCallStack /AllThreadsCallstack for…


Finding COM pointers on the stack

Back in December, I had one post about optimized code debugging. Today I wanted to follow up, and talk about one technique that I have found helpful when debugging native optimized code. One of the most annoying aspects of native optimized code debugging is that it is difficult to find your objects. Even though the…