#include "journal.hpp" #include namespace journal { std::string assemble_plan(Int mode, Int capacity, const std::vector& points) { std::string result = "set pagination off\nset logging overwrite on\n"; result += capacity == 0 ? "set logging enabled off\n" : "set logging enabled on\n"; result += "file program\n"; if (mode == 1) { result += "target remote board:1234\n"; } if (mode == 2) { result += "core-file core\n"; } std::vector ordered = points; std::sort(ordered.begin(), ordered.end(), [](const Point& a, const Point& b) { return a.slot < b.slot; }); if (mode == 0) { result += "run\n"; } if (mode == 1) { result += "continue\n"; } for (const Point& point : ordered) { result += "break *" + std::to_string(point.address) + "\n"; } result += "thread apply all bt full\ninfo registers\nquit\n"; return result; } }