More execution work

This commit is contained in:
Adam
2015-02-01 17:49:33 -05:00
parent cec4f0ac59
commit e38b4c5212
15 changed files with 161 additions and 17 deletions

View File

@@ -24,6 +24,16 @@ public class Frame
stack = new Stack(code.getMaxStack());
variables = new Variables(code.getMaxLocals());
}
protected Frame(Path path, Frame other)
{
this.path = path;
this.method = other.method;
this.executing = other.executing;
this.pc = other.pc;
this.stack = new Stack(other.stack);
this.variables = new Variables(other.variables);
}
public Path getPath()
{
@@ -60,7 +70,20 @@ public class Frame
catch (Throwable ex)
{
System.err.println("Error executing instruction in " + method.getName() + " " + method.getDescriptor() + " in class " + method.getMethods().getClassFile().getName() + " at pc " + pc);
throw ex;
System.err.println("Frame stack (grows downward):");
while (stack.getSize() > 0)
{
Instruction stacki = stack.getIns();
Object obj = stack.pop();
if (obj != null)
System.err.println(" " + obj + " (class " + obj.getClass().getName() + ") pushed by instruction " + stacki + " at pc " + stacki.getPc());
else
System.err.println(" " + obj + " pushed by instruction " + stacki + " at pc " + stacki.getPc());
}
System.err.println("end of stack");
ex.printStackTrace();
System.exit(-1);
//throw ex;
}
if (oldPc == pc)