# Target Communication Framework project

## Index

- Summary
- Goals
- Features
- Reference implementation of a target agent
- Prototype of a debugger based on Eclipse Debug Framework and TCF
- Prototype of a system monitor and remote file access based on Remote System Explorer and TCF

## Summary

Today almost every device software development tool on the market has its own method of communication with target system. Communication methods often conflict with each other, require individual setup, configuration and maintenance, impose all kinds of unnecessary limitations. Target Communication Framework is designed to establish common ground in the area of communication protocols between development tools and embedded devices.

## Goals

- Universal, extensible, simple, lightweight, vendor agnostic framework for tools and targets to communicate for purpose of debugging, profiling, code patching and other device software development needs.
- Single configuration per target (not per tool per target as today in most cases), or no configuration when possible.
- Small overhead and footprint on target side.

## Features

Target Communication Framework Specification is a document describing design goals, requirements and format of TCF communication protocol, as well as framework API and software design considerations.

TCF communication model is based on the idea of services. A service is a group of related commands, events and semantics. A service can be discovered, added or removed as a group at communication endpoint. Service definitions are not part of the framework specification, and new services are expected to be defined by developers of tools and target agents. However, standardization of common services is needed to achieve certain level of compatibility of tools/targets, see TCF Services Specification as starting point of this work.

## Reference implementation of a target agent

Current reference implementation of TCF target agents is fully functional, can run on Windows, Linux and VxWorks, and provides the following services:

- Run Control - provides threads and processes run control functionality sufficient for debugging of user space programs. On Linux it is implemented using PTRACE, on VxWorks is uses vxdbgLib, on Windows it is not currently supported.
- Breakpoints - provides basic breakpoints support. On Linux it is implemented using PTRACE, on VxWorks is uses vxdbgLib, on Windows it is not currently supported.
- Registers - allows inspection and modification of CPU registers. Implemented for Linux and VxWorks, on Windows it is not currently supported.
- Stack Trace - execution thread stack back-tracing. Implemented for Linux and VxWorks, on Windows it is not currently supported.
- Memory - program memory access. Implemented for Linux and VxWorks, on Windows it is not currently supported.
- Processes - provides access to the target OS's process information, allows starting new and terminating existing processes, and allows attaching and detaching processes for debugging. Implemented for Linux and VxWorks, on Windows it is not currently supported.
- Line Numbers - provides mapping between locations in the source files and corresponding machine instruction addresses in the executable object. Implemented for Linux only.
- Sys Monitor - provides list of processes, process attributes and CPU/memory utilization data. On Linux it is implemented using /proc file system, on Windows and VxWorks it is not currently supported.
- File System - provides access to remote file system.
- Diagnostics - allows testing of communication channel and agent functionality.

The agent code is designed to be easily extensible by adding new command handler implementations. The code separates machine dependences, common TCF logic and service implementations, which allows easy porting to a new OS or a target and reconfiguring of the agent for specific needs. The code is written in ANSI C. See TCF Linux Agent Prototype for more details about the agent code.

## Prototype of a debugger based on Eclipse Debug Framework and TCF

The prototype code connects Eclipse Debug Framework and Target Communication Framework. It allows to launch Eclipse debug session by connecting to a target running TCF agent, and then perform basic debugging tasks, like resuming, suspending, single-stepping, setting/removing breakpoints, etc. Since current reference implementation of target agent does not support line number information access, source level debugging is not supported.

The prototype launch configuration autodetects TCF targets on a local network and allows a user to connect to a target by simply selecting it from a list without a need for any further configuration or setup. TCF launch configuration dialog also offers controls to run a built-in diagnostics on a selecting target, which perform stress testing of communication channel, agent and target itself:

The prototype makes use of flexible debug model element hierarchy support, which is available in Eclipse debug framework since Eclipse 3.2. The flexible hierarchy allows debugger views to be "data driven" or, in other words, dynamically adapt to a given targets capabilities and structure, without a need to modify debugger code to support a new target.

## Prototype of a system monitor and remote file access based on Remote System Explorer and TCF

Remote System Explorer is an Eclipse based component that allows users to create connections to remote machines and explore their file systems, see list of processes and access some other resources, like remote shells. Remote System Explorer has been designed as a flexible, extensible framework to which Eclipse plug-in developers can contribute their own system definitions, actions, etc.

The prototype enables use of Processes and Files subsystems of Remote System Explorer over TCF. It also extends Processes subsystem to include CPU utilization data and some other process attributes in RSE views: