evm
evm copied to clipboard
Discovering source position information during tracing
This is more like a question than an issue.
I'm building a compiler from Move to EVM with Yul as the intermediate language. We are using Sputnik (for now) as a backend for various test scenarios, as we are developing in Rust. It works pretty well for us.
When using evm_runtime::tracing, is there a way to get hand one the source position information of a step? Not sure whether the handling of source positions is more like an internal of Solidity/Yul. or part of the EVM semantics.
@vgao1996
The EVM only execute bunch of byte codes so the best you can get is the index of the executing byte code. However you can then use source map to get the line information from the byte code indexhttps://docs.soliditylang.org/en/v0.8.12/internals/source_mappings.html