pub struct ContractDebugInfo {
pub address: Option<String>,
pub name: String,
pub info: EthdebugInfo,
pub source_contents: BTreeMap<u64, String>,
pub functions: Vec<SourceFunction>,
pub storage_layout: Option<StorageLayout>,
/* private fields */
}Expand description
One contract’s debug information, prepared for stepping: the ETHDebug metadata, the source text, the functions parsed from it, and the indexes that make per-step lookups constant time.
Fields§
§address: Option<String>The deployed address this info describes, lowercase, when known.
name: String§info: EthdebugInfo§source_contents: BTreeMap<u64, String>§functions: Vec<SourceFunction>§storage_layout: Option<StorageLayout>Where the contract’s state variables live, when it was compiled with
--storage-layout.
Implementations§
Source§impl ContractDebugInfo
impl ContractDebugInfo
Sourcepub fn new(
address: Option<&str>,
name: &str,
info: EthdebugInfo,
source_contents: BTreeMap<u64, String>,
) -> Self
pub fn new( address: Option<&str>, name: &str, info: EthdebugInfo, source_contents: BTreeMap<u64, String>, ) -> Self
Prepares one contract’s debug info. Functions are parsed from the source text, which serves ETHDebug and legacy source maps alike: both attach byte ranges of the same sources to instructions.
Sourcepub fn with_storage_layout(self, storage_layout: Option<StorageLayout>) -> Self
pub fn with_storage_layout(self, storage_layout: Option<StorageLayout>) -> Self
Attaches the contract’s storage layout, so state variables can be read by name.
Sourcepub fn function_entry_at_pc(&self, pc: u64) -> Option<usize>
pub fn function_entry_at_pc(&self, pc: u64) -> Option<usize>
The function whose entry point pc is, when it is one.
Sourcepub fn is_jumpdest(&self, pc: u64) -> bool
pub fn is_jumpdest(&self, pc: u64) -> bool
Whether the instruction at pc is a JUMPDEST.
Sourcepub fn jump_marker_at_pc(&self, pc: u64) -> JumpMarker
pub fn jump_marker_at_pc(&self, pc: u64) -> JumpMarker
What the artifact says about the jump the instruction at pc makes.
pub fn source_path(&self, source_id: u64) -> Option<&str>
Sourcepub fn line_of(&self, source_id: u64, offset: u64) -> Option<u64>
pub fn line_of(&self, source_id: u64, offset: u64) -> Option<u64>
The one-based line a byte offset falls on, when the source text is available.
pub fn column_of(&self, source_id: u64, offset: u64) -> Option<u64>
pub fn line_count(&self, source_id: u64) -> Option<u64>
Sourcepub fn line_text(&self, source_id: u64, line: u64) -> Option<&str>
pub fn line_text(&self, source_id: u64, line: u64) -> Option<&str>
The text of one line, without its line ending.
Sourcepub fn location_at_pc(&self, pc: u64) -> Option<SourceLocation>
pub fn location_at_pc(&self, pc: u64) -> Option<SourceLocation>
The source span the compiler attached to the instruction at pc.
Sourcepub fn instruction_at_pc(&self, pc: u64) -> Option<&Instruction>
pub fn instruction_at_pc(&self, pc: u64) -> Option<&Instruction>
The compiler’s instruction at pc, using the prepared index.
Sourcepub fn modifier_depth_at_pc(&self, pc: u64) -> Option<i64>
pub fn modifier_depth_at_pc(&self, pc: u64) -> Option<i64>
Legacy source-map modifier depth at pc, when the artifact carries it.
Sourcepub fn function_for_location(&self, location: &SourceLocation) -> Option<usize>
pub fn function_for_location(&self, location: &SourceLocation) -> Option<usize>
The narrowest parsed function whose declaration contains the span.
pub fn function_at_pc(&self, pc: u64) -> Option<&SourceFunction>
Sourcepub fn effective_line(&self, source_id: u64, line: u64) -> Option<u64>
pub fn effective_line(&self, source_id: u64, line: u64) -> Option<u64>
The line a breakpoint on line of source_id resolves to: the line itself when
the compiler generated code that begins there, otherwise the first line of the
narrowest statement that contains it, or nothing when no code maps to the line.
Ranking matters because solc attaches the whole-contract span to the dispatcher, and that span intersects every line in the file.
Trait Implementations§
Source§impl Clone for ContractDebugInfo
impl Clone for ContractDebugInfo
Source§fn clone(&self) -> ContractDebugInfo
fn clone(&self) -> ContractDebugInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContractDebugInfo
impl Debug for ContractDebugInfo
impl Eq for ContractDebugInfo
Source§impl PartialEq for ContractDebugInfo
impl PartialEq for ContractDebugInfo
impl StructuralPartialEq for ContractDebugInfo
Auto Trait Implementations§
impl Freeze for ContractDebugInfo
impl RefUnwindSafe for ContractDebugInfo
impl Send for ContractDebugInfo
impl Sync for ContractDebugInfo
impl Unpin for ContractDebugInfo
impl UnsafeUnpin for ContractDebugInfo
impl UnwindSafe for ContractDebugInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.