diff --git a/src/Debug/debugger.cpp b/src/Debug/debugger.cpp index a28e89a2..80fbaaa2 100644 --- a/src/Debug/debugger.cpp +++ b/src/Debug/debugger.cpp @@ -193,7 +193,8 @@ bool Debugger::checkDebugMessages(Module *m, RunningState *program_state) { case interruptPAUSE: this->pauseRuntime(m); // Make a checkpoint so the debugger knows the current state and - // knows how many instructions were executed since the last checkpoint. + // knows how many instructions were executed since the last + // checkpoint. if (snapshotPolicy == SnapshotPolicy::checkpointing) { checkpoint(m, true); } @@ -217,7 +218,7 @@ bool Debugger::checkDebugMessages(Module *m, RunningState *program_state) { uint8_t *data = interruptData + 1; uint32_t amount = read_B32(&data); printf("Continue for %d instruction(s)\n", amount); - remaining_instructions = (int32_t) amount; + remaining_instructions = (int32_t)amount; *program_state = WARDUINOrun; free(interruptData); break; @@ -913,8 +914,7 @@ void Debugger::handleSnapshotPolicy(Module *m) { this->channel->write("SNAPSHOT "); snapshot(m); this->channel->write("\n"); - } - else if (snapshotPolicy == SnapshotPolicy::checkpointing) { + } else if (snapshotPolicy == SnapshotPolicy::checkpointing) { if (instructions_executed >= checkpointInterval || fidx_called) { checkpoint(m); } @@ -924,11 +924,11 @@ void Debugger::handleSnapshotPolicy(Module *m) { if ((fidx_called = isPrimitiveBeingCalled(m, m->pc_ptr))) { const Type *type = m->functions[*fidx_called].type; for (int32_t i = 0; i < type->param_count; i++) { - prim_args[type->param_count - i - 1] = m->stack[m->sp - i].value.uint32; + prim_args[type->param_count - i - 1] = + m->stack[m->sp - i].value.uint32; } } - } - else if (snapshotPolicy != SnapshotPolicy::none) { + } else if (snapshotPolicy != SnapshotPolicy::none) { this->channel->write("WARNING: Invalid snapshot policy."); } } @@ -938,7 +938,8 @@ void Debugger::checkpoint(Module *m, bool force) { return; } - this->channel->write(R"(CHECKPOINT {"instructions_executed": %d, )", instructions_executed); + this->channel->write(R"(CHECKPOINT {"instructions_executed": %d, )", + instructions_executed); if (fidx_called) { this->channel->write("\"fidx_called\": %d, \"args\": [", *fidx_called); const Block &func_block = m->functions[*fidx_called]; @@ -1460,7 +1461,8 @@ Debugger::~Debugger() { delete this->supervisor; } -std::optional Debugger::isPrimitiveBeingCalled(Module *m, uint8_t *pc_ptr) { +std::optional Debugger::isPrimitiveBeingCalled(Module *m, + uint8_t *pc_ptr) { if (!pc_ptr) { return {}; } @@ -1476,8 +1478,7 @@ std::optional Debugger::isPrimitiveBeingCalled(Module *m, uint8_t *pc_ } bool Debugger::handleContinueFor(Module *m) { - if (remaining_instructions < 0) - return false; + if (remaining_instructions < 0) return false; if (remaining_instructions == 0) { remaining_instructions = -1; @@ -1494,7 +1495,8 @@ bool Debugger::handleContinueFor(Module *m) { void Debugger::notifyCompleteStep(Module *m) const { // Upon completing a step in checkpointing mode, make a checkpoint. - if (m->warduino->debugger->getSnapshotPolicy() == SnapshotPolicy::checkpointing) { + if (m->warduino->debugger->getSnapshotPolicy() == + SnapshotPolicy::checkpointing) { m->warduino->debugger->checkpoint(m); } this->channel->write("STEP!\n"); diff --git a/src/Edward/proxy_supervisor.cpp b/src/Edward/proxy_supervisor.cpp index b1d02ebd..511efca9 100644 --- a/src/Edward/proxy_supervisor.cpp +++ b/src/Edward/proxy_supervisor.cpp @@ -134,8 +134,7 @@ bool ProxySupervisor::send( } nlohmann::basic_json<> ProxySupervisor::readReply() { - while (!this->hasReplied) - ; + while (!this->hasReplied); WARDuino::instance()->debugger->channel->write("read reply: succeeded\n"); this->hasReplied = false; return this->proxyResult; diff --git a/src/Interpreter/interpreter.cpp b/src/Interpreter/interpreter.cpp index e7dc76fd..b2e9a557 100644 --- a/src/Interpreter/interpreter.cpp +++ b/src/Interpreter/interpreter.cpp @@ -453,8 +453,8 @@ bool Interpreter::interpret(Module *m, bool waiting) { } // Resolve all unhandled callback events - while (CallbackHandler::resolving_event && CallbackHandler::resolve_event()) - ; + while (CallbackHandler::resolving_event && + CallbackHandler::resolve_event()); dbg_trace("Interpretation ended %s with status %s\n", program_done ? "expectedly" : "unexpectedly",