SlideShare a Scribd company logo
1 of 30
DEBUGGERS
submitted by
G.DHARRINI,
YUVASHRI
2
WHAT IS A DEBUGGER?
“A software tool that is used to detect the
source of program or script errors, by
performing step-by-step execution of
application code and viewing the content of
code variables.”
-MSDN
3
DEBUGGER? (CON'T)
 A debugger is not an IDE
 Though the two can be integrated, they are separate
entities.
 A debugger loads in a program (compiled
executable, or interpreted source code) and
allows the user to trace through the execution.
 Debuggers typically can do disassembly, stack
traces, expression watches, and more.
DEBUGGING
 Debugging is a methodical process of finding
and reducing the number of bugs, or defects, in a
computer program
 An interactive debugging system provides
programmers with facilities that aid in testing and
debugging of programs
 Here we discuss
◦ Introducing important functions and capabilities
of IDS
◦ Relationship of IDS to other parts of the system
◦ The nature of the user interface for IDS
5
OTHER FORMS OF DEBUGGING
 Periodic printf/cout/print/write/etc.
 Statements with relevant information
 Assert statements
 Desk Checking
6
TYPES OF DEBUGGERS
 Two types of debuggers (really, two types
of languages)
 Interpreted language debuggers
 Compiled language debuggers
 Which do you think is easier to write?
7
DEBUGGERS FOR COMPILED LANGUAGES
 Harder to implement
 Generally, would like information about source
code (not normally included in compiled
executables)
 Work on a lower level
 Need special “debug” executables.
 More complex, and we'll focus on these.
DEBUGGING PROCESS
 Print debugging is the act of watching (live or
recorded) trace statements, or print statements, that
indicate the flow of execution of a process.
 In computers, debugging is the process of locating
and fixing or bypassing bugs (errors) in computer
program code or the engineering of a hardware
device.
 Remote debugging is the process of debugging a
program running on a system different than the
debugger.
 Post-mortem debugging is the act of debugging the
core dump of process.
DEBUGGING FUNCTIONS AND CAPABILITIES
 Debugging system should also provide functions
such as tracing and trace back
 Trace back can show the path by which the
current statement in the program was reached.
 It can also show which statements have modified
a given variable or parameter.
 The statements are displayed rather than as
hexadecimal displacements
PROGRAM-DISPLAY CAPABILITIES
 A debugger should have good program-display
capabilities.
 Program being debugged should be displayed
completely with statement numbers.
 The program may be displayed as originally written
or with macro expansion.
 Keeping track of any changes made to the programs
during the debugging session.
 Support for symbolically displaying or modifying
the contents of any of the variables and constants in
the program.
 Resume execution – after these changes
The context being used has many different effects on the
debugging interaction.
The statements are different depending on the language
Cobol - MOVE 6.5 TO X
Fortran - X = 6.5
C - X = 6.5
Examples of assignment statements
Similarly, the condition that X be unequal to Z may be
expressed as
Cobol - IF X NOT EQUAL TO Z
Fortran - IF ( X.NE.Z)
C - IF ( X <> Z)
 It is also important that a debugging system be
able to deal with optimized code. Many
optimizations like
◦ Invariant expressions can be removed from
loops
◦ Separate loops can be combined into a
single loop
◦ Redundant expression may be eliminated
◦ Elimination of unnecessary branch
instructions
RELATIONSHIP WITH OTHER PARTS OF
THE SYSTEM
 The important requirement for an interactive
debugger is that it always be available.
 Must appear as part of the run-time
environment and an integral part of the
system.
 When an error is discovered, immediate
debugging must be possible.
 The debugger must communicate and
cooperate with other operating system
components such as interactive subsystems.
 Debugging is more important at production
time than it is at application-development
time.
 When an application fails during a production
run, work dependent on that application stops.
 The debugger must also exist in a way that is
consistent with the security and integrity
components of the system.
 The debugger must coordinate its activities
with those of existing and future language
compilers and interpreters.
USER-INTERFACE CRITERIA
 Debugging systems should be simple in its
organization and familiar in its language,
closely reflect common user tasks.
 The user interaction should make use of
full-screen displays and windowing-
systems as much as possible.
 With menus and full-screen editors, the user
has far less information to enter and
remember.
USER-INTERFACE CRITERIA
 There should be complete functional
equivalence between commands and menus
– user where unable to use full-screen IDSs
may use commands.
 The command language should have a clear,
logical and simple syntax; command
formats should be as flexible as possible.
 Any good IDSs should have an on-line
HELP facility. HELP should be accessible
from any state of the debugging session.
17
FUNCTIONS OF A DEBUGGER
 Disassembly
 Execution Tracing/Stack tracing
 Symbol watches
18
DISASSEMBLY
 Most basic form of debugging
 Translating machine code into assembly
instructions that are more easily
understood by the user.
 Typically implementable as a simple lookup
table
 No higher-level information (variable
names, etc.)
 Relatively easy to implement.
19
EXECUTION TRACING
 Follows the program through the execution.
Users can step through line-by-line, or use
breakpoints.
 Typically allows for “watches” on – registers,
memory locations, symbols
 Allows for tracing up the stack of runtime
errors (back traces)
 Allows user to trace the causes of
unexpected behavior and fix them
20
SYMBOL INFORMATION
 Problem – a compiler/assembler translates
variable names and other symbols into
internally consistent memory addresses
 How does a debugger know which location is
denoted by a particular symbol?
 We need a “debug” executable.
BASIC DEBUGGER DIVISION
Host debugger
Provides user
interface
Provides lookup of
debug information
Communicates with
target
Target Debug
Monitor
In control of the
target
When program
being debugged
stops, control is
given to the debug
monitor
JTAG DEBUGGING
Host debugger
Provides user
interface
Provides lookup of
debug information
Communicates with
target
Target
Program in
control – no
debug
monitor
present
JTAG
Probe
JTAG PROBE
 Provides direct access to the registers and
memory of the target through the hardware.
May be “smart enough” to know about cache.
 Using JTAG means program being debugged
runs more normally – no debug monitor.
EMBEDDED DEBUGGING
Properties of a debugging environment:
1. Run Control of the target
- Start and stop the program execution
2. Ability to change code and data on target
- Fix errors, test alternatives
3. Real-Time Monitoring of target execution
- Non-intrusive in terms of performance
4. Timing and Functional Accuracy
- Debugged system should act like the real system
HOST DEBUGGER COMPONENTS
Debugger FunctionsUICC
Expression
Evaluation
Debug Info Context
Breakpoints
Execution
Control
Symbol
Table
Target T.I.P.
Host-Target
Protocol
Run
Time
Msg.
Utilities
Debugger
Types
Seq.
Interface
HOST-BASED DEBUGGING
- Compile C to your laptop, not the microcontroller
Compile and debug your program on the host system not target
Advantages:
1.Can use a debugging environment
2.Easy to try it, not much setup (register names, etc)
Disadvantages:
1.Timing is way off
2.Peripherals will not work, need to simulate them
3.Interrupts probably implemented differently
4.Different data sizes and “endian”ness
27
DEBUG VS. RELEASE BUILDS
 Debug builds usually are not optimized
 Debug executables contain:
 program's symbol tables
 location of the source file
 line number tags for assembly instuctions.
28
PROS OF A DEBUGGER:-
 No need for precognition of what the error
might be.
 Flexible
 Allows for “live” error checking – no need to
re-write and re-compile when you realize a
certain type of error may be occuring
 Dynamic
 Can view the entire relevant scope
29
CONS OF A DEBUGGER :-
 With simple errors, may not want to bother
with starting up the debugger environment.
 Obvious error
 Simple to check using prints/asserts
 Hard-to-use debugger environment
 Error occurs in optimized code
 Changes execution of program (error
doesn’t occur while running debugger)
THANK YOU

More Related Content

What's hot (20)

Classification of debuggers sp
Classification of debuggers spClassification of debuggers sp
Classification of debuggers sp
 
Ic lecture8
Ic lecture8 Ic lecture8
Ic lecture8
 
Compilation v. interpretation
Compilation v. interpretationCompilation v. interpretation
Compilation v. interpretation
 
Debugging with NetBeans IDE
Debugging with NetBeans IDEDebugging with NetBeans IDE
Debugging with NetBeans IDE
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Computer programming
Computer programmingComputer programming
Computer programming
 
The Programming Process
The Programming ProcessThe Programming Process
The Programming Process
 
Computer programming project 15sec
Computer programming project 15secComputer programming project 15sec
Computer programming project 15sec
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Language translator
Language translatorLanguage translator
Language translator
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
N-version programming
N-version programmingN-version programming
N-version programming
 
Software tools
Software toolsSoftware tools
Software tools
 
Compiler.design.in.c.docs
Compiler.design.in.c.docsCompiler.design.in.c.docs
Compiler.design.in.c.docs
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Cd econtent link1
Cd econtent link1Cd econtent link1
Cd econtent link1
 
Interpreted and compiled language
Interpreted and compiled languageInterpreted and compiled language
Interpreted and compiled language
 
Compilers
CompilersCompilers
Compilers
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 

Similar to Ss debuggers

How to debugging
How to debuggingHow to debugging
How to debuggingSiya Lee
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptxDivyaKS12
 
Reverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsReverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsEran Goldstein
 
Binary obfuscation using signals
Binary obfuscation using signalsBinary obfuscation using signals
Binary obfuscation using signalsUltraUploader
 
Software Reverse Engineering in a Security Context
Software Reverse Engineering in a Security ContextSoftware Reverse Engineering in a Security Context
Software Reverse Engineering in a Security ContextLokendra Rawat
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementationghayour abbas
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementationghayour abbas
 
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
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmerLeylimYaln
 
Lecture 11 understanding requirements (3)
Lecture 11   understanding requirements (3)Lecture 11   understanding requirements (3)
Lecture 11 understanding requirements (3)IIUI
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5Alok Jain
 
Jeremiah Yancy | Skills and techniques of the Systems Analyst
Jeremiah Yancy | Skills and techniques of the Systems AnalystJeremiah Yancy | Skills and techniques of the Systems Analyst
Jeremiah Yancy | Skills and techniques of the Systems AnalystJeremiah Yancy
 
Software engineering introduction
Software engineering introductionSoftware engineering introduction
Software engineering introductionVishal Singh
 

Similar to Ss debuggers (20)

How to debugging
How to debuggingHow to debugging
How to debugging
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
Reverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsReverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentals
 
Binary obfuscation using signals
Binary obfuscation using signalsBinary obfuscation using signals
Binary obfuscation using signals
 
Software Reverse Engineering in a Security Context
Software Reverse Engineering in a Security ContextSoftware Reverse Engineering in a Security Context
Software Reverse Engineering in a Security Context
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementation
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
 
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
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
 
Debbuging
DebbugingDebbuging
Debbuging
 
PROBLEM SOLVING
PROBLEM SOLVINGPROBLEM SOLVING
PROBLEM SOLVING
 
Lecture 11 understanding requirements (3)
Lecture 11   understanding requirements (3)Lecture 11   understanding requirements (3)
Lecture 11 understanding requirements (3)
 
Debug tool
Debug toolDebug tool
Debug tool
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5
 
Jeremiah Yancy | Skills and techniques of the Systems Analyst
Jeremiah Yancy | Skills and techniques of the Systems AnalystJeremiah Yancy | Skills and techniques of the Systems Analyst
Jeremiah Yancy | Skills and techniques of the Systems Analyst
 
Software engineering introduction
Software engineering introductionSoftware engineering introduction
Software engineering introduction
 
Coding
CodingCoding
Coding
 
Sepm t1
Sepm t1Sepm t1
Sepm t1
 
main
mainmain
main
 

Recently uploaded

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Recently uploaded (20)

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

Ss debuggers

  • 2. 2 WHAT IS A DEBUGGER? “A software tool that is used to detect the source of program or script errors, by performing step-by-step execution of application code and viewing the content of code variables.” -MSDN
  • 3. 3 DEBUGGER? (CON'T)  A debugger is not an IDE  Though the two can be integrated, they are separate entities.  A debugger loads in a program (compiled executable, or interpreted source code) and allows the user to trace through the execution.  Debuggers typically can do disassembly, stack traces, expression watches, and more.
  • 4. DEBUGGING  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program  An interactive debugging system provides programmers with facilities that aid in testing and debugging of programs  Here we discuss ◦ Introducing important functions and capabilities of IDS ◦ Relationship of IDS to other parts of the system ◦ The nature of the user interface for IDS
  • 5. 5 OTHER FORMS OF DEBUGGING  Periodic printf/cout/print/write/etc.  Statements with relevant information  Assert statements  Desk Checking
  • 6. 6 TYPES OF DEBUGGERS  Two types of debuggers (really, two types of languages)  Interpreted language debuggers  Compiled language debuggers  Which do you think is easier to write?
  • 7. 7 DEBUGGERS FOR COMPILED LANGUAGES  Harder to implement  Generally, would like information about source code (not normally included in compiled executables)  Work on a lower level  Need special “debug” executables.  More complex, and we'll focus on these.
  • 8. DEBUGGING PROCESS  Print debugging is the act of watching (live or recorded) trace statements, or print statements, that indicate the flow of execution of a process.  In computers, debugging is the process of locating and fixing or bypassing bugs (errors) in computer program code or the engineering of a hardware device.  Remote debugging is the process of debugging a program running on a system different than the debugger.  Post-mortem debugging is the act of debugging the core dump of process.
  • 9. DEBUGGING FUNCTIONS AND CAPABILITIES  Debugging system should also provide functions such as tracing and trace back  Trace back can show the path by which the current statement in the program was reached.  It can also show which statements have modified a given variable or parameter.  The statements are displayed rather than as hexadecimal displacements
  • 10. PROGRAM-DISPLAY CAPABILITIES  A debugger should have good program-display capabilities.  Program being debugged should be displayed completely with statement numbers.  The program may be displayed as originally written or with macro expansion.  Keeping track of any changes made to the programs during the debugging session.  Support for symbolically displaying or modifying the contents of any of the variables and constants in the program.  Resume execution – after these changes
  • 11. The context being used has many different effects on the debugging interaction. The statements are different depending on the language Cobol - MOVE 6.5 TO X Fortran - X = 6.5 C - X = 6.5 Examples of assignment statements Similarly, the condition that X be unequal to Z may be expressed as Cobol - IF X NOT EQUAL TO Z Fortran - IF ( X.NE.Z) C - IF ( X <> Z)
  • 12.  It is also important that a debugging system be able to deal with optimized code. Many optimizations like ◦ Invariant expressions can be removed from loops ◦ Separate loops can be combined into a single loop ◦ Redundant expression may be eliminated ◦ Elimination of unnecessary branch instructions
  • 13. RELATIONSHIP WITH OTHER PARTS OF THE SYSTEM  The important requirement for an interactive debugger is that it always be available.  Must appear as part of the run-time environment and an integral part of the system.  When an error is discovered, immediate debugging must be possible.  The debugger must communicate and cooperate with other operating system components such as interactive subsystems.
  • 14.  Debugging is more important at production time than it is at application-development time.  When an application fails during a production run, work dependent on that application stops.  The debugger must also exist in a way that is consistent with the security and integrity components of the system.  The debugger must coordinate its activities with those of existing and future language compilers and interpreters.
  • 15. USER-INTERFACE CRITERIA  Debugging systems should be simple in its organization and familiar in its language, closely reflect common user tasks.  The user interaction should make use of full-screen displays and windowing- systems as much as possible.  With menus and full-screen editors, the user has far less information to enter and remember.
  • 16. USER-INTERFACE CRITERIA  There should be complete functional equivalence between commands and menus – user where unable to use full-screen IDSs may use commands.  The command language should have a clear, logical and simple syntax; command formats should be as flexible as possible.  Any good IDSs should have an on-line HELP facility. HELP should be accessible from any state of the debugging session.
  • 17. 17 FUNCTIONS OF A DEBUGGER  Disassembly  Execution Tracing/Stack tracing  Symbol watches
  • 18. 18 DISASSEMBLY  Most basic form of debugging  Translating machine code into assembly instructions that are more easily understood by the user.  Typically implementable as a simple lookup table  No higher-level information (variable names, etc.)  Relatively easy to implement.
  • 19. 19 EXECUTION TRACING  Follows the program through the execution. Users can step through line-by-line, or use breakpoints.  Typically allows for “watches” on – registers, memory locations, symbols  Allows for tracing up the stack of runtime errors (back traces)  Allows user to trace the causes of unexpected behavior and fix them
  • 20. 20 SYMBOL INFORMATION  Problem – a compiler/assembler translates variable names and other symbols into internally consistent memory addresses  How does a debugger know which location is denoted by a particular symbol?  We need a “debug” executable.
  • 21. BASIC DEBUGGER DIVISION Host debugger Provides user interface Provides lookup of debug information Communicates with target Target Debug Monitor In control of the target When program being debugged stops, control is given to the debug monitor
  • 22. JTAG DEBUGGING Host debugger Provides user interface Provides lookup of debug information Communicates with target Target Program in control – no debug monitor present JTAG Probe
  • 23. JTAG PROBE  Provides direct access to the registers and memory of the target through the hardware. May be “smart enough” to know about cache.  Using JTAG means program being debugged runs more normally – no debug monitor.
  • 24. EMBEDDED DEBUGGING Properties of a debugging environment: 1. Run Control of the target - Start and stop the program execution 2. Ability to change code and data on target - Fix errors, test alternatives 3. Real-Time Monitoring of target execution - Non-intrusive in terms of performance 4. Timing and Functional Accuracy - Debugged system should act like the real system
  • 25. HOST DEBUGGER COMPONENTS Debugger FunctionsUICC Expression Evaluation Debug Info Context Breakpoints Execution Control Symbol Table Target T.I.P. Host-Target Protocol Run Time Msg. Utilities Debugger Types Seq. Interface
  • 26. HOST-BASED DEBUGGING - Compile C to your laptop, not the microcontroller Compile and debug your program on the host system not target Advantages: 1.Can use a debugging environment 2.Easy to try it, not much setup (register names, etc) Disadvantages: 1.Timing is way off 2.Peripherals will not work, need to simulate them 3.Interrupts probably implemented differently 4.Different data sizes and “endian”ness
  • 27. 27 DEBUG VS. RELEASE BUILDS  Debug builds usually are not optimized  Debug executables contain:  program's symbol tables  location of the source file  line number tags for assembly instuctions.
  • 28. 28 PROS OF A DEBUGGER:-  No need for precognition of what the error might be.  Flexible  Allows for “live” error checking – no need to re-write and re-compile when you realize a certain type of error may be occuring  Dynamic  Can view the entire relevant scope
  • 29. 29 CONS OF A DEBUGGER :-  With simple errors, may not want to bother with starting up the debugger environment.  Obvious error  Simple to check using prints/asserts  Hard-to-use debugger environment  Error occurs in optimized code  Changes execution of program (error doesn’t occur while running debugger)