Major functionality implemented (missing reconfig).

This commit is contained in:
Martino Ferrari
2026-04-14 01:40:43 +02:00
parent 96d98dfc3d
commit 3a1ecd3aba
6 changed files with 1173 additions and 107 deletions
@@ -32,6 +32,12 @@ struct BrokerInfo {
Vec<uint32> *activeIndices;
Vec<uint32> *activeSizes;
FastPollingMutexSem *activeMutex;
// Conditional break — mirrors activeIndices but for break-enabled signals
volatile bool *anyBreakFlag;
Vec<uint32> *breakIndices;
// GAM association for step-by-GAM
StreamString gamName;
bool isOutput;
};
class DebugService : public ReferenceContainer,
@@ -55,7 +61,10 @@ public:
void RegisterBroker(DebugSignalInfo **signalPointers, uint32 numSignals,
MemoryMapBroker *broker, volatile bool *anyActiveFlag,
Vec<uint32> *activeIndices, Vec<uint32> *activeSizes,
FastPollingMutexSem *activeMutex);
FastPollingMutexSem *activeMutex,
volatile bool *anyBreakFlag, Vec<uint32> *breakIndices,
const char8 *gamName = NULL_PTR(const char8 *),
bool isOutput = false);
virtual ErrorManagement::ErrorType Execute(ExecutionInfo &info);
@@ -64,11 +73,27 @@ public:
bool IsPaused() const { return isPaused; }
void SetPaused(bool paused) { isPaused = paused; }
// Step-by-GAM / per-thread: called by each output broker.
// threadName is the OS thread name (from Threads::Name(Threads::Id())).
// Decrements stepRemaining only when stepThreadFilter is empty or matches;
// when stepRemaining reaches 0, sets isPaused = true and records gamName.
void ConsumeStepIfNeeded(const char8 *gamName,
const char8 *threadName = NULL_PTR(const char8 *));
void GetStepStatus(BasicTCPSocket *client);
// Step n cycles; if threadName is non-null/non-empty, only that thread advances.
void Step(uint32 n, const char8 *threadName = NULL_PTR(const char8 *));
// Read the current raw value of a signal from its memory address.
void GetSignalValue(const char8 *name, BasicTCPSocket *client);
static bool GetFullObjectName(const Object &obj, StreamString &fullPath);
uint32 ForceSignal(const char8 *name, const char8 *valueStr);
uint32 UnforceSignal(const char8 *name);
uint32 TraceSignal(const char8 *name, bool enable, uint32 decimation = 1);
uint32 SetBreak(const char8 *name, uint8 op, float64 threshold);
uint32 ClearBreak(const char8 *name);
bool IsInstrumented(const char8 *fullPath, bool &traceable, bool &forcable);
void Discover(BasicTCPSocket *client);
void InfoNode(const char8 *path, BasicTCPSocket *client);
@@ -93,6 +118,7 @@ public:
private:
void HandleCommand(StreamString cmd, BasicTCPSocket *client);
void UpdateBrokersActiveStatus();
void UpdateBrokersBreakStatus();
void InjectTcpLoggerIfNeeded();
uint32 ExportTree(ReferenceContainer *container, StreamString &json, const char8 *pathPrefix);
@@ -111,6 +137,9 @@ private:
bool isServer;
bool suppressTimeoutLogs;
volatile bool isPaused;
volatile uint32 stepRemaining;
StreamString pausedAtGam;
StreamString stepThreadFilter; // empty = all threads; non-empty = only this OS thread name
BasicTCPSocket tcpServer;
BasicUDPSocket udpSocket;