Presentation is loading. Please wait.

Presentation is loading. Please wait.

John Cunningham Development Manager Microsoft DTL323.

Similar presentations


Presentation on theme: "John Cunningham Development Manager Microsoft DTL323."— Presentation transcript:

1

2 John Cunningham Development Manager Microsoft DTL323

3 Overview Tips and tricks in the following areas: Execution Control Breakpoints Symbols Multi-threaded Debugging Postmortem Debugging Data Viewing Behind the Debugger Magic

4 VS Debugger Overview Debugs many different code environments Native Windows X86 X64 IA64 Managed code Windows (32bit and 64bit) SQLCLR Script T-SQL Native device programs And many, many more…

5 VS Debugger Architecture VSDebug Package VSDebug Package SDM CPDE (Managed) NatDbgDE (Native) Your Engine Here Your Engine Here Your EE Here See resources at the end for more info on extending and customizing

6 Overview Tips and tricks in the following areas:  Execution control Breakpoints Symbols Multi-threaded Debugging Postmortem Debugging Data Viewing

7 Execution Control NEW SP1 Step Filtering for Managed Adds support for automatically stepping over simple properties Right click to “step into specific” pick step into target

8 Step Filtering

9 How it Works: Step Filtering Step in as normal If (stepcomplete outside of targetrange) { complete as a step over } Else If (step completed as a stepin) { If (current location is property || current location is operator) { Step out and try another stepin }

10 How it Works: Step into Specific Disassemble instruction range for line Populate drop down with targets User selects specific call If (stepcomplete outside of targetrange) { complete as a step over } Else If (step completed as a stepin) { If (currentframe return != target call location) { Step out and try step in again }

11 Overview Tips and tricks in the following areas: Execution Control  Breakpoints Symbols Multi-threaded Debugging Postmortem Debugging Data Viewing

12 Tracepoints Print a variety of program state types without stopping Program location, including stack Expressions (including @clk in native for quick timing) Thread info Run a macro Useful to stop on a certain condition that is difficult to express as a “watch window” expression (for example, “Stop if this method is in the callstack”)

13 Tracepoints

14 Overview Tips and tricks in the following areas: Execution Control Breakpoints  Symbols Multi-threaded Debugging Postmortem Debugging Data Viewing

15 Symbols You’ve got to hold them squeeze them never *EVER* ship without archiving them Ensure symbols are switched on in final/retail/optimized builds Archive symbols using symbol server

16 Setting Up and Using a Symbol Server Download windows debugging tools Get a file server with a big hard disk Build daily build Use SYMSTORE to push binaries and PDBs to fileshare e.g.: SYMSTORE add /r /f c:\BUILTFILES\*.* /s \\MYSERVER\SYMBOLSHARE /t “Application” /v “BuildVersion3” \\MYSERVER\SYMBOLSHARE Point Visual Studio to that share and set a local cache

17 Symbol Paths

18 Symbols NEW SP1 Reference Source Support

19 Symbols

20 VS Never loads mismatched symbols Never. Never, ever. Path plan is where the exe thinks it is on the path we create from the symbols dialog on the path at HKLM/HKCU Software\Microsoft\VisualStudio\MSPDB\SymbolSearchPath on the path at any of these _NT_ALT_SYMBOL_PATH _NT_SYMBOL_PATH SystemRoot Use Right Click on Module -> “Symbol Load Information…” to find out where we looked Symbol Loading Internals

21 Tips and tricks in the following areas: Execution Control Breakpoints Symbols  Multi-threaded Debugging Postmortem Debugging Data Viewing Overview

22 NEW Thread Categories and Flagging Threads

23

24 Using Breakpoint Filters Right-click on breakpoint, select Filter… Freezing and Thawing Right-click on thread, select Stack Tips and Thread Flags Naming Threads Managed – Thread.Name Native – Use the SetThreadName exception wrapper See resources at end of deck…

25 Tips and tricks in the following areas: Execution Control Breakpoints Symbols Multi-threaded Debugging  Postmortem Debugging Data viewing Overview

26 Post Mortem Debugging Increasingly important as Microsoft continues to invest in Windows Error Reporting ISVs can participate in WER by visiting http://winqual.microsoft.com http://winqual.microsoft.com Create an account Complete a request file mapping form Enterprise customers can use CER to keep data local and verify/analyze See resources at the end

27 Postmortem debugging

28 Postmortem – Optimized tips Take the red pill! Open the disassembly window Open the autos window to see pertinent registers Trust statics/globals and trust stacks when you have symbols You do have symbols right? Don’t necessarily trust Watch and Locals Not enough information is around for the debugger to make sense of which variable is alive

29 Tips and tricks in the following areas: Execution Control Breakpoints Symbols Multi-threaded Debugging Postmortem Debugging  Data Viewing Overview

30 Data viewing Numerous Tricks for Formatting Your Data Managed Code Watch window qualifiers Type proxies Custom visualizers Native Code Watch window qualifiers Autoexp.dat

31 Magic Watch Window Values Native - numerous magic values to help track down tricky bugs $user $CLK $env $cmdline

32 Data Viewing and Watch Magic

33 VS Debugger Resources Extending and Customizing the Debugger http://msdn.microsoft.com/en- us/library/bb161718.aspx Setting up a Symbol Server http://www.microsoft.com/whdc/devtools/debugg ing/default.mspx Using Thread Names http://blogs.msdn.com/stevejs/archive/2005/12/1 9/505815.aspx

34 VS Debugger Resources Corporate Error Reporting http://msdn.microsoft.com/en- us/library/aa939342.aspx Optimized Code Debugging Deep Dive http://blogs.msdn.com/greggm/archive/2004/12/1 5/315673.aspx Debugger Visualizers http://msdn.microsoft.com/en- us/library/bb161718.aspx

35 VS Debugger Blogs http://blogs.msdn.com/ms_joc/ http://blogs.msdn.com/greggm/ http://blogs.msdn.com/jacdavis http://blogs.msdn.com/jimgries http://blogs.msdn.com/rchiodo

36

37 DTL Track Resources Visit the DPR TLC for a chance to win a copy of Visual Studio Team Suite. Daily drawing occurs every day in the TLC at 4:15pm. Stop by for a raffle ticket http://www.microsoft.com/visualstudio http://www.microsoft.com/visualstudio/en-us/products/teamsystem/default.mspx Please visit us in the TLC blue area

38 www.microsoft.com/teched Sessions On-Demand & Community http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers www.microsoft.com/learning Microsoft Certification and Training Resources www.microsoft.com/learning Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online.

39 Complete an evaluation on CommNet and enter to win! Required Slide

40 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide


Download ppt "John Cunningham Development Manager Microsoft DTL323."

Similar presentations


Ads by Google