You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beside the mapping given for the ast, solc provides bytecode source maps, that can be output by specifying the evm.bytecode.sourceMap/evm.deployedBytecode.sourceMap output selection options.
In that map, each opcode has the following information as a ; separated list:
source file
code region associated (source code byte offset + length)
jump metadata (indicates when a jump goes into a function or returns from a function)
modifier depth (associated to modifiers, entering the _ statement will increase the depth by 1, returning from it will decrease it)
A quick glance at the current outputs, the docs and supported output flags would indicate that this is not supported in zksolc still.
🤔 Rationale
This feature is needed for developers trying to implement debuggers or any tool that analyzes execution and needs to map an execution step back to a place in the source code that produced it.
📋 Additional Context
We are looking to support forge coverage in foundry zksync which outputs test coverage data for functions/statemens/branches/lines. In order to implement this we would need a way to map an instruction being executed on the Era VM to a corresponding part of the contract source code to check what was exactly hit during test execution.
Even though research needs to be done still, this will probably be a requirement to support the debugger as well.
The text was updated successfully, but these errors were encountered:
🌟 Feature Request
📝 Description
Beside the mapping given for the
ast
, solc provides bytecode source maps, that can be output by specifying theevm.bytecode.sourceMap
/evm.deployedBytecode.sourceMap
output selection options.In that map, each opcode has the following information as a
;
separated list:_
statement will increase the depth by 1, returning from it will decrease it)A quick glance at the current outputs, the docs and supported output flags would indicate that this is not supported in
zksolc
still.🤔 Rationale
This feature is needed for developers trying to implement debuggers or any tool that analyzes execution and needs to map an execution step back to a place in the source code that produced it.
📋 Additional Context
We are looking to support forge coverage in foundry zksync which outputs test coverage data for functions/statemens/branches/lines. In order to implement this we would need a way to map an instruction being executed on the Era VM to a corresponding part of the contract source code to check what was exactly hit during test execution.
Even though research needs to be done still, this will probably be a requirement to support the debugger as well.
The text was updated successfully, but these errors were encountered: