InfoQ

News

Historical Debugging in Visual Studio 2010

Posted by Jonathan Allen on Apr 22, 2009

Community
.NET
Topics
IDE ,
Debugging

Have you ever wanted to know what you program was doing 5 minutes ago? Ever wondered exactly what files it was opening instead of the one you wanted it to? Well Visual Studio 2010 has got you covered.

During the Lang.NET keynote (10 minute mark), Microsoft demonstrated Visual Studio 2010’s diagnostic events and historical debugging features. These features allow developers to not only see the application as it currently stands, but also the events that led up to that condition.

The diagnostic events window shows key events in an application’s run. These include exceptions, file access, and debugger events. In some ways these could have been hand-rolled using Debug.Write statements or macros on breakpoints. But with an integrated list view, this allows you to filter on the type of event or the thread the event occurred on.

While a good feature on its own, this is dwarfed by the historical debugging capabilities. When turned on, Visual Studio can capture stack frames and the variables associated with them. This allows developers to back-step through the program to find out why something happened the way it did.

In order to save this information, the state of the application is stored on disk. By default it only stores key types, but developers can set it to record literally every parameter, object, and global variable. The only thing it will not store is local variables.

For more information, also see the video discussing historical debugging on Channel 9. This feature should be included in the upcoming beta 1 release.

12 comments

Watch Thread Reply

Sounds like a very helpful feature! by Josh Grenon Posted Apr 22, 2009 7:25 AM
Re: Sounds like a very helpful feature! by Andrew Zhygmanovsky Posted Apr 22, 2009 8:28 AM
Re: Sounds like a very helpful feature! by Dan Tines Posted Apr 22, 2009 8:56 AM
Re: Sounds like a very helpful feature! by Jonathan Allen Posted Apr 22, 2009 11:12 AM
Re: Sounds like a very helpful feature! by Andrea Del Bene Posted Apr 22, 2009 9:24 AM
Re: Sounds like a very helpful feature! by Jonathan Allen Posted Apr 22, 2009 11:16 AM
Re: Sounds like a very helpful feature! by Andrea Del Bene Posted Apr 22, 2009 11:40 AM
Re: Sounds like a very helpful feature! by Dan Tines Posted Apr 22, 2009 11:42 AM
Re: Sounds like a very helpful feature! by Andrea Del Bene Posted Apr 23, 2009 4:03 AM
Re: Sounds like a very helpful feature! by Heejoon Lee Posted Apr 29, 2009 9:05 PM
It has a java counterpart by cloud jun Posted May 1, 2009 11:20 AM
Re: It has a java counterpart by Francisco Jose Peredo Noguez Posted Dec 12, 2009 9:26 PM
  1. Back to top

    Sounds like a very helpful feature!

    Apr 22, 2009 7:25 AM by Josh Grenon

    I can't believe I didn't hear about this yet. This is going to be a very useful feature for all developers of any level.

  2. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 8:28 AM by Andrew Zhygmanovsky

    objection
    as far as i can see this useful feature will be useful indeed only for rather simple products
    and now imagine how this debugger will slow some massive semi-enterprise web-solution considering that simple debugger slows them quite noticeably
    don't believe that MS will make this feature as lightweight and fast as possible for such solutions (and, you know, these are solutions that _really_ need this feature) as, for instance, log4net/log4j components or something like that

  3. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 8:56 AM by Dan Tines

    I think this is going to be great.

  4. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 9:24 AM by Andrea Del Bene

    Maybe I'm wrong but it seems to me an "anti-TDD" feature, the classic "nice" feature just to catch the attention of lazy developers.

  5. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 11:12 AM by Jonathan Allen

    Two points.

    First, this is an op-in feature. Most of the time you will have it tuned down or turned off completely.

    Secondly, it is in no way meant to replace traditional logging. It is a debugging and analysis tool, not something that should be run in production.

  6. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 11:16 AM by Jonathan Allen

    Maybe I'm wrong but it seems to me an "anti-TDD" feature, the classic "nice" feature just to catch the attention of lazy developers.


    It is important to keep in mind that debugging and testing are not the same thing. Tests are for testing, that is determining if something is broken. Debugging tools help you find out why something isn't working. As a software engineer, you need to understand how to use both.

  7. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 11:40 AM by Andrea Del Bene

    Yes, debug and TDD are two different things but I'dont' agree when youn say taht tests are only for "determining if something is broken". If a test fails it means that your code doesn't respect the expected behavior, and if you apply good TDD you know exactly where you code fails without walking through code (that is a boring and repetitive task)

    From en.wikipedia.org/wiki/Test-driven_development

    "Benefits :
    ...
    Programmers using pure TDD on new ('greenfield') projects report they only rarely feel the need to invoke a debugger."

  8. Back to top

    Re: Sounds like a very helpful feature!

    Apr 22, 2009 11:42 AM by Dan Tines

    Many teams don't subscribe to TDD. Besides, as has already been stated, tests and debugging are really orthogonal.

  9. Back to top

    Re: Sounds like a very helpful feature!

    Apr 23, 2009 4:03 AM by Andrea Del Bene

    Many teams don't subscribe to TDD.


    That's a pity :-) ...

  10. Back to top

    Re: Sounds like a very helpful feature!

    Apr 29, 2009 9:05 PM by Heejoon Lee

    Maybe I'm wrong but it seems to me an "anti-TDD" feature, the classic "nice" feature just to catch the attention of lazy developers.

    Unit tests and debugging are not same. But IMHO, people tends to make less unit tests and to do more edit-run-watch cycle, when they have good debugging tools.

  11. Back to top

    It has a java counterpart

    May 1, 2009 11:20 AM by cloud jun

    Reading this post reminds me of its java counterpart, Omniscient Debugger (www.lambdacs.com/debugger/). It is a java historical debugger that shows stacks, threads, local variables, method trace, code and even output at the same time, which at this moment, seems to be a superset of the .net historical debugger.

  12. Back to top

    Re: It has a java counterpart

    Dec 12, 2009 9:26 PM by Francisco Jose Peredo Noguez

    Yes, the java Omniscient Debugger (ODB) might be better, but unlike vs.net historical debugging, ODB seems to be a dead project: That page is from 18 February 2007. Why this feature is not included by default in Eclipse or Netbeans? (or even IntelliJ) ?

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.