SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Debugging Basics
MUHAMMAD AMIR – XAVOR LAHORE
Software Bugs r Expensive
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code
as cleverly as possible, you are, by definition, not smart enough to debug it.
Brian Kernighan
Getting Started!
 Debugging Basics: http://msdn.microsoft.com/en-us/library/aa290881%28v=vs.71%29.aspx
Debugging Basics
What are you trying to find and fix?
◦ Two main types of code errors
◦ Syntax: Compiler catches most if not all of these for you.
◦ Semantic or logical: Syntactically correct yet program may “crash and burn” at run-time!
 Autos
 Locals
 Watch
 Call Stack
 Command Window
 QuickWatch Dialog
 Breakpoints window
 Threads
 Modules
 Processes
 Memory
 Disassembly
 Registers
Debugging Tools for Inspection Your Program
Execution Control: Breakpoints
Stepping through your code
 Starting / Stopping
 Breaking
 Stepping through your
application
 (F10, F11 or Toolbar buttons)
 Run to a specific location
 Run To Cursor (right-click menu)
Situations under which breakpoints
are not feasible
 Timing sensitive issues
 Breakpoint triggers too often
 Live Debug not possible
 Debugging production systems
Debug Vs Release Build
 Debug:
The Debug configuration of your program is compiled with full symbolic debug information and no
optimization. Optimization complicates debugging, because the relationship between source code and
generated instructions is more complex.
 Release:
The Release configuration of your program contains no symbolic debug information and is fully
optimized. Debug information can be generated in PDB Files, depending on the compiler options that are
used. Creating PDB files can be very useful if you later have to debug your release version.
Condition on Debug
 Using If Block:
 Using Attribute:
#if DEBUG
public void SetPrivateValue(int value)
{
...
...
}
#endif
[System.Diagnostics.Conditional("DEBUG")]
public void SetPrivateValue(int value)
{
...
...
...
}
[System.Diagnostics.Conditional("DEBUG")] public void SetPrivateValue(int value) { ... }
#if DEBUG public void SetPrivateValue(int value) { ... } #endif
Condition on Debug
Using If Block:
 The code in here won't even reach the IL on release.
 So can’t verify syntax (compile time issues)
Using Attribute:
 Code will be translated to IL, but will not execute
 Good to avoid typos/syntax errors
Just-In-Time Debugging
 Just-In-Time debugging launches Visual Studio automatically when an exception or crash
occurs in an application running outside Visual Studio.
 This enables you to test your application when Visual Studio is not running and begin
debugging with Visual Studio when a problem occurs.
 See Details: http://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx
What’s New?
Browser Stack
 http://www.infoq.com/presentations/BrowserStack
 http://www.hanselman.com/blog/CrossBrowserDebuggingIntegratedIntoVisualStudioWithBro
wserStack.aspx
 Firebug and Fiedler?

Weitere ähnliche Inhalte

Was ist angesagt?

Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6helpido9
 
Basic Flowcharting
Basic FlowchartingBasic Flowcharting
Basic Flowchartingsebrown
 
VivaMP, system of detecting errors in the code of parallel C++ programs using...
VivaMP, system of detecting errors in the code of parallel C++ programs using...VivaMP, system of detecting errors in the code of parallel C++ programs using...
VivaMP, system of detecting errors in the code of parallel C++ programs using...PVS-Studio
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6solutionjug4
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableAnjali Technosoft
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codeAlgorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codehamza javed
 
Software develop....
Software develop.... Software develop....
Software develop.... GCWUS
 
What's the Difference Between Static Analysis and Compiler Warnings?
What's the Difference Between Static Analysis and Compiler Warnings?What's the Difference Between Static Analysis and Compiler Warnings?
What's the Difference Between Static Analysis and Compiler Warnings?Andrey Karpov
 
Module-4_WTA_PHP Class & Error Handling
Module-4_WTA_PHP Class & Error HandlingModule-4_WTA_PHP Class & Error Handling
Module-4_WTA_PHP Class & Error HandlingSIVAKUMAR V
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSabik T S
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
High productivity development with Eclipse and Java 8
High productivity development with Eclipse and Java 8High productivity development with Eclipse and Java 8
High productivity development with Eclipse and Java 8Noopur Gupta
 
Algorithm & flowchart
Algorithm & flowchartAlgorithm & flowchart
Algorithm & flowchartsaurabh sen sky
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithmsStudent
 

Was ist angesagt? (18)

Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
Basic Flowcharting
Basic FlowchartingBasic Flowcharting
Basic Flowcharting
 
VivaMP, system of detecting errors in the code of parallel C++ programs using...
VivaMP, system of detecting errors in the code of parallel C++ programs using...VivaMP, system of detecting errors in the code of parallel C++ programs using...
VivaMP, system of detecting errors in the code of parallel C++ programs using...
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
 
Quiz5
Quiz5Quiz5
Quiz5
 
Interactive debugging system
Interactive debugging systemInteractive debugging system
Interactive debugging system
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codeAlgorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
 
Software develop....
Software develop.... Software develop....
Software develop....
 
Grade 10 flowcharting
Grade 10  flowchartingGrade 10  flowcharting
Grade 10 flowcharting
 
What's the Difference Between Static Analysis and Compiler Warnings?
What's the Difference Between Static Analysis and Compiler Warnings?What's the Difference Between Static Analysis and Compiler Warnings?
What's the Difference Between Static Analysis and Compiler Warnings?
 
Module-4_WTA_PHP Class & Error Handling
Module-4_WTA_PHP Class & Error HandlingModule-4_WTA_PHP Class & Error Handling
Module-4_WTA_PHP Class & Error Handling
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Software Quality Engineering
Software Quality EngineeringSoftware Quality Engineering
Software Quality Engineering
 
High productivity development with Eclipse and Java 8
High productivity development with Eclipse and Java 8High productivity development with Eclipse and Java 8
High productivity development with Eclipse and Java 8
 
Algorithm & flowchart
Algorithm & flowchartAlgorithm & flowchart
Algorithm & flowchart
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 

Andere mochten auch

Vb.net session 12
Vb.net session 12Vb.net session 12
Vb.net session 12Niit Care
 
Exception handling in asp.net
Exception handling in asp.netException handling in asp.net
Exception handling in asp.netNeelesh Shukla
 
Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.netNgeam Soly
 
Exception Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLRException Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLRKiran Munir
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...
EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...
EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...IAEME Publication
 
Data Structure In C#
Data Structure In C#Data Structure In C#
Data Structure In C#Shahzad
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
PPT on break even analysis
PPT on break even analysisPPT on break even analysis
PPT on break even analysisITC Limited
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 

Andere mochten auch (17)

C sharp chap5
C sharp chap5C sharp chap5
C sharp chap5
 
Vb.net session 12
Vb.net session 12Vb.net session 12
Vb.net session 12
 
Exception handling in asp.net
Exception handling in asp.netException handling in asp.net
Exception handling in asp.net
 
Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.net
 
Exception Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLRException Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLR
 
Ado.net
Ado.netAdo.net
Ado.net
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
Ado.net
Ado.netAdo.net
Ado.net
 
EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...
EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...
EVALUATION OF PROCESSES PARAMETER AND MECHANICAL PROPERTIES IN FRICTION STIR ...
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 
Data Structure In C#
Data Structure In C#Data Structure In C#
Data Structure In C#
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
PPT on break even analysis
PPT on break even analysisPPT on break even analysis
PPT on break even analysis
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 

Ähnlich wie Debugging in .Net

.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and TechniquesBala Subra
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging TechniquesBala Subra
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmerLeylimYaln
 
debugging (1).ppt
debugging (1).pptdebugging (1).ppt
debugging (1).pptjerlinS1
 
An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...jeyasrig
 
How to debugging
How to debuggingHow to debugging
How to debuggingSiya Lee
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyBrian Lyttle
 
UNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptUNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptManjuAppukuttan2
 
Reverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsReverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsEran Goldstein
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdfDifferent Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdfpCloudy
 
TSC Summit #3 - Reverse engineering and anti debugging techniques
TSC Summit #3 - Reverse engineering and anti debugging techniquesTSC Summit #3 - Reverse engineering and anti debugging techniques
TSC Summit #3 - Reverse engineering and anti debugging techniquesMikal Villa
 
Compilers programmingembedded
Compilers programmingembeddedCompilers programmingembedded
Compilers programmingembeddedManish Pandey
 
Qualidade de Software em zOS usando IBM Debug Tool e RDz
Qualidade de Software em zOS usando IBM Debug Tool e RDzQualidade de Software em zOS usando IBM Debug Tool e RDz
Qualidade de Software em zOS usando IBM Debug Tool e RDzPaulo Batuta
 
Reversing and Patching Machine Code
Reversing and Patching Machine CodeReversing and Patching Machine Code
Reversing and Patching Machine CodeTeodoro Cipresso
 

Ähnlich wie Debugging in .Net (20)

.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
 
debugging (1).ppt
debugging (1).pptdebugging (1).ppt
debugging (1).ppt
 
An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...An important characteristic of a test suite that is computed by a dynamic ana...
An important characteristic of a test suite that is computed by a dynamic ana...
 
Intro To AOP
Intro To AOPIntro To AOP
Intro To AOP
 
How to debugging
How to debuggingHow to debugging
How to debugging
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
 
UNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.pptUNIT 3.1 INTRODUCTON TO IDA.ppt
UNIT 3.1 INTRODUCTON TO IDA.ppt
 
ID E's features
ID E's featuresID E's features
ID E's features
 
Reverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsReverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentals
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdfDifferent Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
 
TSC Summit #3 - Reverse engineering and anti debugging techniques
TSC Summit #3 - Reverse engineering and anti debugging techniquesTSC Summit #3 - Reverse engineering and anti debugging techniques
TSC Summit #3 - Reverse engineering and anti debugging techniques
 
Compilers programmingembedded
Compilers programmingembeddedCompilers programmingembedded
Compilers programmingembedded
 
Types of errors 2019
Types of errors 2019Types of errors 2019
Types of errors 2019
 
Intro1
Intro1Intro1
Intro1
 
6-Error Handling.pptx
6-Error Handling.pptx6-Error Handling.pptx
6-Error Handling.pptx
 
Qualidade de Software em zOS usando IBM Debug Tool e RDz
Qualidade de Software em zOS usando IBM Debug Tool e RDzQualidade de Software em zOS usando IBM Debug Tool e RDz
Qualidade de Software em zOS usando IBM Debug Tool e RDz
 
Reversing and Patching Machine Code
Reversing and Patching Machine CodeReversing and Patching Machine Code
Reversing and Patching Machine Code
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Kürzlich hochgeladen (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Debugging in .Net

  • 2. Software Bugs r Expensive Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. Brian Kernighan
  • 3. Getting Started!  Debugging Basics: http://msdn.microsoft.com/en-us/library/aa290881%28v=vs.71%29.aspx
  • 4. Debugging Basics What are you trying to find and fix? ◦ Two main types of code errors ◦ Syntax: Compiler catches most if not all of these for you. ◦ Semantic or logical: Syntactically correct yet program may “crash and burn” at run-time!  Autos  Locals  Watch  Call Stack  Command Window  QuickWatch Dialog  Breakpoints window  Threads  Modules  Processes  Memory  Disassembly  Registers Debugging Tools for Inspection Your Program
  • 5. Execution Control: Breakpoints Stepping through your code  Starting / Stopping  Breaking  Stepping through your application  (F10, F11 or Toolbar buttons)  Run to a specific location  Run To Cursor (right-click menu) Situations under which breakpoints are not feasible  Timing sensitive issues  Breakpoint triggers too often  Live Debug not possible  Debugging production systems
  • 6. Debug Vs Release Build  Debug: The Debug configuration of your program is compiled with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex.  Release: The Release configuration of your program contains no symbolic debug information and is fully optimized. Debug information can be generated in PDB Files, depending on the compiler options that are used. Creating PDB files can be very useful if you later have to debug your release version.
  • 7. Condition on Debug  Using If Block:  Using Attribute: #if DEBUG public void SetPrivateValue(int value) { ... ... } #endif [System.Diagnostics.Conditional("DEBUG")] public void SetPrivateValue(int value) { ... ... ... } [System.Diagnostics.Conditional("DEBUG")] public void SetPrivateValue(int value) { ... } #if DEBUG public void SetPrivateValue(int value) { ... } #endif
  • 8. Condition on Debug Using If Block:  The code in here won't even reach the IL on release.  So can’t verify syntax (compile time issues) Using Attribute:  Code will be translated to IL, but will not execute  Good to avoid typos/syntax errors
  • 9. Just-In-Time Debugging  Just-In-Time debugging launches Visual Studio automatically when an exception or crash occurs in an application running outside Visual Studio.  This enables you to test your application when Visual Studio is not running and begin debugging with Visual Studio when a problem occurs.  See Details: http://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx
  • 10. What’s New? Browser Stack  http://www.infoq.com/presentations/BrowserStack  http://www.hanselman.com/blog/CrossBrowserDebuggingIntegratedIntoVisualStudioWithBro wserStack.aspx  Firebug and Fiedler?