@@ -195,7 +195,8 @@ bool Debugger::checkDebugMessages(Module *m, RunningState *program_state) {
195
195
case interruptPAUSE:
196
196
this ->pauseRuntime (m);
197
197
// Make a checkpoint so the debugger knows the current state and
198
- // knows how many instructions were executed since the last checkpoint.
198
+ // knows how many instructions were executed since the last
199
+ // checkpoint.
199
200
if (snapshotPolicy == SnapshotPolicy::checkpointing) {
200
201
checkpoint (m, true );
201
202
}
@@ -219,7 +220,7 @@ bool Debugger::checkDebugMessages(Module *m, RunningState *program_state) {
219
220
uint8_t *data = interruptData + 1 ;
220
221
uint32_t amount = read_B32 (&data);
221
222
printf (" Continue for %d instruction(s)\n " , amount);
222
- remaining_instructions = (int32_t ) amount;
223
+ remaining_instructions = (int32_t )amount;
223
224
*program_state = WARDUINOrun;
224
225
free (interruptData);
225
226
break ;
@@ -954,8 +955,7 @@ void Debugger::handleSnapshotPolicy(Module *m) {
954
955
this ->channel ->write (" SNAPSHOT " );
955
956
snapshot (m);
956
957
this ->channel ->write (" \n " );
957
- }
958
- else if (snapshotPolicy == SnapshotPolicy::checkpointing) {
958
+ } else if (snapshotPolicy == SnapshotPolicy::checkpointing) {
959
959
if (instructions_executed >= checkpointInterval || fidx_called) {
960
960
checkpoint (m);
961
961
}
@@ -965,11 +965,11 @@ void Debugger::handleSnapshotPolicy(Module *m) {
965
965
if ((fidx_called = isPrimitiveBeingCalled (m, m->pc_ptr ))) {
966
966
const Type *type = m->functions [*fidx_called].type ;
967
967
for (uint32_t i = 0 ; i < type->param_count ; i++) {
968
- prim_args[type->param_count - i - 1 ] = m->stack [m->sp - i].value .uint32 ;
968
+ prim_args[type->param_count - i - 1 ] =
969
+ m->stack [m->sp - i].value .uint32 ;
969
970
}
970
971
}
971
- }
972
- else if (snapshotPolicy != SnapshotPolicy::none) {
972
+ } else if (snapshotPolicy != SnapshotPolicy::none) {
973
973
this ->channel ->write (" WARNING: Invalid snapshot policy." );
974
974
}
975
975
}
@@ -979,7 +979,8 @@ void Debugger::checkpoint(Module *m, bool force) {
979
979
return ;
980
980
}
981
981
982
- this ->channel ->write (R"( CHECKPOINT {"instructions_executed": %d, )" , instructions_executed);
982
+ this ->channel ->write (R"( CHECKPOINT {"instructions_executed": %d, )" ,
983
+ instructions_executed);
983
984
if (fidx_called) {
984
985
this ->channel ->write (" \" fidx_called\" : %d, \" args\" : [" , *fidx_called);
985
986
const Block &func_block = m->functions [*fidx_called];
@@ -1582,7 +1583,8 @@ Debugger::~Debugger() {
1582
1583
delete this ->supervisor ;
1583
1584
}
1584
1585
1585
- std::optional<uint32_t > Debugger::isPrimitiveBeingCalled (Module *m, uint8_t *pc_ptr) {
1586
+ std::optional<uint32_t > Debugger::isPrimitiveBeingCalled (Module *m,
1587
+ uint8_t *pc_ptr) {
1586
1588
if (!pc_ptr) {
1587
1589
return {};
1588
1590
}
@@ -1598,8 +1600,7 @@ std::optional<uint32_t> Debugger::isPrimitiveBeingCalled(Module *m, uint8_t *pc_
1598
1600
}
1599
1601
1600
1602
bool Debugger::handleContinueFor (Module *m) {
1601
- if (remaining_instructions < 0 )
1602
- return false ;
1603
+ if (remaining_instructions < 0 ) return false ;
1603
1604
1604
1605
if (remaining_instructions == 0 ) {
1605
1606
remaining_instructions = -1 ;
@@ -1616,7 +1617,8 @@ bool Debugger::handleContinueFor(Module *m) {
1616
1617
1617
1618
void Debugger::notifyCompleteStep (Module *m) const {
1618
1619
// Upon completing a step in checkpointing mode, make a checkpoint.
1619
- if (m->warduino ->debugger ->getSnapshotPolicy () == SnapshotPolicy::checkpointing) {
1620
+ if (m->warduino ->debugger ->getSnapshotPolicy () ==
1621
+ SnapshotPolicy::checkpointing) {
1620
1622
m->warduino ->debugger ->checkpoint (m);
1621
1623
}
1622
1624
this ->channel ->write (" STEP!\n " );
0 commit comments