I am trying to debug a contract on Remix IDE:
pragma solidity ^0.5.1;
contract DebuggerSampleContract{
int counter = 10;
function LoopCounter(int _input) public view returns (int) {
int returnValue;
for(; _input <counter; _input++)
{
returnValue += _input;
}
returnValue;
}
}
I selected following steps: 1. Solidity Compiler, 2. Compile DebuggerSampleContract.sol, 3. Deployand Run Transactions, 4. Deploy, 5. Clicked arrow to see the function, 6. Debug, 7. Step over (whole contract got selected), 8. step Over, only the value 10 selected, 9. Step Over, It did not enter the function, instead it went to pragma statement.
@goodvibration Based upon the comments, I changed the contract to:
contract DebuggerSampleContract{
int counter = 10;
constructor(int _input) public{
int returnValue;
for(; _input <counter; _input++)
{
returnValue += _input;
}
//returnValue;
}
}
I started debugging and put the constructor argument to 6. When I pressed debug, it showed me machine language instructions i.e. EVM bytecode. I pressed "Step forward" but I don't know how to keep track of the local variables and state variables through bytecode.
Somebody please guide me.
Zulfi.