|
@ -17,11 +17,10 @@ function init() |
|
|
select(currentSelectedState); |
|
|
select(currentSelectedState); |
|
|
//displayReturnValue();
|
|
|
//displayReturnValue();
|
|
|
|
|
|
|
|
|
jumpoutbackaction.state = "disabled"; |
|
|
jumpoutbackaction.enabled(false); |
|
|
jumpintobackaction.state = "disabled"; |
|
|
jumpintobackaction.enabled(false); |
|
|
jumpintoforwardaction.state = "disabled" |
|
|
jumpintoforwardaction.enabled(false); |
|
|
jumpoutforwardaction.state = "disabled" |
|
|
jumpoutforwardaction.enabled(false); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function moveSelection(incr) |
|
|
function moveSelection(incr) |
|
@ -29,13 +28,8 @@ function moveSelection(incr) |
|
|
if (currentSelectedState + incr >= 0) |
|
|
if (currentSelectedState + incr >= 0) |
|
|
{ |
|
|
{ |
|
|
if (currentSelectedState + incr < debugStates.length) |
|
|
if (currentSelectedState + incr < debugStates.length) |
|
|
{ |
|
|
|
|
|
select(currentSelectedState + incr); |
|
|
select(currentSelectedState + incr); |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
//endOfDebug();
|
|
|
|
|
|
} |
|
|
|
|
|
statesSlider.value = currentSelectedState; |
|
|
statesSlider.value = currentSelectedState; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -47,18 +41,16 @@ function select(stateIndex) |
|
|
highlightSelection(codeLine); |
|
|
highlightSelection(codeLine); |
|
|
currentSelectedState = stateIndex; |
|
|
currentSelectedState = stateIndex; |
|
|
completeCtxInformation(state); |
|
|
completeCtxInformation(state); |
|
|
//levelList.model = state.levels;
|
|
|
|
|
|
//levelList.update();
|
|
|
|
|
|
|
|
|
|
|
|
if (state.instruction === "JUMP") |
|
|
if (state.instruction === "JUMP") |
|
|
jumpintoforwardaction.state = ""; |
|
|
jumpintoforwardaction.enabled(true); |
|
|
else |
|
|
else |
|
|
jumpintoforwardaction.state = "disabled"; |
|
|
jumpintoforwardaction.enabled(false); |
|
|
|
|
|
|
|
|
if (state.instruction === "JUMPDEST") |
|
|
if (state.instruction === "JUMPDEST") |
|
|
jumpintobackaction.state = ""; |
|
|
jumpintobackaction.enabled(true); |
|
|
else |
|
|
else |
|
|
jumpintobackaction.state = "disabled"; |
|
|
jumpintobackaction.enabled(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function codeStr(stateIndex) |
|
|
function codeStr(stateIndex) |
|
@ -78,23 +70,13 @@ function completeCtxInformation(state) |
|
|
basicInfo.mem = state.newMemSize + " " + qsTr("words"); |
|
|
basicInfo.mem = state.newMemSize + " " + qsTr("words"); |
|
|
basicInfo.stepCost = state.gasCost; |
|
|
basicInfo.stepCost = state.gasCost; |
|
|
basicInfo.gasSpent = debugStates[0].gas - state.gas; |
|
|
basicInfo.gasSpent = debugStates[0].gas - state.gas; |
|
|
// This is available in all editors.
|
|
|
|
|
|
stack.listModel = state.debugStack; |
|
|
stack.listModel = state.debugStack; |
|
|
storage.listModel = state.debugStorage; |
|
|
storage.listModel = state.debugStorage; |
|
|
memoryDump.listModel = state.debugMemory; |
|
|
memoryDump.listModel = state.debugMemory; |
|
|
callDataDump.listModel = state.debugCallData; |
|
|
callDataDump.listModel = state.debugCallData; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function endOfDebug() |
|
|
|
|
|
{ |
|
|
|
|
|
var state = debugStates[debugStates.length - 1]; |
|
|
|
|
|
debugStorageTxt.text = ""; |
|
|
|
|
|
debugCallDataTxt.text = ""; |
|
|
|
|
|
debugStackTxt.text = ""; |
|
|
|
|
|
debugMemoryTxt.text = state.endOfDebug; |
|
|
|
|
|
headerInfoLabel.text = "EXIT | GAS: " + state.gasLeft; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function displayReturnValue() |
|
|
function displayReturnValue() |
|
|
{ |
|
|
{ |
|
|
headerReturnList.model = contractCallReturnParameters; |
|
|
headerReturnList.model = contractCallReturnParameters; |
|
@ -107,8 +89,8 @@ function stepOutBack() |
|
|
{ |
|
|
{ |
|
|
select(jumpStartingPoint); |
|
|
select(jumpStartingPoint); |
|
|
jumpStartingPoint = null; |
|
|
jumpStartingPoint = null; |
|
|
jumpoutbackaction.state = "disabled"; |
|
|
jumpoutbackaction.enabled(false); |
|
|
jumpoutforwardaction.state = "disabled"; |
|
|
jumpoutforwardaction.enabled(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -162,8 +144,8 @@ function stepIntoForward() |
|
|
{ |
|
|
{ |
|
|
jumpStartingPoint = currentSelectedState; |
|
|
jumpStartingPoint = currentSelectedState; |
|
|
moveSelection(1); |
|
|
moveSelection(1); |
|
|
jumpoutbackaction.state = ""; |
|
|
jumpoutbackaction.enabled(true); |
|
|
jumpoutforwardaction.state = ""; |
|
|
jumpoutforwardaction.enabled(true); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -173,8 +155,8 @@ function stepOutForward() |
|
|
{ |
|
|
{ |
|
|
stepOutBack(); |
|
|
stepOutBack(); |
|
|
stepOverForward(); |
|
|
stepOverForward(); |
|
|
jumpoutbackaction.state = "disabled"; |
|
|
jumpoutbackaction.enabled(false); |
|
|
jumpoutforwardaction.state = "disabled"; |
|
|
jumpoutforwardaction.enabled(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|