1
Tamir DresherSenior Software ArchitectJ
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)
@[email protected]://www.TamirDresher.com.
About Me
Agenda
BreakpointsComparing object while debuggingExceptionsDebugging Multithreaded ApplicationsPost-mortum debuggingDebugging 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.Id 915486 intinvoice.Id 915486 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
23
Automatic Dump Creation
To enable it, set the reg key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
DumpFolder – Location for the output dumpsDumpCount – Maximum amount of dumps in the folderDumpType
1 – Mini Dump2 – Full Dump0 – Custom Dump
CustomDumpFlags – if DumpType is 0, set the dump options
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
32 32
Presenter contact detailst: @tamir_dreshere: [email protected]: TamirDresher.comw: www.codevalue.net
manning.com/dresherDiscount code: dreshermu
Discount code: CPH_50