The Power point presentation I've used for my session "How to become a debugging Jedi" at 26.01.17, 19:00 in a Meetup held in Microsoft's R&D center in Nazareth, Israel.
2. 222
⢠Software engineer, consultant and code Jedi
⢠Developing Software professionally since 2013
⢠Software Craftsmanship advocate
⢠Clean Coder
@MoaidHathot
moaidh@codevalue.net
http://www.moaid.codes
About Me
3. 333
About CodeValue
A leading software company
⢠~180 employees: more than 120 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. 555
The Original Bug Report
⢠âDebugging is the process of finding and resolving bugs or defects that
prevent correct operation of computer software or a systemâ
⢠The terms "bug" and "debugging" are popularly attributed to Admiral
Grace Hopper in the 1940s
⢠However the term is much older
⢠Thomas Edison wrote the following words in a letter to an associate in 1878:
⢠âIt has been just so in all of my inventions. The first step is an intuition, and comes with a
burst, then difficulties arise â this thing gives out and [it is] then that "Bugs"
â as such little faults and difficulties are called â show themselves and months of intense
watching, study and labor are requisite before commercial success or failure is certainly
reachedâ
12. 121212
Controlling The Debugger
⢠There are 10 types of (human) debuggers:
⢠The âI am too tired to think, let the debugger lead and controlâ type
⢠The âeverything is under controlâ type
13. 131313
Rubber ducking
ďrubber duck debugging or rubber ducking is a method
of debugging code
ďThe name is a reference to a story in the book The
Pragmatic Programmer in which a programmer would
carry around a rubber duck and debug their code by
forcing themselves to explain it, line-by-line, to the duck
14. 141414
Rubber ducking
ďrubber duck debugging or rubber ducking is a method
of debugging code
ďThe name is a reference to a story in the book The
Pragmatic Programmer in which a programmer would
carry around a rubber duck and debug their code by
forcing themselves to explain it, line-by-line, to the duck
60. 606060
Dump Files
⢠A minidump is a snapshot of a process
â May be created at any time, not just when a process crashes
⢠Minidump types
â Kernel minidumps (not relevant for this course)
â Basic (usually enough for native processes)
â Full (required to get useful info for managed processes)
61. 616161
Dump Creation
⢠Minidump creation
â WinDbg
â On Vista, 2008 and up can use Task Manager
â ADPlus
â ProcDump
⢠Opening Dump files
â WinDbg
â Visual Studio 2012/2013
62. Automatic Dump Creation
To enable it, set the reg key
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsWindows Error
ReportingLocalDumps<appName>
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
62
Remember to mention the kahoot it contest at the end
Remember to ask about C# programmers, VS 2015 and VS 2017 RC
Two branches
One year for yokneam
First one Thomas Edison â hardware bugs
Popularized â Admiral Grace Hopper (Amazing Grace) when a moth caught in a relay. â this is a hardware bug
Ctrl+B
With class name
Without class name
Also for not loaded symbols
Also for assemblies that are not ours
**Canât work with async methods**
Performance.
Performance.
From MSDNâ
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681675(v=vs.85).aspx
From MSDNâ
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681675(v=vs.85).aspx
Can also be applied to an attributes
Taken from referencesource.Microsoft.com
Specially for objects that are out of scope
Also works in immediate window
From VS 2015
Immediate window is like the command Window. â>â will make it a command window.
>log /[on|off] <filename> starts printing.
>open <filename> opens files
Can also be set on the assembly level (Target property must be used)
[assembly: DebuggerDisplay("Name = {Name}; Team = {Team}; Languages = {ProgrammingLanguages}", Target = typeof(SoftwareEngineer))]
Can also be set on the assembly level (Target property must be used)
[assembly: DebuggerDisplay("Name = {Name}; Team = {Team}; Languages = {ProgrammingLanguages}", Target = typeof(SoftwareEngineer))]
Can also be set on the assembly level (Target property must be used)
[assembly: DebuggerDisplay("Name = {Name}; Team = {Team}; Languages = {ProgrammingLanguages}", Target = typeof(SoftwareEngineer))]
Also work with ToString
Use when need to fundamentally change the debugging view but not the type
Usually private internal class to access internal and private fields
Needs a constructor with original type
Performance implication
Should not has any attributes over it
Show demo of Debugger Visualizer before moving slides
Demo with Star wars pictures.
Talk about DataFlow visualizer
Demo with Star wars pictures.
Freezing other threads (good if breakpoint triggered due to multiple threads)
Renaming threads
Pause debugger
MiniDump creation:
WinDbg
TaskManager
AdPlus
ProcDump
OzCode
Opening Dump Files
WinDbg
Visual Studio
.pdb files containing debug information for your application
Debugging symbols link runtime memory addresses to function names, source file names and line numbers
Same directory as the executable
Hard coded in the executable at compile time
Symbol server cache directory
Defined symbol server(s)
Open DotPeek
Add the required assembly
Press start Symbol server
In VS add new symbol source
Collapsed is default
My name is Moaid Hathot
Iâm a software developer and a consultant at CodeValue.
CodeValue is a consulting company and we are also the proud development center of OzCode the amazing debugging extension for visual studio.
So what are we really here for?
My name is Moaid Hathot
Iâm a software developer and a consultant at CodeValue.
CodeValue is a consulting company and we are also the proud development center of OzCode the amazing debugging extension for visual studio.
So what are we really here for?