This is a brief description of the TCF Linux user-mode agent prototype implementation. The agent is implemented as an event driven program. The main event queue is handled by a single thread – the event dispatch thread. Some sub-systems are using other threads locally, but will never call other sub-systems using these threads. Instead an event will be placed on the main event queue to handle the inter sub-system communication.
Main program parses command line options and initialized sub-systems
This module handles registration of command and event handlers. It is called when new messages are received and will dispatch messages to the appropriate handler. It has no knowledge of what transport protocol is used and what services do.
Implements input and output stream over TCP/IP transport and UDP based server side auto discovery.
This module defines the input and output stream interface and support library functions.
The breakpoint services implements a global breakpoint list.
This module implements the run control service. It builds uses the context module to do low level control of contexts. It implements a “safe queue” which contains events that that should be processed then their context is suspended. Incoming TCF messages are suspended while the safe queue is non-empty and are resumed when the last safe queue entry is handled.
This module provides system level monitoring information, similar to the UNIX top or Windows task manager.
This service is used to do end-to-end self test from the host to the target.
This module handles process/thread OS contexts and their state machine. All ptrace() handling is isolated to here.
This module implements the main event queue dispatch and queuing. All events are processed by a single thread. Any thread can queue new events.
The module allows a user to interact with agent. Current implementation of command line interpreter is incomplete.
This module defines agent error codes in addition to system codes defined in errno.h
Exception handling. Functionality is similar to C++ try/catch.
The module contains utility functions for parsing and generating of JSON text. TCF standard services use JSON as messages format. See JSON - Preferred Marshaling for JSON description.
Utilitity module to support double linked lists.
Machine and OS dependend definitions. This module implements host OS abstraction layer that helps make agent code portable between Linux, Windows, VxWorks and potentially other OSes.
Provides local versions of malloc(), realloc() and free().
Proxy service should allow tunneling of TCF messages to another target on behalf of a client. This service intended to be used when a client has no direct access to a target.
Test application is used by Diagnostics service to run various tests.
The module implements logging and tracing that is mostly intended for debugging of the agent.