Tuesday, July 27, 2004 6:16 PM
by
scottno
Some Responses to Debugging Requests
Philip Schlump posted the below requests in response to Eric's post soliciting feedback on “Future language features & scenarios.“ I thought I'd respond here.
1) Q: A debugging runtime that allows un-running of code. At each instruction in the code there is a “state” that would need to be saved so that when you get to a problem section you could back up to any previous “state”. Then allow for the code following that “state” to be changed and re-run.
A: We get this request quite often. It's in the back of our minds as something users would like, but the real roadblock is the immense cost to doing it. Not only would it take lots of developer time to get it implemented, but the performance impacts would be amazing(ly bad). We'll keep it on our radar, but as we go through the lists of features to put in the product, this one consistently loses the cost/benefit ratio comparison.
2) Q: A debugging tool that will allow permanent information to be attached to the code. In this fashion a customer in the field can turn-on the debugging and send back a trace file that tells of every method/function that is called and every parameter that gets called in the order that it is called.
A: Today this can be done with tracing. The Enterprise Instrumentation Framework supports this kind of thing perfectly. It is very flexible, but wouldn't support the above request natively - the instrumentation would still have to be added to code. You might also try the CLR's profiling APIs, or programs that take advantage of them - they can provide the tracking requested with even more details available.
3) Q: A decent graphical view of data structures. If it is an array with 10 items in it draw a rectangle with 10 little boxes in it. If the array then gets reallocated and grows to 20 – redraw it as a new rectangle with 20 boxes.
A: Visualizers are a great new feature in VS 2005 - they allow you to write custom WinForms applications to visualize managed types while debugging through your code. You want a view of any kind for any managed object? Write it yourself! Check out my how-to post on Visualizers. I'll have a whitepaper on MSDN soon describing the process for Beta1.
4) Q: A tool in VS.NET that shows what sections of code have been reached during testing. Combine this with the capabilities of NUnit.
A: Visual Studio Team System will provide exactly this functionality (though with a different testing framework than NUnit).