# MARTe2 Debug Suite An interactive observability and debugging suite for the MARTe2 real-time framework. Instruments any running application **without modifying its source code**, providing real-time signal tracing, forced-value injection, breakpoints, execution stepping, and log forwarding. --- ## Quick Start ### 1. Build ```bash source env.sh make -f Makefile.gcc ``` ### 2. Run Integration Tests ```bash source env.sh ./Build/x86-linux/Test/Integration/Integration/IntegrationTests.ex ``` ### 3. Choose Your Client **Option A — Web UI (no install required)** Add `WebDebugService` to your application config and open `http://localhost:8090` in any browser: ```text +WebDebugService = { Class = WebDebugService HttpPort = 8090 } ``` **Option B — Rust Native GUI** Add `DebugService` to your application config, then launch the GUI: ```bash cd Tools/gui_client cargo run --release ``` ```text +DebugService = { Class = DebugService ControlPort = 8080 UdpPort = 8081 LogPort = 8082 } ``` --- ## Features | Feature | Description | |---|---| | **Zero-code-change** | Registry patching replaces standard brokers at runtime — no application changes needed | | **Signal tracing** | Stream any signal at full RT rate over UDP (DebugService) or SSE (WebDebugService) | | **Signal forcing** | Persistent value injection directly into the RT memory map | | **Breakpoints** | Halt execution when a signal crosses a threshold (`> < == >= <= !=`) | | **Execution stepping** | Step N RT cycles then pause; optionally filter by thread | | **Live object tree** | Browse the full `ObjectRegistryDatabase` hierarchy with signal metadata | | **Config serving** | Retrieve the complete application CDB as JSON | | **Log forwarding** | All `REPORT_ERROR` events forwarded to the client in real time | | **Signal monitoring** | Poll any `DataSourceI` signal at a configurable period | | **MARTe2 messaging** | Send `Message` objects to any ORD object from the debug client | --- ## Transports at a Glance | | `DebugService` | `WebDebugService` | |---|---|---| | **Client** | Rust native GUI or any TCP tool | Any web browser | | **Commands** | Text over TCP (port 8080) | HTTP POST `/api/command` | | **Telemetry** | Binary UDP (port 8081) | Server-Sent Events `/api/events` | | **Logs** | TcpLogger TCP (port 8082) | SSE event stream | | **Install** | Rust + Cargo | None | Both transports implement the same `DebugServiceI` interface and register themselves as the global singleton — they are mutually exclusive (one per application). --- ## Repository Layout ``` Source/ Core/Types/ Vec/ — RT-safe dynamic array (no STL) Result/ — Error-carrying return type Components/Interfaces/ DebugService/ DebugCore.h — DebugSignalInfo, TraceRingBuffer, break op codes DebugServiceI.h — Abstract interface + SignalAlias, BrokerInfo structs DebugBrokerWrapper.h — Broker wrapper templates + registry builder helpers DebugService.h/.cpp — TCP/UDP implementation WebDebugService/ WebUI.h — Embedded single-page HTML/CSS/JS application WebDebugService.h/.cpp — HTTP/SSE implementation TCPLogger/ TcpLogger.h/.cpp — LoggerConsumerI forwarding logs to TCP clients Test/ Integration/ — Integration test suite (180 s SIGALRM guard) UnitTests/ — Unit test suite (COVERAGE V34) Tools/ gui_client/ — Rust/egui native GUI (DebugService transport only) ```