When doing a revision of a book, the idea is to keep the changes to a 10%-20% so you can get it done. For some reason, I am utterly incapable of simply doing a revision. While a few paragraphs remain the same, I end up rewriting everything. Part of this is because we’ve all learned more about .NET development in the intervening years. Another part is that I’m splitting my book in two, one for .NET and one for native so I’m moving many parts around. However, the major part is that I’m just a super anal-retentive kind of guy. Just ask my wife, my co-workers, or anyone for that matter!

Below are the Word page counts for the first section on preparing to debug and the second on debugging. The Word template uses double spacing for all lines and there are no figures, but it’s good enough to give you an idea of the amount of new content.

  • The original Gestalt of Debugging chapter is 39 pages and the new version is 48 pages, which isn’t too bad.
  • The Preparing for Debugging chapter was 65 pages, but the new grew to 95 pages!
  • The Debugging During Coding chapter, which originally contained 96 pages of both .NET and native debugging discussion (mostly focused on native) now contains 96 pages just on .NET only! The Review Crew really loved this chapter because the new SUPERASSERT.NET is extremely cool, if I do say so myself.
  • The original Advanced Debugger Usage with Visual Studio .NET and Advanced .NET Debugging with Visual Studio .NET chapters were a total of 70 pages. Stripping out all the native parts and adding all the coolness of Visual Studio .NET is back to 70 pages.
  • The original Advanced Native Code Techniques with WinDBG chapter was 71 pages. The updated version, which is solely focused on .NET and goes much deeper into SOS, is 172 and I’m not done with it yet!
  • The code’s getting up there in size as well. While it won’t be as big as the last version, as all the native stuff is moving, the current MSI file is 5MB. I figure it will be 8MB-10MB when finished.

One cool debugger trick is too good to make you wait for the book. Shahir Prish and I were complaining in an internal Microsoft DL (distribution list, aka mailing list) that Tracepoint macros don’t work like we wanted. If you try to call Debugger.Break to stop based on a condition, you just get a big error telling you “A macro called a debugger action which is not allowed while responding to an event or while being run because a breakpoint was hit.” That’s horrible, because I always wanted the ability to do real programmatic breakpoints. For example, if you’re working on recursive parsing code, you sometimes only want to stop if the call stack is over 1,000 items deep. Unfortunately, the debugger does not support reentrancy so calling a macro from a Tracepoint won’t work. I was about to embark on the quest to fix this, when Shahir came up with a great solution. I won’t steal Shahir’s thunder so go to his blog and you’ll see the workaround. Now you can have all the programmatic breakpoints you want!

I’m really looking forward to getting the debugger part of the book out of the way. I’ve been using the testing tools in Visual Studio .NET even more and am finding all sorts of interesting ins and outs with the. By the way, Microsoft posted some new FAQs for code coverage and the profiler that you might find interesting. The web testing portions in particular are getting a lot of my focus. It’s so much better than the Application Center Test (ACT) from previous versions of Visual Studio .NET.

While it’s taking what seems like forever, I really like how the book is coming out. I’ve been able to figure out some very cool undocumented tricks that you’ll like to use. I’m most happy with the way I’ve encapsulated many manual processes, into utilities you can pick up and use immediately to get productive. I’ve had many people ask when it will be out. The book will be done when it’s done. Trust me; I want it done more than you want to read it!

Speaking of long trips, I was in Beijing, China last week and, as always, enjoyed the city very much. It truly is the land of the construction crane. That’s mainly because all building has to be done before the end of 2007 in preparation for the 2008 Olympics. On this trip I took some time to visit the China People’s Revolution Military Museum. Being a former member of the US military, I am interested in seeing how others display their history so I can see conflicts and issues of the past from both sides. There were many interesting displays on the Long March, which is hugely important to modern Chinese history. However, I could see the political officers were in charge of the displays, as there seemed to be quite a few brushes on display with the titles like: “A brush used by the officers to paint slogans.” It doesn’t matter whose army it is, the political officers always have to get their due.

The main reason I went to the Military Museum is that I wanted to learn about the Chinese view of what Americans call the Korean War. Since I’m anal-retentive, I walked through the displays in chronological order and appreciated the curators included English translations of nearly everything. When I got to the floor that discussed the Korean War it turned out to be the only room with no English translations in the whole museum! I couldn’t decide if they were afraid of offending westerners or what. They shouldn’t worry about that at all. Given the complete lack of geographical and historical knowledge of Americans in particular, it would not be a problem. As I was standing at the foot of a huge map of Korea on the floor, the only other Americans I had seen in the whole museum walked up to me and asked if I knew what this room was about. I pointed to the floor and one guy said, “Where’s that? I’ve never seen it before. It must be a province in China.”  I just walked off shaking my head.