pub struct EthdebugInfo {
pub compilation: Value,
pub contract_name: String,
pub environment: String,
pub instructions: Vec<Instruction>,
pub sources: BTreeMap<u64, String>,
pub variable_locations: BTreeMap<u64, Vec<VariableLocation>>,
}Fields§
§compilation: Value§contract_name: String§environment: String§instructions: Vec<Instruction>§sources: BTreeMap<u64, String>§variable_locations: BTreeMap<u64, Vec<VariableLocation>>Implementations§
Source§impl EthdebugInfo
impl EthdebugInfo
Sourcepub fn from_artifacts(
contract_name: &str,
environment: &str,
metadata: &Value,
program: &Value,
) -> SoldbResult<Self>
pub fn from_artifacts( contract_name: &str, environment: &str, metadata: &Value, program: &Value, ) -> SoldbResult<Self>
Builds the debug info for one contract from already-parsed ETHDebug artifacts.
metadata is the global resource file (ethdebug.json from older compilers,
ethdebug_resources.json from modern ones) and program is the contract’s
program artifact (<Contract>_ethdebug.json for creation code,
<Contract>_ethdebug-runtime.json for runtime code). Nothing is read from disk
here, so the CLI, the DAP server, and any host that receives the artifacts as
strings all build the same value through this one path.
A program without an instructions array yields no instructions rather than an
error; callers that need to know report it as a debug-info gap.
pub fn instruction_at_pc(&self, pc: u64) -> Option<&Instruction>
pub fn source_info(&self, pc: u64) -> Option<(&str, u64, u64)>
Sourcepub fn has_variable_locations(&self) -> bool
pub fn has_variable_locations(&self) -> bool
Whether the artifact carries variable locations at all.
No compiler release emits them yet, so this is usually false, and the difference matters to a user: nothing in scope at one program counter is not the same as a compiler that describes no variables anywhere.
pub fn variables_at_pc(&self, pc: u64) -> Vec<&VariableLocation>
Trait Implementations§
Source§impl Clone for EthdebugInfo
impl Clone for EthdebugInfo
Source§fn clone(&self) -> EthdebugInfo
fn clone(&self) -> EthdebugInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more