Fix problem next'ing over an external method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-10-29 14:08:33 +00:00
parent aa7420b35b
commit a74a6b5fdf

View File

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