Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Debugging With Visual Studio & OzCode

Similar presentations


Presentation on theme: "Advanced Debugging With Visual Studio & OzCode"— Presentation transcript:

1 Advanced Debugging With Visual Studio & OzCode
Omer Raviv Co-founder & CTO

2 Every minute spent in the debugger is a minute squandered. Period.
Why are we here today? Every minute spent in the debugger is a minute squandered. Period. 4/27/2019 OzCode

3 About Me Omer Raviv: Co-founder and CTO of OzCode
Senior CodeValue .NET Open-source enthusiast Passionate about developer productivity

4 A leading software company
About CodeValue A leading software company ~100 employees: more than 90 technology experts Provides high quality software development solutions Turn-Key projects Software development and consultation Tailor-made courses and training Fields of expertise include: Desktop & LOB applications Cloud Computing Advanced Mobile & Web Technologies User Experience (UX) & User Interface (UI) Application Lifecycle Management (ALM) and DevOps Embedded & IoT

5 Agenda Introduction The psychology of debugging The debugging process Debugging in VS2015 OzCode

6 About OzCode An innovative debugging extension for Visual-Studio
Simplify & visualize complex statements Compare objects and collections Search and filter collections Focus on relevant data

7 My Journey as a developer

8 The Psychology of Debugging

9 Debug like a Boss Tennis Pro!
12/1/2014

10 The Psychology of Debugging
Elizabeth Spiegel 12/1/2014

11 The Debugging Process Overview
The two most common ways of using a debugger: 1. Wasting time 2. Quality time

12 The Debugging Process Overview
Wasting time: Not knowing what your hypothesis is at any given time Getting into a rot mindlessly hitting F10 Staring blankly at the screen Praying for a miracle

13 The Debugging Process Overview
Quality time: Know exactly WHY you started the debugger Run it in your head first (rubber-ducking) Apply the Scientific Method, religiously Simplify the scenario, then write a test!

14 The Debugging Process Overview
Separate facts from interpretation Wrong interpretation leads to a dead-end Divide and conquer Trap the bug in the corner Use the right tool for the bug & the context Isolate changes - do one change at a time See its effect (fact), draw a conclusion (interpretation)

15 Sherlock Holmes’ Advice on Debugging
It is a capital mistake to theorise before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts. A Scandal in Bohemia, 1892

16 Use the right tools to decrease your Time-to-Aha factor
The bottom line Debugging is HARD. Use the right tools to decrease your Time-to-Aha factor

17 .NET Debugger Options Visual Studio
MDbg.exe - .Net Command line Debugger WinDbg + SOS.DLL|SOSEX.DLL|PSSCOR4.DLL

18 There are some moments in life…
After which, life is no longer the same! The first kiss Your wedding The first child The first time you saw OzCode

19 Visual Studio 2015 – Lambda Evaluation in Immediate Window, Watch & OzCode Custom Expression

20 Controlling the Execution Context
Using the debugger UI, you can switch between processes, threads, and stack locations Within the current context of the process and thread: Moving the instruction pointer to Skip code Re-run code Setting variable values that control the execution path Expressions in if, switch, loop conditions Using Edit & Continue – SO MUCH BETTER IN VS2015!

21 Setting New Breakpoints
Setting Breakpoints with Visual Studio 2015

22 .NET Performance & Debugging
Method Breakpoints If you type a method name (without class name) VS select all that matches .NET Performance & Debugging

23 Visual Studio 2015 – Profiling While Debugging
In VS 2015 – Performance Data “in your face” Performance tips Performance graphs

24 Let the Magic Begin

25 Tracing with Tracepoints
Can print out any expression by surrounding with {} property/field/method call Special code can be used: Tracepoint variable name Meaning $ADDRESS Current instruction address $CALLER Caller name of current method $CALLSTACK The call stack at the current location $FUNCTION Current function name $PID Current process ID $PNAME Current process name $TID Current thread ID $TNAME Current thread name

26 Visual Studio Parallel Task & Parallel Stacks
View the logical call, the logical call stack and the task/thread state

27 Parallel Watch - View local variable in each thread’s context

28 Summary The debugging process .NET debuggers Controlling the debugger
The debugging loop Make it fail Make a hypothesis Collect evidence Prove or refine the hypothesis Advanced techniques and tools What’s new in Visual Studio 2015 C# debugger

29 Thanks!


Download ppt "Advanced Debugging With Visual Studio & OzCode"

Similar presentations


Ads by Google