danielmothmicrosoftcom Debugger Tips and Tricks in Visual Studio 2013 Everyone knows that debugging is twice as hard as writing a program in the first place So if youre as clever as you can be when you write it how will you ever debug it ID: 431990
Download Presentation The PPT/PDF document "Daniel Moth" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1Slide2
Daniel Moth daniel.moth@microsoft.com
Debugger
Tips and Tricks
in Visual Studio 2013Slide3
“Everyone knows that
debugging is twice as hard
as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?”
Brian Kernighan, Computer Scientist
“There has never been an unexpectedly short debugging period in the history of computers.”
Steven Levy, Computer Journalist
“As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.”
Sir Maurice Wilkes
,
Computer ScientistSlide4
3 slides of 3 new thingsDEMO (60 minutes)Optional bonus: 10 slides with 10 tips
AGENDASlide5
JMC tells the debugger to treat certain code as not yoursCode that was determined to be not your code
is hidden from Call Stack display (though it can be easily toggled)
Is omitted from stepping (and exceptions thrown/caught ) for .NET and JavaScript
Not your code is code that is.NET Optimized or has no symbols availableJavaScript Defined in the .json fileC++ Defined in .natjmc filesJust My Code – now for C++ & JavaScript
http://blogs.msdn.com/b/vcblog/archive/2013/06/26/just-my-code-for-c-in-vs-2013.aspx
http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/19/just-my-code-for-javascript-windows-store-apps-in-visual-studio-2013.aspx Slide6
Modules window – now with search
http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/20/modules-window-search-support-in-vs2013.aspx
Slide7
Must turn off Just My Code obviouslyFull instructions here
http://referencesource.microsoft.com/setup.html
.NET Framework source stepping – now works
http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx Slide8
DEMOCore Tips
Start with F11, Ctrl+F10, 6 Visualizers, DataTips (transparency
,
pinning, from comments), Func EvalCall Stack (Show External Code, Show parameter values), DebuggerNonUserCode
, Set Next Statement, Edit Value, F11,F10,Shift+F11, Step Into Specific, ReturnValueImmediate, Debugger.Break
, Tracepoint, Hit Count bp EnC (incl. 64 bit), Alt+F12, Restart, Function bp
Debug->Windows, P Watch for recursion, Call Stack async, Make Object ID, Add Watch from Watch, debugger display, autoexp.csSlide9
DEMOMulti-Threading
Full Screen config, Debug
Location toolbar, Parallel Stacks, Parallel Watch, ThreadTips
in editor margin (Shows Threads in Source), Freezing & Thawing, Flagging & Unflagging, Run Flagged Threads to Cursor, Conditional bp, Filter bp, Location bpSlide10
Async Debugging – Call Stack, Tasks
http://blogs.msdn.com/b/visualstudioalm/archive/2013/07/02/debugging-asynchronous-code-in-visual-studio-2013-tasks-window.aspx
Slide11
http://blogs.msdn.com/b/vcblog/archive/2013/07/01/improved-exception-reporting-for-c-windows-store-apps-in-visual-studio-2013.aspx
Pseudo-variables
http://msdn.microsoft.com/library/ms164891.aspx
Slide12
Format Specifiers per expression
http://
msdn.microsoft.com/library/75w45ekt.aspx
http://msdn.microsoft.com/library/e514eeby.aspx Slide13
C++ Pointers as arrays (OfferArrayExpansion)Slide14
Debug JavaScript Store Apps – now with native
http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/28/javascript-native-interop-debugging-in-visual-studio-2013.aspx
Slide15
Speed upyour C++ debugging
GPU debugging (15-minute recording of VS2012 demo)
http://channel9.msdn.com/Blogs/DanielMoth/GPU-debugging-in-Visual-Studio-2012
Slide16
Data Breakpoint (C++ only)
http://blogs.msdn.com/b/visualstudioalm/archive/2013/10/14/data-breakpoints.aspx
Slide17
natvis (for C++)
http://msdn.microsoft.com/library/jj620914.aspx
http://blogs.msdn.com/b/vcblog/archive/2013/06/28/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx
Slide18
Default Tracepoint MessageSlide19
Sound when Breakpoint HitSlide20
EXE Project to debug process at startup Slide21
DEV-B366 Wednesday 3:15pm: “Diagnosing Issues in Production Environments with Visual Studio 2013” Understanding symbols
Remote Tools for remote debugging
Debugging dumps (incl. memory)IntelliTrace for Production
Code Map (also see DEV-B373 on Thursday at 1pm for fuller Code Map coverage)DEV-B313 Thursday 10:15am: “Diagnosing Issues in Windows Phone 8.1 XAML Applications Using Visual Studio 2013” Device (Phone, Store Apps) debuggingPerformance and Diagnostics hub (CPU Usage, Memory, UI Responsiveness, Energy)Complementary Tech Ed Sessions
http://blogs.msdn.com/b/visualstudioalm/archive/tags/diagnostics/ Slide22
See Karl to signup
Tech
Ed
2014
Or email vsdr@Microsoft.com
Give Us Feedback on the Debugger/Diagnostics
Focus Group
Discuss direction & improvements
Tuesday 11:45-1:15
Hilton Room
329
Office Hours
Get
help with your debugging
Tuesday 2:00 – 5:30
Hilton Room
328Slide23
New in VS2013: JMC for C++ and JavaScript, Modules search, .NET Reference Source, JavaScript+Native
debugging, 64bit
EnC, $ReturnValue
, async debugging (Call Stack, Tasks), JSON visualizerBreakpoints: Location, Function, Tracepoints, Conditional, Hit Count, Filter, Sound, Data. Stepping: Into, Over, Out of, Into Specific, Run To CursorImmediate window, DataTips, transparency, from comments, pinning, Edit Value, Locals/Autos/Watch, Visualizers *, autoexp.cs, force func eval, Make Object ID, Pseudo-variables, Format Specifiers,
OfferArrayExpansion, natvis EnC, Set Next Statement, Show Next Statement, Call Stack tips, recursion Multi-threaded: Debug toolbars, Parallel Stacks, Parallel Watch, ThreadTips, Freezing, Flagging, Run Flagged to Cursor
_NO_DEBUG_HEAP, GPU, DefaultTracepointMessage, EXE projectSummarySlide24
Complete an evaluation and enter to win!Slide25
Evaluate this session
Scan this
QR
code
to evaluate
this
session.Slide26
Visit the Developer Platform & Tools Booth
Having a
friend
buy
your coffee?Yea, it’s kind of like that.
MSDN Subscribers get up to $150/
mo in Azure credits.
Stop by the Developer Platform and Tools
booth and
visit
the MSDN
Subscriptions station
to activate
your benefits and
receive
a gift
!
http
://
aka.ms/msdn_teched
3 Steps to New
Gear! With
Application Insights
Create a Visual Studio Online account
http://visualstudio.com
Install Application Insights Tools for Visual
Studio Online
http://aka.ms/aivsix
Come to our booth for a
t-shirt and a chance to win!
VSIP QR Tag
Contests
Visit
our booth to
join the hunt for cool prizes!Slide27
Resources
Microsoft Engineering Stories
How
Microsoft Builds Software
http://
aka.ms/EngineeringStories
Visual Studio
Industry
Partner
Program
Meet Our New Visual Studio Online Partners
or
Join Now.
http://vsipprogram.com
Visual Studio | Integrate
Create Your Own Dev Environment
http://integrate.visualstudio.com
Development tools & services
for
teams
of all sizes
http
://www.visualstudio.com Slide28
©
2014
Microsoft Corporation. All rights reserved. Microsoft, Windows,
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.