1 / 33

DEV354 Visual Studio 2005: New Enhancements For Debugging Applications

DEV354 Visual Studio 2005: New Enhancements For Debugging Applications . Habib Heydarian (habibh) Scott Nonnenberg (scottno) Program Managers Microsoft Corporation. What We’ve Heard…. It’s difficult to view data Too many windows Hard to find the data I want.

zubeda
Télécharger la présentation

DEV354 Visual Studio 2005: New Enhancements For Debugging Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DEV354Visual Studio 2005: New Enhancements For Debugging Applications Habib Heydarian (habibh) Scott Nonnenberg (scottno) Program Managers Microsoft Corporation

  2. What We’ve Heard… • It’s difficult to view data • Too many windows • Hard to find the data I want I don’t know what my code is doing Multi-threaded debugging is hard I need to debug XSL Transforms

  3. “Too Many Windows”

  4. Visual Studio 2002/2003 • Many windows to look at data • Autos • Locals • Watch • QuickWatch • Etc.

  5. DataTips In 2002/2003 • DataTips are great but not enough: • Good for viewing simple data • Not good for complex objects • Have to switch to other windows to view complex objects

  6. DataTips In 2005 • The all-in-one debugging tool! • Code in the editor, debug in the editor

  7. DataTips Scott NonnenbergProgram Manager Visual C#

  8. “It’s Hard To Find The Data I Want”

  9. Viewing Data In 2002/2003 • Challenge: • Properties versus fields? • Static members versus non-static members?

  10. Viewing Data Scott NonnenbergProgram Manager Visual C#

  11. Screen Real Estate • Duplicate information Useful information! • In 2002 and 2003 • Use mcee_cs.dat • In VS 2005 • Use attributes to customize the debugger [assembly: DebuggerDisplay ( "File={_fileName} Pos={_pos}", Target=typeof(System.IO.FileStream) )] <System.IO.FileStream>=File=<_fileName> Pos=<_pos>

  12. Too Much Information • Internal implementation may not be useful when debugging • In Visual Studio 2003: Special case • ArrayList, Hashtable • In Visual Studio 2005 • Use attributes to customize the debugger • Default views for most collections • Extensible

  13. Hierarchical View Not Enough • Data windows only show hierarchical view • Not ideal for viewing some types • DataSet • Image • XML • In Visual Studio 2005 • Debugger Visualizers to the rescue!

  14. Making Data Easier To View Scott NonnenbergProgram Manager Visual C#

  15. “I Don’t Know What My Code Is Doing”

  16. Tracepoints • Breakpoints and Tracing rolled into one • Trace + Breakpoint = Tracepoint • Instrument your application without changing code • When a Tracepoint is hit, you can • Print a message • Message goes to the Output Window • Run a Visual Studio macro • Same familiar interface as a breakpoint

  17. Tracepoints Scott NonnenbergProgram Manager Visual C#

  18. TracepointsMessage Syntax • Any string “Hello World” Any valid expression {firstName} Predefined messages like $FUNC, $TID “{$FUNC}” Any combination of the above “ID = {this.ID} in function {$FUNC}”

  19. “Multi-Threaded Debugging Is Hard”

  20. Breakpoint Filters • Advanced feature for debugging • Distributed applications • Multi-process applications • Multi-threaded applications • Filter breakpoints by • Process ID or name • Thread ID or name • Machine name

  21. Multi-Threaded Debugging Scott NonnenbergProgram Manager Visual C#

  22. “I Need To Debug XSL Transforms”

  23. Debugging XSL Transforms • You can now debug XSL Transformations inside Visual Studio • Two ways to do this: • Debug a standalone XSLT document • Use XML->Debug XSL to start the debugger • Debug an XSLT document loaded by an app • Step Into XSLTProcessor.Execute() • Use normal debugger functionality, e.g., Watch, Stepping, etc.

  24. Debugging XSL Transforms Scott NonnenbergProgram Manager Visual C#

  25. Developer Centers on MSDN http://msdn.microsoft.com/vcsharp http://msdn.microsoft.com/vbasic http://msdn.microsoft.com/visualc http://msdn.microsoft.com/vjsharp Debugger Team Blogs http://blogs.msdn.com/scottno http://msdn.microsoft.com/vcsharp/team/blogs/#debugger

  26. Please fill out a session evaluation on CommNet Q1: Overall satisfaction with the session Q2: Usefulness of the information Q3: Presenter’s knowledge of the subject Q4: Presenter’s presentation skills Q5: Effectiveness of the presentation

  27. Questions?

  28. © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

  29. Reference Slides

  30. DataTipsNavigation • Via mouse • Display DataTip: move mouse over variable • Expand item: move mouse over ‘+’ (don’t need to click) • Collapse item: click mouse over ‘-’ OR move mouse off current expansion • Via keyboard • Expand item: → • Collapse item: ← • Move up/down: ↑↓

  31. DataTipsScrolling • Vertical scroll bar appears if > 15 items in DataTip • Via Mouse • Single-click on arrow to scroll up/down • Use mouse wheel to scroll up/down • Hover mouse over arrow to auto-scroll • Via Keyboard • Page Up/Page Down to scroll 15 items at a time • Up Arrow, Down Arrow to scroll 1 item at a time

  32. DataTipsEditing • To go into edit mode: • Single-click on variable name or value OR • Right-click item and select “Edit Value” from shortcut menu • Press ENTER to apply edit and exit edit mode • Press ESC to undo edit and exit edit mode • Other debugger windows are updated with new value

  33. DataTipsTips and Tricks • See your code underneath a DataTip • Press CTRL to make a DataTip temporarily transparent! • Add a variable in a DataTip to the Watch window • Right-click variable and select “Add Watch”

More Related