1
0

ブレークポイントを付けられるようにした

This commit is contained in:
otya128
2016-09-02 22:47:21 +09:00
parent 820009bfb5
commit 0fd1c75b3d
2 changed files with 32 additions and 3 deletions

View File

@@ -110,6 +110,7 @@ class VM
bp = 0;//globalを実行なのでbaseは0(グローバル変数をスタックに取るようにしない限り)(挙動的にスタックに確保していなさそう)
for(pc = 0; pc < this.currentSlot.code.length; pc++)
{
processBreakPoint;
currentSlot.code[pc].execute(this);
}
if(stacki != 0)
@@ -126,10 +127,20 @@ class VM
this.petitcomputer = petitcomputer;
bp = 0;//globalを実行なのでbaseは0(グローバル変数をスタックに取るようにしない限り)(挙動的にスタックに確保していなさそう)
}
void processBreakPoint()
{
if (currentSlot.debugInfo.location[pc].isBreakPoint)
{
//TODO:まともにする
writefln("break point\nslot:%d,pc:%d,line:%d", currentSlotNumber, pc, currentSlot.debugInfo.location[pc].location.line);
readln();
}
}
bool runStep()
{
if(pc < this.currentSlot.code.length)
{
processBreakPoint;
currentSlot.code[pc].execute(this);
pc++;
return true;