fixed old references to Vec

This commit is contained in:
Martino Ferrari
2026-06-02 14:27:52 +02:00
parent b900f50d99
commit 567ebda9cb
2 changed files with 110 additions and 16 deletions
+16 -16
View File
@@ -58,16 +58,16 @@ public:
// 3. Broker Active Status // 3. Broker Active Status
volatile bool active = false; volatile bool active = false;
Vec<uint32> indices; Vector<uint32> indices;
Vec<uint32> sizes; Vector<uint32> sizes;
FastPollingMutexSem mutex; FastPollingMutexSem mutex;
DebugSignalInfo* ptrs[1] = { service.signals[0] }; DebugSignalInfo* ptrs[1] = { service.signals[0] };
volatile bool anyBreak = false; volatile bool anyBreak = false;
Vec<uint32> breakIdx; Vector<uint32> breakIdx;
service.RegisterBroker(ptrs, 1, NULL_PTR(MemoryMapBroker*), &active, &indices, &sizes, &mutex, &anyBreak, &breakIdx); service.RegisterBroker(ptrs, 1, NULL_PTR(MemoryMapBroker*), &active, &indices, &sizes, &mutex, &anyBreak, &breakIdx);
service.UpdateBrokersActiveStatus(); service.UpdateBrokersActiveStatus();
assert(active == true); assert(active == true);
assert(indices.Size() == 1); assert(indices.GetNumberOfElements() == 1);
assert(indices[0] == 0); assert(indices[0] == 0);
// Helper Process // Helper Process
@@ -244,11 +244,11 @@ public:
// Register a broker whose signalPointers is NULL but numSignals > 0. // Register a broker whose signalPointers is NULL but numSignals > 0.
// Before the fix this dereferenced NULL → segfault. // Before the fix this dereferenced NULL → segfault.
volatile bool active = false; volatile bool active = false;
Vec<uint32> indices; Vector<uint32> indices;
Vec<uint32> sizes; Vector<uint32> sizes;
FastPollingMutexSem mutex; FastPollingMutexSem mutex;
volatile bool anyBreak = false; volatile bool anyBreak = false;
Vec<uint32> breakIdx; Vector<uint32> breakIdx;
service.RegisterBroker(NULL_PTR(DebugSignalInfo**), 1u, service.RegisterBroker(NULL_PTR(DebugSignalInfo**), 1u,
NULL_PTR(MemoryMapBroker*), NULL_PTR(MemoryMapBroker*),
&active, &indices, &sizes, &mutex, &active, &indices, &sizes, &mutex,
@@ -538,11 +538,11 @@ public:
assert(service.TraceSignal("Z", true) == 1); assert(service.TraceSignal("Z", true) == 1);
volatile bool active = false; volatile bool active = false;
Vec<uint32> indices; Vector<uint32> indices;
Vec<uint32> sizes; Vector<uint32> sizes;
FastPollingMutexSem mutex; FastPollingMutexSem mutex;
volatile bool anyBreak = false; volatile bool anyBreak = false;
Vec<uint32> breakIdx; Vector<uint32> breakIdx;
DebugSignalInfo *ptrs[3] = { DebugSignalInfo *ptrs[3] = {
service.signals[0], service.signals[1], service.signals[2] service.signals[0], service.signals[1], service.signals[2]
}; };
@@ -554,7 +554,7 @@ public:
// After Swap the broker's activeIndices must hold exactly indices 0 and 2 // After Swap the broker's activeIndices must hold exactly indices 0 and 2
assert(active == true); assert(active == true);
assert(indices.Size() == 2u); assert(indices.GetNumberOfElements() == 2u);
// indices are in order of signal position in the broker (0 then 2) // indices are in order of signal position in the broker (0 then 2)
assert(indices[0] == 0u); assert(indices[0] == 0u);
assert(indices[1] == 2u); assert(indices[1] == 2u);
@@ -563,7 +563,7 @@ public:
// Disable one; Swap again — only index 0 should remain // Disable one; Swap again — only index 0 should remain
assert(service.TraceSignal("Z", false) == 1); assert(service.TraceSignal("Z", false) == 1);
service.UpdateBrokersActiveStatus(); service.UpdateBrokersActiveStatus();
assert(indices.Size() == 1u); assert(indices.GetNumberOfElements() == 1u);
assert(indices[0] == 0u); assert(indices[0] == 0u);
printf(" -> PASS: After disabling Z, only index 0 remains\n"); printf(" -> PASS: After disabling Z, only index 0 remains\n");
} }
@@ -592,11 +592,11 @@ public:
service.UpdateBrokersBreakStatus(); service.UpdateBrokersBreakStatus();
volatile bool active = false; volatile bool active = false;
Vec<uint32> indices; Vector<uint32> indices;
Vec<uint32> sizes; Vector<uint32> sizes;
FastPollingMutexSem mutex; FastPollingMutexSem mutex;
volatile bool anyBreak = false; volatile bool anyBreak = false;
Vec<uint32> breakIdx; Vector<uint32> breakIdx;
DebugSignalInfo *ptrs[1] = { service.signals[0] }; DebugSignalInfo *ptrs[1] = { service.signals[0] };
service.RegisterBroker(ptrs, 1u, NULL_PTR(MemoryMapBroker *), service.RegisterBroker(ptrs, 1u, NULL_PTR(MemoryMapBroker *),
&active, &indices, &sizes, &mutex, &active, &indices, &sizes, &mutex,
@@ -605,7 +605,7 @@ public:
// UpdateBrokersBreakStatus must propagate the break flag to the broker // UpdateBrokersBreakStatus must propagate the break flag to the broker
service.UpdateBrokersBreakStatus(); service.UpdateBrokersBreakStatus();
assert(anyBreak == true); assert(anyBreak == true);
assert(breakIdx.Size() == 1u); assert(breakIdx.GetNumberOfElements() == 1u);
// Process() copies break indices, releases lock, evaluates break. // Process() copies break indices, releases lock, evaluates break.
// val = 5 > 3 — service must become paused. // val = 5 > 3 — service must become paused.
+94
View File
@@ -183,5 +183,99 @@
], ],
"directory": "/home/martino/Projects/marte_debug/Source/Components/Interfaces/WebDebugService", "directory": "/home/martino/Projects/marte_debug/Source/Components/Interfaces/WebDebugService",
"output": "../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/WebDebugService.o" "output": "../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/WebDebugService.o"
},
{
"file": "../../../..//Source/Components/Interfaces/DebugService/DebugServiceBase.cpp",
"arguments": [
"/usr/bin/g++",
"-c",
"-I../../../..//Source/Components/Interfaces/TCPLogger",
"-I../../../..//Source/Components/Interfaces/DebugService",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Logger",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4Messages",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4LoggerService",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L5GAMs",
"-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability",
"-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L3Streams",
"-fPIC",
"-Wall",
"-std=c++98",
"-Werror",
"-Wno-invalid-offsetof",
"-Wno-unused-variable",
"-fno-strict-aliasing",
"-frtti",
"-DMARTe2_TEST_ENVIRONMENT=GTest",
"-DARCHITECTURE=x86_gcc",
"-DENVIRONMENT=Linux",
"-DUSE_PTHREAD",
"-pthread",
"-Wno-deprecated-declarations",
"-Wno-unused-value",
"-g",
"-ggdb",
"../../../..//Source/Components/Interfaces/DebugService/DebugServiceBase.cpp",
"-o",
"../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/DebugServiceBase.o"
],
"directory": "/home/martino/Projects/marte_debug/Source/Components/Interfaces/WebDebugService",
"output": "../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/DebugServiceBase.o"
},
{
"file": "UnitTests.cpp",
"arguments": [
"/usr/bin/g++",
"-c",
"-I../../Source/Core/Types/Result",
"-I../../Source/Core/Types/Vec",
"-I../../Source/Components/Interfaces/DebugService",
"-I../../Source/Components/Interfaces/TCPLogger",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Logger",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration",
"-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4Messages",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4LoggerService",
"-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L5GAMs",
"-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability",
"-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L3Streams",
"-fPIC",
"-Wall",
"-std=c++98",
"-Werror",
"-Wno-invalid-offsetof",
"-Wno-unused-variable",
"-fno-strict-aliasing",
"-frtti",
"-DMARTe2_TEST_ENVIRONMENT=GTest",
"-DARCHITECTURE=x86_gcc",
"-DENVIRONMENT=Linux",
"-DUSE_PTHREAD",
"-pthread",
"-Wno-deprecated-declarations",
"-Wno-unused-value",
"-g",
"-ggdb",
"UnitTests.cpp",
"-o",
"../../Build/x86-linux/Test/UnitTests/UnitTests/UnitTests.o"
],
"directory": "/home/martino/Projects/marte_debug/Test/UnitTests",
"output": "../../Build/x86-linux/Test/UnitTests/UnitTests/UnitTests.o"
} }
] ]