// If this is a call instruction, step over the call instruction...
// TODO: ICALL, CALL WITH, ...
if ((*ECStack.back().CurInst)->getOpcode() == Instruction::Call) {
+ unsigned StackSize = ECStack.size();
// Step into the function...
if (executeInstruction()) {
// Hit a breakpoint, print current instruction, then return to user...
return;
}
- // Finish executing the function...
- finish();
+ // If we we able to step into the function, finish it now. We might not be
+ // able the step into a function, if it's external for example.
+ if (ECStack.size() != StackSize)
+ finish(); // Finish executing the function...
+
} else {
// Normal instruction, just step...
stepInstruction();