Now that Beta1 is out, I'd like to draw attention to the little known new debugger feature called tracepoints.  What are tracepoints you ask?  Well tracepoints are a cure for a couple of things I found myself doing countless times while tracking down nasty bugs:

  • Stopping the program to inspect something at a breakpoint meant no-repro of the bug, so I ended up smattering trace statements throughout the code.  Not very helpful when debugging a deployed program with no way to update the binary however.
  • Sitting at breakpoints copying down information onto yellow stickys or notebooks as I hit the breakpoint 50 or more times.  Joyous.  Or worse still, copying down callstacks when you get to ::AddRef and ::Release.  Extra joy.

      Tracepoints are an attempt to overcome this situation by allowing a breakpoint to log information to the debug output window and continue, without pausing at the UI.  Originally I tried to do this with macros, but found it was too expensive

      To set a tracepoint, first set a breakpoint in code.  Then use the context menu on the breakpoint and select the “When Hit...” menu item. 

      You can now add log statements for the breakpoint like “now I'm here”, and switch off the default “Stop” action, so that you “log and go”. 

      As you can see there is a host of other info you can add to the log string, including static information about the location of the bp, such as file, line, function and address.  You can also add dynamic information such as expressions, the calling function or callstack.  Things like adding thread info and process info, can help you track down timing bugs when dealing with multiple threads and/or processes.

      So you are all set.  I hope that this is a useful feature for folks, I know it has already saved me while debugging some tough problems.