Skip to content

Commit 16d3e97

Browse files
committed
Got rid of unneeded use of prev_pc_ptr
1 parent 9ce16b4 commit 16d3e97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Debug/debugger.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Debugger::Debugger(Channel *duplex) {
2626
this->checkpointInterval = 10;
2727
this->instructions_executed = 0;
2828
this->remaining_instructions = -1;
29-
this->prev_pc_ptr = nullptr;
3029
this->fidx_called = {};
3130
}
3231

@@ -961,12 +960,11 @@ void Debugger::handleSnapshotPolicy(Module *m) {
961960
checkpoint(m);
962961
}
963962
instructions_executed++;
964-
prev_pc_ptr = m->pc_ptr;
965963

966964
// Store arguments of last primitive call.
967965
if ((fidx_called = isPrimitiveBeingCalled(m, m->pc_ptr))) {
968966
const Type *type = m->functions[*fidx_called].type;
969-
for (int32_t i = 0; i < type->param_count; i++) {
967+
for (uint32_t i = 0; i < type->param_count; i++) {
970968
prim_args[type->param_count - i - 1] = m->stack[m->sp - i].value.uint32;
971969
}
972970
}

src/Debug/debugger.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ class Debugger {
127127
bool connected_to_proxy = false;
128128
warduino::mutex *supervisor_mutex;
129129

130+
// Mocking
130131
std::unordered_map<uint32_t, std::unordered_map<uint32_t, uint32_t>>
131132
overrides;
132133

134+
// Checkpointing
133135
SnapshotPolicy snapshotPolicy;
134136
uint32_t checkpointInterval;
135137
uint32_t instructions_executed;

0 commit comments

Comments
 (0)