Slide Show Title
Download
Report
Transcript Slide Show Title
Extending Eclipse CDT for
Remote Target Debugging
Thomas Fletcher
Director, Automotive Engineering Services
QNX Software Systems
Agenda
Eclipse
overview
Eclipse
CDT overview
Customizing
and extending Eclipse CDT
Example:
Extending the debugger
Installing
a new debugger
Additional
Summary
considerations
... Code Samples?
All content copyright QNX Software Systems
2
Eclipse Overview
Universal
Allows
framework for tool integration
developers to choose best-of-breed solutions
Eclipse Platform
New Tool Extension
Workbench
JDT / JFace
Help
Existing Tool Extension
SWT
Vendor Tools
VCM
Workspace
Tool A
Tool B
Tool C
Platform Runtime
All content copyright QNX Software Systems
3
Eclipse CDT Overview
Project
started in 2002
Design
goals
> Provide framework for C/C++ development using Eclipse
> Integrate with existing C/C++ tools (compiler, debug, etc.)
> Build extensible and/or replaceable building blocks
> Focus on framework design, not specific features
> Target wide variety of OEM and VAR users
Use in traditional embedded: RTOS/host-target systems
Use in deep embedded: soft-cores, FPGA development
Use in desktop/self-hosted development environments
Others: mainframe, parallel computing, C dialects, etc.
All content copyright QNX Software Systems
4
Eclipse CDT Today
Steady
progress and growing adoption
> Variety of commercial products ship CDT (many embedded)
> Participation from over 10 companies, 15 project committers
> CDT 2.1 available for Eclipse 3.0, December 2004
> CDT 3.0 targeted for Eclipse 3.1, July 2005
Rich
baseline of features
> C/C++ build management (projects & source wizards)
> C/C++ editor and source navigation tools
> C/C++ graphical source debugger
All content copyright QNX Software Systems
5
Eclipse CDT Today (cont)
Works
“out of the box”
> Default is a GNU self-hosted environment
“make” for build management
GCC compiler (error parsing, command line arguments)
Binutils & ELF objects (objdump, nm, addr2line)
GDB debugger
> Designed as a fully implemented example
Replace or enhance as required
All content copyright QNX Software Systems
6
Eclipse CDT Framework
Eclipse platform
Workbench
Debug
C/C++ Debug
• C/C++ debug perspective
• C/C++ centric information
• Memory, Registers, Libraries
• Disassembly of source
• GDB/MI Debugger support
CDT Launch
• Transfer binary to execution state
• Glue between core and debug
• Custom UI for driving tools
CDT Build
• New project creation
• Internal or External managed
• Source code Binary object
• Binary object identification
• Compilation error parsers
JFace
Team
SWT
Projects
Editors
Wizards
Views
Workspace
Search
Help
Update
CDT Core
Platform Runtime
All content copyright QNX Software Systems
• C/C++ code editor
• Code-completion/Hover help
• Class browser/Outliner
• Source indexing & search
• C/C++ language parser
• C/C++ AST/DOM model
7
Customizing and Extending Eclipse CDT
Eclipse
CDT can be customized by:
> New plugins that use Eclipse extension points
Action & view contributions
> New plugins that use CDT extension points
Editor commands such as hover help
Source navigation such as open include
> New plugins that use the CDT data/internal framework
Class browser and hierarchy views
> Replace entire CDT modules with specific behaviour
Custom build systems, language parsers
New debuggers, launch configurations
All content copyright QNX Software Systems
8
Example Integration: Extending the Debugger
Eclipse CDT includes GDB debug and launch support
> Standard self-hosted GDB and GDB server configurations
> Works with most embedded toolchains
Your GDB startup customization may be required
> May require custom command line options
> May not support particular configurations
> May require special environment set-up
Start a simulator
Download code to a target
Download additional files to target
Start extra external tools
All content copyright QNX Software Systems
9
Installing a New Debugger
New
debugger extension point
> org.eclipse.cdt.debug.core.CDebugger
Use
this extension point to ...
> Make the CDT framework aware of a new debugger
Will show up in the default CDT launch configuration
> Qualify the capabilities of this debugger
Host platform it is available for
Target architectures it is available for
Modes of operation for the debugger
All content copyright QNX Software Systems
10
Installing a New Debugger (cont’d)
Java
class required to implement three methods
> Normal “launch and debug” session (run)
> Attach to an existing process (attach)
> Post-mortem core file debug (core)
createLaunchSession(ILaunchConfiguration config, IFile exe)
createAttachSession(ILaunchConfiguration config, IFile exe, int pid)
createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile)
> GDB debugger provided
As an example for how to implement a debugger
As a customizable component for gdb like debuggers
All content copyright QNX Software Systems
11
Adding Debugger Controls
New
debugger UI interface
> org.eclipse.cdt.debug.ui.CDebuggerPage
Use
this extension point to...
> Implement custom configurations for your debugger
Java
class implements AbstractLaunchConfigurationTab
> GDB configuration tab provided as reference
All content copyright QNX Software Systems
12
What It All Looks Like
All content copyright QNX Software Systems
13
Additional Considerations
Launch
environment customization
> Overloading simple command-line options may not be enough
> May require a full launch configuration
> Use Eclipse launch extension point with CDT UI components
All content copyright QNX Software Systems
14
Conclusion
Eclipse C/C+ development tool project
> Provides a common framework for all C/C++ tools
> Easy to extend and to customize for any environment
> Perfectly suits the needs of embedded developers
> Is fostering a rapidly growing community of developers
The Eclipse CDT project allows embedded
developers to focus their custom tooling
efforts by leveraging a growing industry
standard for tools and technology
integration.
All content copyright QNX Software Systems
15
Q&A
Thank you for your time!
Questions? Comments?
All content copyright QNX Software Systems
16