Making native array viewing easier with Enhanced DataTips
I'm back from vacation, and have a new found respect for people (mostly US wives/women, I presume) that slave all day over preparing a Thanksgiving meal and then cleaning it all up. Yep, I did the whole turkey, potatoes, yams, corn, etc. thing this year for me and my kids. By the end of the day I was completely exhausted. But it all turned out great!
Anyway onto a new debugging trick. This one is geared directly at users of native C/C++ debugger in Visual Studio 2005. It revolves around a little registry tweak you can do to make viewing arrays of objects a little easier using Enhanced DataTips if all you have is pointer to one of the items. This is not a supported behavior and cannot be adjusted outside of doing this registry change. As is per usual with any registry tweaking, please be careful -- if you mess up (significantly) you can destroy your entire OS installation.
First, shut down Visual Studio. Since VS writes a new set of option values to the registry everytime you shut it down, any changes you make to the registry prior to doing so will be lost.
Now open the registry and navigate to:
You'll see a boatload of debugger options, most of which are addressable under the Tools->Options functionality of VS. However there is one, OfferArrayExpansion, that is not exposed. Change it from 0 to 1 and reopen VS.
Now when you activate a DataTip over any pointer to any type and you expand it once, you'll see a message allowing you to expand it as an array. If you do so, you'll see the first 100 items as if the pointer was really pointing to an array of 100.