Expand description
ETHDebug artifact model: instructions, source spans, and variable locations.
An ETHDebug runtime artifact is a list of instructions, each carrying its program
counter and a context describing the source range it was generated from. Mapping a
program counter back to Solidity means finding its instruction and reading that span.
Spans nest: a compiler attaches a whole-contract range to dispatcher and preamble instructions, so a span containing a given line is not the same thing as a span generated for it. Callers that resolve a source line to a program counter must rank candidates accordingly rather than taking the first intersecting span.
Structs§
- Ethdebug
Info - Ethdebug
Spec - Function
Identity - Instruction
- One instruction of a program and what the compiler says about it.
- Source
Location - Source
MapContext - What a legacy source map says about one instruction, as the ETHDebug context
{"modifierDepth": .., "code": .., "invoke" | "return": {}}says it. - Variable
Location
Enums§
- Function
Exit - Source
MapJump - The jump a legacy source map says an instruction makes.
Functions§
- parse_
compilation_ sources - Maps every source id listed in an ETHDebug
compilationobject to its path. - parse_
ethdebug_ spec - parse_
multi_ contract_ spec - parse_
single_ contract_ spec - parse_
variable_ locations - read_
compilation_ source - Returns the contents of a source embedded in an ETHDebug
compilationobject. - source_
range - The ETHDebug source range of
lengthbytes atoffsetin sourcesource_id, as an instruction context carries it undercode.