1
Tamir Dresher
Senior Software Architect
J
Debugging tricks you wish you knew
Debugging is a time-travel
2
333
• Software architect, consultant and instructor
• Software Engineering Lecturer @ Ruppin Academic Center
• Reactive Extensions in .NET (Manning)
@tamir_dresher
tamirdr@codevalue.net
http://www.TamirDresher.com.
About Me
Agenda
Breakpoints
Comparing object while debugging
Exceptions
Debugging Multithreaded Applications
Post-mortum debugging
Debugging LINQ
4
Breakpoints
5
Setting New Breakpoints
6
Method Breakpoints
If you type a method name (without class name)
VS select all that matches
7
Conditional Breakpoints
8
Conditional Breakpoints (OzCode)
9
invoice.Id915486 intinvoice.Id915486 int
Comparing Instances
10
Make object ID
The object is later available in every watch window
11
OzCode Comapre
12
Exception
13
First Chance Exceptions
Breaking when thrown
OzCode makes it easier
14
Predicting the future
Predict
15
Multithreading
16
Staying on the same thread (freezing other threads)
17
Tracepoints (VS)
a.k.a Printf(…) debugging
18
Tracepoints (OzCode)
19
Show All Instances
20
Finding Tasks Deadlocks
Debug –> windows –> Tasks
21
Post-Mortem Debugging
22
Automatic Dump Creation
To enable it, set the reg key
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsWindows Error
ReportingLocalDumps
DumpFolder – Location for the output dumps
DumpCount – Maximum amount of dumps in the folder
DumpType
1 – Mini Dump
2 – Full Dump
0 – Custom Dump
CustomDumpFlags – if DumpType is 0, set the dump options
23
Debugging using the Dump (1)
24
Debugging using the Dump (2)
25
Debugging *.exe Files
26
LINQ
27
LINQ Debugging
28
Export
29
Custom Expressions
30
Give it a try
https://github.com/oz-code/OzCodeDemo
32
Presenter contact details
t: @tamir_dresher
e: tamirdr@codevalue.net
b: TamirDresher.com
w: www.codevalue.net
manning.com/dresher
Discount code:
dreshermu32
Discount code:
CPH_50

Debugging tricks you wish you knew - Tamir Dresher

Editor's Notes

  • #4 My name is tamir dresher Im an architect from codevalue israel and a software engineering lecturer at the ruppin academic center CodeValue is a consulting company and we are also the proud development center of OzCode the amazing debugging extension for visual studio. We have a booth here at conference, so please go and check it out, youll be amazed how you lived without it. My book Rx in action is now available at Manning early access program should be published in the next few months. And that the end of my self promotion(it never hurts right?). So what are we really here for?
  • #5 Breakpoints conditional breakpoints Comparing object while debugging Object IDs OzCode Compare Exceptions Breaking on exceptions Conditional exceptions break Debugging Multithreaded Applications Freezing debugging to the current thread detecting deadlocked tasks Using tracepoints Finding an object and seeing all object of certain type while debugging Debugging LINQ Post-mortum debugging Dumps
  • #31 items.Where(i=>i.tags.Contains(“swift”)).ToList()