SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Real-time Debugging using
GDB Tracepoints and other
Eclipse features
GCC Summit 2010
2010-010-26
marc.khouzam@ericsson.com
© Ericsson | GCC Summit 2010
› Introduction
› Advanced debugging features
– Non-stop multi-threaded debugging
– Pretty-printing of complex structures
– Multi-process debugging
– Reverse debugging
– Multi-core debugging
› GDB Tracepoints
Summary
© Ericsson | GCC Summit 2010
› Many companies deal with embedded systems
› Linux is widely used in the embedded space
› Applications are complex and have complex interactions
› Use of different targets
– Different OS: Linux, Real-time OS, proprietary OS
– Different architectures
– Different environments: design, test, integration, live site
– Different setups : Simulator, Real hardware, Lab, JTAG
Introduction
© Ericsson | GCC Summit 2010
› Need for a debugging tool to address those situations
› Same tool for design, test, integration, live sites
› Same tool for simulator, real-target
› Same tool for different archs, OS
› Same tool for different types of users
➢GDB provides the advanced debugging features
➢Eclipse Integration provides the ease-of-use and efficiency
Introduction
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Non-Stop multi-threading
●
Debugging a process by stopping its execution might cause
the program to change its behavior drastically
●
Some threads should not be interrupted for proper program execution
●
Heartbeat threads
●
Monitoring threads
●
Server threads
●
Non-stop allows to stop and examine a subset of threads, while
other threads continue to run freely.
© Ericsson | GCC Summit 2010
Non-Stop multi-threading
●
Allows to individually control treads
●
Step, Resume, Suspend
Threads 3 and 4
are stopped
Threads 1 and 2
are still running
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Pretty-printing
●
Content of complex abstract data structures should be
presented to the user while keeping the abstraction.
●
Vectors
●
List
●
Maps
●
User-defined structure
●
GDB provides Python pretty-printing feature which is STL-ready
© Ericsson | GCC Summit 2010
Pretty-printing (Now)
No pretty-printing
Partial pretty-printing
© Ericsson | GCC Summit 2010
Pretty-printing (Next)
Full pretty-printing
with editable values
●
Display content in user-friendly fashion
●
Allows to modify content directly!
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Multi-process (Now)
●
Currently available for targets that have a single memory space for all processes
Multiple processes in the same
launch. They can be individually
controlled and inspected
Dynamically connect/disconnect
© Ericsson | GCC Summit 2010
Multi-process (Next)
●
Current work to bring this to Linux using GDB 7.2 for next release
Multiple processes in the same
Launch in Non-Stop mode
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Reverse debugging
●
Often, when debugging, you realize that you have gone too far
and some event of interest has already happened.
●
Restarting execution to reach that same failure can be tedious
and time consuming
●
Why not simply go backwards?
●
Undo the changes in machine state that have taken place as the program
was executing normally i.e., revert registers and memory to previous values
●
GDB provides Process Record and Replay for Linux
●
Allows to go backwards, modify memory/registers, then resume execution
on a new path!
© Ericsson | GCC Summit 2010
Reverse debugging
Buttons to control
reverse execution Toggle reverse
and display
execution buttons
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Multi-core debugging
●
As systems get more complex, so does the software running on them
●
Debugging tools must provide more information to describe
these complex systems
●
Multi-core systems are the default now
●
Troubleshooting requires having knowledge of what is running where
© Ericsson | GCC Summit 2010
Multi-core debugging
●
First step in upcoming broader multi-core debugging support
●
Indicates core information to the user
Cores are shown
for both threads
and processes
© Ericsson | GCC Summit 2010
Others
●
Any binary debugging (Now)
●
Allows to debug any binary without having to build it in Eclipse
●
Almost immediate debugging of GDB or GCC!
●
Automatic remote launching (Next)
●
Will automatically start gdbserver on your target
●
Global breakpoints (Next)
●
Allows to stop processes that don't have the debugger attached to it
●
Essential for short-lived processes
●
Essential for startup-sequence debugging on a real target
© Ericsson | GCC Summit 2010
Now
› Non-Stop multi-threading
› Partial Pretty-printing
› Single space multi-process
› Reverse
› Any binary debugging
› Tracepoints
Features
Next
› Full Pretty-printing
› Full Multi-process
› Multi-core debugging
› Global breakpoints
› Tracepoints improvements
– Fast tracepoints
– Static tracepoints
– Observer-mode
– Intelligent trace visualization
© Ericsson | GCC Summit 2010
Dynamic Tracing
› Using a debugger drastically changes execution
› In some cases, a debugger is too intrusive :
– Debugging a race condition
– Investigating user-interface issues
– Live sites
– Real-time systems
› Low-overhead tracing is the answer: LTTng, UST
› What if existing static traces don’t give info needed?
› What about systems that are not instrumented?
Eclipse's integration of GDB’s Dynamic Tracepoints
© Ericsson | GCC Summit 2010
› Creation of tracepoints is done as for breakpoints
› Enable/Disable
› Dynamic condition
› Specification of data to be gathered using symbolic
expressions and memory addresses (actions)
› Pass count
› Trace-state variables can be used in conditions and
actions
› Tracepoints are only in effect if tracing is enabled
Eclipse Tracepoints
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Selection
› Tracepoints treated as breakpoints
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Display
› Tracepoints
› Tracepoints with actions
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Disassembly
› Disassembly view support for Tracepoints
› Tracepoint with condition
© Ericsson | GCC Summit 2010
Eclispe Tracepoints Properties
› Tracepoints properties
– Location
– Enablement
– Condition
– Pass count
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Actions
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Actions
› Tracepoints action types
– Collect
– Evaluate
– While-Stepping
› Collect
› Evaluate
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Control
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Control
› Trace Control View
– Refreshing info
– Trace Variables
– Start/Stop Tracing
– Navigate during Visualization
– Stop Visualization
© Ericsson | GCC Summit 2010
Eclipse Tracepoints Variables
© Ericsson | GCC Summit 2010
Eclipse Trace Data
› Resulting trace data
– can be stored to file
– can be visualized in Eclipse immediately or in the future
© Ericsson | GCC Summit 2010
› Navigation through data records using GDB
› Each data record is a snapshot of debug information
› Records can be examined using standard debugger views
– As if debugger was attached at a specific point in time
– Only collected information can be shown
– Highlighting of the tracepoint of interest
› All collected data of a record can also be dumped as plain
text
› Trace data can be saved to file
› Saved trace data can be examined offline
Eclipse Trace Data Visualization
© Ericsson | GCC Summit 2010
Eclispe Trace Data Visualization
© Ericsson | GCC Summit 2010
Eclipse Static Tracepoints
› Next phase of development
› Using GDB and UST
› Handled like Dynamic Tracepoint, except for creation
© Ericsson | GCC Summit 2010
Eclipse Static Tracepoints
› Creation of tracepoint done by designer before compilation
› As for Dynamic tracepoints:
– Enable/Disable tracepoints dynamically
– Dynamic condition
– Can additionally have dynamic tracing specified (actions)
– Pass count
– Trace-state variables
– ...
© Ericsson | GCC Summit 2010
› Support for Fast Tracepoints
– Explicit or implicit support?
› Support for Static Tracepoints
› Support for Observer mode
› Support for Global Actions (affecting all tracepoints)
Planned Tracepoint Features
© Ericsson | GCC Summit 2010
› Disabling tracepoints during Tracing
› Tracepoints Enhanced Visualization:
– Currently the user must have an idea of what has been collected
– Goal is to directly and only show what has been collected
› Fast Tracepoints on 3-byte instruction
– Currently fast tracepoints are 5-byte jumps insert in the code
– New 3-byte jump to a nearby location to the 5-byte jump
Planned Tracepoint Features
© Ericsson | GCC Summit 2010
Getting it to work for you in five easy steps
1.Downloading Eclipse Linux Package:
•
http://eclipse.org/downloads
•
Choose: “Eclipse IDE for C/C++ Linux Developers”
2.Extract it: tar xf <packageFile>
3.Run it: cd <packageDir> ; ./eclipse
4.Create a (dummy) C/C++ project: “Hello World” is fine
5.Start debugging... GDB... GCC... etc...
© Ericsson | GCC Summit 2010
Questions?
© Ericsson | GCC Summit 2010

Weitere ähnliche Inhalte

Was ist angesagt?

High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
ScyllaDB
 

Was ist angesagt? (20)

Practical SystemTAP basics: Perl memory profiling
Practical SystemTAP basics: Perl memory profilingPractical SystemTAP basics: Perl memory profiling
Practical SystemTAP basics: Perl memory profiling
 
QNIBTerminal: Understand your datacenter by overlaying multiple information l...
QNIBTerminal: Understand your datacenter by overlaying multiple information l...QNIBTerminal: Understand your datacenter by overlaying multiple information l...
QNIBTerminal: Understand your datacenter by overlaying multiple information l...
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
BKK16-203 Irq prediction or how to better estimate idle time
BKK16-203 Irq prediction or how to better estimate idle timeBKK16-203 Irq prediction or how to better estimate idle time
BKK16-203 Irq prediction or how to better estimate idle time
 
Optimizing Java Notes
Optimizing Java NotesOptimizing Java Notes
Optimizing Java Notes
 
BKK16-306 ART ii
BKK16-306 ART iiBKK16-306 ART ii
BKK16-306 ART ii
 
LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...LCA14: LCA14-403: Importance of migrating external projects used in Android t...
LCA14: LCA14-403: Importance of migrating external projects used in Android t...
 
LAS16-307: Benchmarking Schedutil in Android
LAS16-307: Benchmarking Schedutil in AndroidLAS16-307: Benchmarking Schedutil in Android
LAS16-307: Benchmarking Schedutil in Android
 
JCConf 2020 - New Java Features Released in 2020
JCConf 2020 - New Java Features Released in 2020JCConf 2020 - New Java Features Released in 2020
JCConf 2020 - New Java Features Released in 2020
 
Rust Is Safe. But Is It Fast?
Rust Is Safe. But Is It Fast?Rust Is Safe. But Is It Fast?
Rust Is Safe. But Is It Fast?
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster Health
 
Whoops! I Rewrote It in Rust
Whoops! I Rewrote It in RustWhoops! I Rewrote It in Rust
Whoops! I Rewrote It in Rust
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
2014 11-05 hpcac-kniep_christian_dockermpi
2014 11-05 hpcac-kniep_christian_dockermpi2014 11-05 hpcac-kniep_christian_dockermpi
2014 11-05 hpcac-kniep_christian_dockermpi
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Kraken mesoscon 2018
Kraken mesoscon 2018Kraken mesoscon 2018
Kraken mesoscon 2018
 
How long can you afford to Stop The World?
How long can you afford to Stop The World?How long can you afford to Stop The World?
How long can you afford to Stop The World?
 
Tech Day 2015: A Gentle Introduction to GPS and GNATbench
Tech Day 2015: A Gentle Introduction to GPS and GNATbenchTech Day 2015: A Gentle Introduction to GPS and GNATbench
Tech Day 2015: A Gentle Introduction to GPS and GNATbench
 
20110421 02 15分でrails3サーバ作成
20110421 02 15分でrails3サーバ作成20110421 02 15分でrails3サーバ作成
20110421 02 15分でrails3サーバ作成
 
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
 

Ähnlich wie Real-time Debugging using GDB Tracepoints and other Eclipse features

InterConnect2016_4932
InterConnect2016_4932InterConnect2016_4932
InterConnect2016_4932
Clare Carty
 

Ähnlich wie Real-time Debugging using GDB Tracepoints and other Eclipse features (20)

LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2
 
Recent OBS Updates
Recent OBS UpdatesRecent OBS Updates
Recent OBS Updates
 
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
 
How we scale up our architecture and organization at Dailymotion
How we scale up our architecture and organization at DailymotionHow we scale up our architecture and organization at Dailymotion
How we scale up our architecture and organization at Dailymotion
 
Why use Gitlab
Why use GitlabWhy use Gitlab
Why use Gitlab
 
Why and How to Run Your Own Gitlab Runners as Your Company Grows
Why and How to Run Your Own Gitlab Runners as Your Company GrowsWhy and How to Run Your Own Gitlab Runners as Your Company Grows
Why and How to Run Your Own Gitlab Runners as Your Company Grows
 
Serverless java
Serverless   javaServerless   java
Serverless java
 
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro services
 
An XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on DominoAn XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on Domino
 
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & Tricks
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
 
How Databases Work - for Developers, Accidental DBAs and Managers
How Databases Work - for Developers, Accidental DBAs and ManagersHow Databases Work - for Developers, Accidental DBAs and Managers
How Databases Work - for Developers, Accidental DBAs and Managers
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
InterConnect2016_4932
InterConnect2016_4932InterConnect2016_4932
InterConnect2016_4932
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Real-time Debugging using GDB Tracepoints and other Eclipse features

  • 1. Real-time Debugging using GDB Tracepoints and other Eclipse features GCC Summit 2010 2010-010-26 marc.khouzam@ericsson.com
  • 2. © Ericsson | GCC Summit 2010 › Introduction › Advanced debugging features – Non-stop multi-threaded debugging – Pretty-printing of complex structures – Multi-process debugging – Reverse debugging – Multi-core debugging › GDB Tracepoints Summary
  • 3. © Ericsson | GCC Summit 2010 › Many companies deal with embedded systems › Linux is widely used in the embedded space › Applications are complex and have complex interactions › Use of different targets – Different OS: Linux, Real-time OS, proprietary OS – Different architectures – Different environments: design, test, integration, live site – Different setups : Simulator, Real hardware, Lab, JTAG Introduction
  • 4. © Ericsson | GCC Summit 2010 › Need for a debugging tool to address those situations › Same tool for design, test, integration, live sites › Same tool for simulator, real-target › Same tool for different archs, OS › Same tool for different types of users ➢GDB provides the advanced debugging features ➢Eclipse Integration provides the ease-of-use and efficiency Introduction
  • 5. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 6. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 7. © Ericsson | GCC Summit 2010 Non-Stop multi-threading ● Debugging a process by stopping its execution might cause the program to change its behavior drastically ● Some threads should not be interrupted for proper program execution ● Heartbeat threads ● Monitoring threads ● Server threads ● Non-stop allows to stop and examine a subset of threads, while other threads continue to run freely.
  • 8. © Ericsson | GCC Summit 2010 Non-Stop multi-threading ● Allows to individually control treads ● Step, Resume, Suspend Threads 3 and 4 are stopped Threads 1 and 2 are still running
  • 9. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 10. © Ericsson | GCC Summit 2010 Pretty-printing ● Content of complex abstract data structures should be presented to the user while keeping the abstraction. ● Vectors ● List ● Maps ● User-defined structure ● GDB provides Python pretty-printing feature which is STL-ready
  • 11. © Ericsson | GCC Summit 2010 Pretty-printing (Now) No pretty-printing Partial pretty-printing
  • 12. © Ericsson | GCC Summit 2010 Pretty-printing (Next) Full pretty-printing with editable values ● Display content in user-friendly fashion ● Allows to modify content directly!
  • 13. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 14. © Ericsson | GCC Summit 2010 Multi-process (Now) ● Currently available for targets that have a single memory space for all processes Multiple processes in the same launch. They can be individually controlled and inspected Dynamically connect/disconnect
  • 15. © Ericsson | GCC Summit 2010 Multi-process (Next) ● Current work to bring this to Linux using GDB 7.2 for next release Multiple processes in the same Launch in Non-Stop mode
  • 16. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 17. © Ericsson | GCC Summit 2010 Reverse debugging ● Often, when debugging, you realize that you have gone too far and some event of interest has already happened. ● Restarting execution to reach that same failure can be tedious and time consuming ● Why not simply go backwards? ● Undo the changes in machine state that have taken place as the program was executing normally i.e., revert registers and memory to previous values ● GDB provides Process Record and Replay for Linux ● Allows to go backwards, modify memory/registers, then resume execution on a new path!
  • 18. © Ericsson | GCC Summit 2010 Reverse debugging Buttons to control reverse execution Toggle reverse and display execution buttons
  • 19. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 20. © Ericsson | GCC Summit 2010 Multi-core debugging ● As systems get more complex, so does the software running on them ● Debugging tools must provide more information to describe these complex systems ● Multi-core systems are the default now ● Troubleshooting requires having knowledge of what is running where
  • 21. © Ericsson | GCC Summit 2010 Multi-core debugging ● First step in upcoming broader multi-core debugging support ● Indicates core information to the user Cores are shown for both threads and processes
  • 22. © Ericsson | GCC Summit 2010 Others ● Any binary debugging (Now) ● Allows to debug any binary without having to build it in Eclipse ● Almost immediate debugging of GDB or GCC! ● Automatic remote launching (Next) ● Will automatically start gdbserver on your target ● Global breakpoints (Next) ● Allows to stop processes that don't have the debugger attached to it ● Essential for short-lived processes ● Essential for startup-sequence debugging on a real target
  • 23. © Ericsson | GCC Summit 2010 Now › Non-Stop multi-threading › Partial Pretty-printing › Single space multi-process › Reverse › Any binary debugging › Tracepoints Features Next › Full Pretty-printing › Full Multi-process › Multi-core debugging › Global breakpoints › Tracepoints improvements – Fast tracepoints – Static tracepoints – Observer-mode – Intelligent trace visualization
  • 24. © Ericsson | GCC Summit 2010 Dynamic Tracing › Using a debugger drastically changes execution › In some cases, a debugger is too intrusive : – Debugging a race condition – Investigating user-interface issues – Live sites – Real-time systems › Low-overhead tracing is the answer: LTTng, UST › What if existing static traces don’t give info needed? › What about systems that are not instrumented? Eclipse's integration of GDB’s Dynamic Tracepoints
  • 25. © Ericsson | GCC Summit 2010 › Creation of tracepoints is done as for breakpoints › Enable/Disable › Dynamic condition › Specification of data to be gathered using symbolic expressions and memory addresses (actions) › Pass count › Trace-state variables can be used in conditions and actions › Tracepoints are only in effect if tracing is enabled Eclipse Tracepoints
  • 26. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Selection › Tracepoints treated as breakpoints
  • 27. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Display › Tracepoints › Tracepoints with actions
  • 28. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Disassembly › Disassembly view support for Tracepoints › Tracepoint with condition
  • 29. © Ericsson | GCC Summit 2010 Eclispe Tracepoints Properties › Tracepoints properties – Location – Enablement – Condition – Pass count
  • 30. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Actions
  • 31. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Actions › Tracepoints action types – Collect – Evaluate – While-Stepping › Collect › Evaluate
  • 32. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Control
  • 33. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Control › Trace Control View – Refreshing info – Trace Variables – Start/Stop Tracing – Navigate during Visualization – Stop Visualization
  • 34. © Ericsson | GCC Summit 2010 Eclipse Tracepoints Variables
  • 35. © Ericsson | GCC Summit 2010 Eclipse Trace Data › Resulting trace data – can be stored to file – can be visualized in Eclipse immediately or in the future
  • 36. © Ericsson | GCC Summit 2010 › Navigation through data records using GDB › Each data record is a snapshot of debug information › Records can be examined using standard debugger views – As if debugger was attached at a specific point in time – Only collected information can be shown – Highlighting of the tracepoint of interest › All collected data of a record can also be dumped as plain text › Trace data can be saved to file › Saved trace data can be examined offline Eclipse Trace Data Visualization
  • 37. © Ericsson | GCC Summit 2010 Eclispe Trace Data Visualization
  • 38. © Ericsson | GCC Summit 2010 Eclipse Static Tracepoints › Next phase of development › Using GDB and UST › Handled like Dynamic Tracepoint, except for creation
  • 39. © Ericsson | GCC Summit 2010 Eclipse Static Tracepoints › Creation of tracepoint done by designer before compilation › As for Dynamic tracepoints: – Enable/Disable tracepoints dynamically – Dynamic condition – Can additionally have dynamic tracing specified (actions) – Pass count – Trace-state variables – ...
  • 40. © Ericsson | GCC Summit 2010 › Support for Fast Tracepoints – Explicit or implicit support? › Support for Static Tracepoints › Support for Observer mode › Support for Global Actions (affecting all tracepoints) Planned Tracepoint Features
  • 41. © Ericsson | GCC Summit 2010 › Disabling tracepoints during Tracing › Tracepoints Enhanced Visualization: – Currently the user must have an idea of what has been collected – Goal is to directly and only show what has been collected › Fast Tracepoints on 3-byte instruction – Currently fast tracepoints are 5-byte jumps insert in the code – New 3-byte jump to a nearby location to the 5-byte jump Planned Tracepoint Features
  • 42. © Ericsson | GCC Summit 2010 Getting it to work for you in five easy steps 1.Downloading Eclipse Linux Package: • http://eclipse.org/downloads • Choose: “Eclipse IDE for C/C++ Linux Developers” 2.Extract it: tar xf <packageFile> 3.Run it: cd <packageDir> ; ./eclipse 4.Create a (dummy) C/C++ project: “Hello World” is fine 5.Start debugging... GDB... GCC... etc...
  • 43. © Ericsson | GCC Summit 2010 Questions?
  • 44. © Ericsson | GCC Summit 2010