SlideShare a Scribd company logo
Improvements to CDI based CDT debugger targeting embedded platforms Teodor Madan, Freescale Semiconductor, Inc [email_address] Presented at Eclipse Summit 2009, Wednesday October 28th, Seminarräume 5
Agenda CDT background Eclipse for Embedded C/C++ CDI changes for embedded Target introspection Breakpoints Memory space Q & A
C/C++ Debugging Interface  CDT itself does not contain a debugger for C/C++ code. Just support for adding an external debugger, including  gdb  is an external debugger. CDI (C/C++ Debugging Interface): CDT API to connect a custom debugger backend to standard graphical debugging capabilities of CDT. Standard CDT debugger model is mostly tailored for common look and feel for C/C++ debuggers. CDI backend debugger  can be created almost without having any UI code. Usually writing a custom launch configuration type is enough. GDB-MI  is the reference implementation.
Eclipse C/C++ targeting embedded Eclipse has been embraced by most embedded tools vendors as the common IDE platform  Eclipse based IDE are targeting a diversity of architectures from low-end 8-bit MCU to high-end multi-core processors New problem domain brings new requirements to the original CDT support for debugging
Challenges for Embedded domain An embedded developer needs a higher introspection from target. Not just about application debugged but as well about environment/system where application is executed High latency for retrieving data Often few debug resources especially for bare-metal debugging Often cannot setup all breakpoints especially when debugging in ROM Single memory space paradigm for all process addresses no longer applies
Variable Location Information Location is where value of variable resides in target memory/register.  Important to know where variables are located at one glance Creating watch expression for variables often is not handy, and not always possible Compilers might spill a complex variable in different locations when optimizing: e.g. spilling value over few registers. Part of the structure in memory other in register.
Register Location Information SOC registers are usually memory mapped, i.e. correspond to an address in system memory space.  Usually have an indirect memory access, a base address plus an offset. Base address is often known only by low-level OS logic. Other non-memory mapped addressing exists. E.g. register offset/id in a configuration register.
Disassembly memory rendering Viewing any memory region as a disassembled code Not tight to current debug context/process memory space CDT 6.0. has the ability to go to any address in Disassembly view. But not enough. Allows to view disassembly code in any memory spaces that could be different the process memory space.
Export / Import registers Thousands of registers to be monitored for a complex SOC device Need to save SOC state. Information to be further analyzed by dedicated teams. Restore complete or partially a previous SOC state.  You can diff a previously saved state with the current target state. Imports registers that changed
One stack frame  Often in debug scenarios user does do a series of run/stop/step of the target until reached the desired location/moment. Any improvements in time to handle a thread suspended state is beneficial. For targets with high latencies doing stack unwinding takes time. Even attempt to figure out the caller method takes precious ms when user is even not interested in this info. With a single handy click user can specify to backend to not spend time in creating back chain. Later when reached the desired location/moment user can order debugger to create the back chain
Breakpoints Few people realize that a line breakpoint, especially for C++, can actually represent multiple location in process code memory space. Examples: Inline methods. Same code can be inlined in other functions, possible with a modified generated code due to local optimizations Templates. Each template instance is actually a different class/method associated with the same source line. Inlined templates. Template methods are usually declared inlined as well. STL as an example.  Debugging C++ code requires a lot of breakpoints. When breakpoints are limited the user has to choose.
Easier navigation in breakpoints view Breakpoints view is being refactored in eclipse 3.6. to use flexible hierarchy. Will be possible to customize view per debug domain needs. Display breakpoint instances with resolved location information Display not-resolved breakpoints with detailed error information.
Memory space Usually for application in user domain we do not have to care about memory space. At most data vs code Debugging a system involves to present/handle information from different problem domain: System memory vs user application memory Physical memory vs virtual data memory Swapped data vs active data (for overlaid application) RAM vs Flash Just the context where data is presented is not enough.
Q&A Teodor Madan, Freescale Semiconductor, Inc [email_address]

More Related Content

PPTX
Assembly language programming
PPTX
Assembly language progarmming
PPTX
Assembly Language
PPTX
Assembly language
PPTX
Assembly and Machine Code
PDF
IP67 Test Report
PDF
Internet of Things (IOT) - Demo - Part I
PDF
Tdd with python unittest for embedded c
Assembly language programming
Assembly language progarmming
Assembly Language
Assembly language
Assembly and Machine Code
IP67 Test Report
Internet of Things (IOT) - Demo - Part I
Tdd with python unittest for embedded c

Viewers also liked (20)

PDF
Test-Driven Development for Embedded C -- OOP Conference 2015, Munich
PPTX
Embedded C workshop
PDF
Standard embedded c
PPT
Embedded c & working with avr studio
PDF
Embedded c
PDF
C Programming - Refresher - Part III
PDF
Embedded SW Interview Questions
PDF
Embedded C
PDF
Internet of things : Beginners view
PPT
Embedded c programming22 for fdp
PDF
Embedded C - Lecture 4
PDF
C Programming - Refresher - Part IV
PDF
Writing c code for the 8051
PDF
C Programming - Refresher - Part II
PPTX
Embedded c c++ programming fundamentals master
PDF
C Programming - Refresher - Part I
PDF
Chapter 7 8051 programming in c
PPTX
8051 programming skills using EMBEDDED C
PDF
Embedded C - Lecture 1
Test-Driven Development for Embedded C -- OOP Conference 2015, Munich
Embedded C workshop
Standard embedded c
Embedded c & working with avr studio
Embedded c
C Programming - Refresher - Part III
Embedded SW Interview Questions
Embedded C
Internet of things : Beginners view
Embedded c programming22 for fdp
Embedded C - Lecture 4
C Programming - Refresher - Part IV
Writing c code for the 8051
C Programming - Refresher - Part II
Embedded c c++ programming fundamentals master
C Programming - Refresher - Part I
Chapter 7 8051 programming in c
8051 programming skills using EMBEDDED C
Embedded C - Lecture 1
Ad

Similar to CDI debugger for embedded C/C+ (20)

PPTX
Software for embedded systems complete
PPT
.NET Debugging Tips and Techniques
PPT
.Net Debugging Techniques
PDF
C++ Restrictions for Game Programming.
PPTX
What Have We Lost - A look at some historical techniques
PPT
Overview
PPTX
Revers engineering
PPTX
Introduction to C to Hardware (programming FPGAs and CPLDs in C)
PPT
Mmp hotos2003-slides
PDF
Dot Net Fundamentals
PPTX
Low-level Graphics APIs
PPTX
Embedded C.pptx
PDF
Consider the following interrupting system. The active-edge inputs o.pdf
PPTX
Operating Systems Module 4_Memory Management.pptx
PPTX
Common Project Mistakes (And How to Avoid Them)
PDF
Building of systems of automatic C/C++ code logging
PDF
Workshop - The Little Pattern That Could.pdf
PPTX
Exploring SoC Peripherals with Eclipse C/C++ IDE
PDF
C programming session9 -
PPTX
Unit-2.pptx
Software for embedded systems complete
.NET Debugging Tips and Techniques
.Net Debugging Techniques
C++ Restrictions for Game Programming.
What Have We Lost - A look at some historical techniques
Overview
Revers engineering
Introduction to C to Hardware (programming FPGAs and CPLDs in C)
Mmp hotos2003-slides
Dot Net Fundamentals
Low-level Graphics APIs
Embedded C.pptx
Consider the following interrupting system. The active-edge inputs o.pdf
Operating Systems Module 4_Memory Management.pptx
Common Project Mistakes (And How to Avoid Them)
Building of systems of automatic C/C++ code logging
Workshop - The Little Pattern That Could.pdf
Exploring SoC Peripherals with Eclipse C/C++ IDE
C programming session9 -
Unit-2.pptx
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
MYSQL Presentation for SQL database connectivity
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation theory and applications.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
KodekX | Application Modernization Development
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
MYSQL Presentation for SQL database connectivity
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation theory and applications.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf

CDI debugger for embedded C/C+

  • 1. Improvements to CDI based CDT debugger targeting embedded platforms Teodor Madan, Freescale Semiconductor, Inc [email_address] Presented at Eclipse Summit 2009, Wednesday October 28th, Seminarräume 5
  • 2. Agenda CDT background Eclipse for Embedded C/C++ CDI changes for embedded Target introspection Breakpoints Memory space Q & A
  • 3. C/C++ Debugging Interface CDT itself does not contain a debugger for C/C++ code. Just support for adding an external debugger, including gdb is an external debugger. CDI (C/C++ Debugging Interface): CDT API to connect a custom debugger backend to standard graphical debugging capabilities of CDT. Standard CDT debugger model is mostly tailored for common look and feel for C/C++ debuggers. CDI backend debugger can be created almost without having any UI code. Usually writing a custom launch configuration type is enough. GDB-MI is the reference implementation.
  • 4. Eclipse C/C++ targeting embedded Eclipse has been embraced by most embedded tools vendors as the common IDE platform Eclipse based IDE are targeting a diversity of architectures from low-end 8-bit MCU to high-end multi-core processors New problem domain brings new requirements to the original CDT support for debugging
  • 5. Challenges for Embedded domain An embedded developer needs a higher introspection from target. Not just about application debugged but as well about environment/system where application is executed High latency for retrieving data Often few debug resources especially for bare-metal debugging Often cannot setup all breakpoints especially when debugging in ROM Single memory space paradigm for all process addresses no longer applies
  • 6. Variable Location Information Location is where value of variable resides in target memory/register. Important to know where variables are located at one glance Creating watch expression for variables often is not handy, and not always possible Compilers might spill a complex variable in different locations when optimizing: e.g. spilling value over few registers. Part of the structure in memory other in register.
  • 7. Register Location Information SOC registers are usually memory mapped, i.e. correspond to an address in system memory space. Usually have an indirect memory access, a base address plus an offset. Base address is often known only by low-level OS logic. Other non-memory mapped addressing exists. E.g. register offset/id in a configuration register.
  • 8. Disassembly memory rendering Viewing any memory region as a disassembled code Not tight to current debug context/process memory space CDT 6.0. has the ability to go to any address in Disassembly view. But not enough. Allows to view disassembly code in any memory spaces that could be different the process memory space.
  • 9. Export / Import registers Thousands of registers to be monitored for a complex SOC device Need to save SOC state. Information to be further analyzed by dedicated teams. Restore complete or partially a previous SOC state. You can diff a previously saved state with the current target state. Imports registers that changed
  • 10. One stack frame Often in debug scenarios user does do a series of run/stop/step of the target until reached the desired location/moment. Any improvements in time to handle a thread suspended state is beneficial. For targets with high latencies doing stack unwinding takes time. Even attempt to figure out the caller method takes precious ms when user is even not interested in this info. With a single handy click user can specify to backend to not spend time in creating back chain. Later when reached the desired location/moment user can order debugger to create the back chain
  • 11. Breakpoints Few people realize that a line breakpoint, especially for C++, can actually represent multiple location in process code memory space. Examples: Inline methods. Same code can be inlined in other functions, possible with a modified generated code due to local optimizations Templates. Each template instance is actually a different class/method associated with the same source line. Inlined templates. Template methods are usually declared inlined as well. STL as an example. Debugging C++ code requires a lot of breakpoints. When breakpoints are limited the user has to choose.
  • 12. Easier navigation in breakpoints view Breakpoints view is being refactored in eclipse 3.6. to use flexible hierarchy. Will be possible to customize view per debug domain needs. Display breakpoint instances with resolved location information Display not-resolved breakpoints with detailed error information.
  • 13. Memory space Usually for application in user domain we do not have to care about memory space. At most data vs code Debugging a system involves to present/handle information from different problem domain: System memory vs user application memory Physical memory vs virtual data memory Swapped data vs active data (for overlaid application) RAM vs Flash Just the context where data is presented is not enough.
  • 14. Q&A Teodor Madan, Freescale Semiconductor, Inc [email_address]