Skip to main content

Module soldb

Module soldb 

Source
Expand description

soldb frontend.

Converts a recorded call trace into a soldb transaction trace and the local artifacts’ source maps into soldb debug info, then runs a soldb session over them or writes them as a bundle that soldb’s own tools read.

Re-exportsΒ§

use alloy_primitives::Address; πŸ”’
use alloy_primitives::B256; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::hex; πŸ”’
use alloy_primitives::keccak256; πŸ”’
use alloy_primitives::map::HashSet; πŸ”’
use eyre::OptionExt; πŸ”’
use eyre::Result; πŸ”’
use foundry_common::ContractsByArtifact; πŸ”’
use foundry_common::Shell; πŸ”’
use foundry_common::fs; πŸ”’
use foundry_common::fs::write_json_file; πŸ”’
use foundry_compilers::artifacts::sourcemap::Jump; πŸ”’
use foundry_compilers::artifacts::sourcemap::SourceElement; πŸ”’
use foundry_compilers::artifacts::sourcemap::SourceMap; πŸ”’
use foundry_compilers::multi::MultiCompilerLanguage; πŸ”’
use foundry_evm_core::Breakpoints; πŸ”’
use foundry_evm_core::ic::PcIcMap; πŸ”’
use foundry_evm_traces::CallTrace; πŸ”’
use foundry_evm_traces::CallTraceArena; πŸ”’
use foundry_evm_traces::CallTraceNode; πŸ”’
use foundry_evm_traces::CallTraceStep; πŸ”’
use foundry_evm_traces::TraceMemberOrder; πŸ”’
use foundry_evm_traces::debug::ArtifactData; πŸ”’
use foundry_evm_traces::debug::ContractSources; πŸ”’
use foundry_evm_traces::debug::DebugRecording; πŸ”’
use foundry_evm_traces::debug::RecordedFrame; πŸ”’
use foundry_evm_traces::debug::SourceData; πŸ”’
use foundry_evm_traces::debug::StepConverter; πŸ”’
use foundry_evm_traces::debug::quantity; πŸ”’
use revm::bytecode::opcode::OpCode; πŸ”’
use revm::interpreter::InstructionResult; πŸ”’
use serde_json::Map; πŸ”’
use serde_json::Value; πŸ”’
use serde_json::json; πŸ”’
use soldb_core::ContractCreation; πŸ”’
use soldb_core::EvmWord; πŸ”’
use soldb_core::ExecutionCall; πŸ”’
use soldb_core::StepRecord; πŸ”’
use soldb_core::StepTable; πŸ”’
use soldb_core::TraceArtifacts; πŸ”’
use soldb_core::TraceCapabilities; πŸ”’
use soldb_core::TransactionTrace; πŸ”’
use soldb_debugger::CodeGenerator; πŸ”’
use soldb_debugger::ContractDebugInfo; πŸ”’
use soldb_debugger::SourceCache; πŸ”’
use soldb_debugger::StorageLayout; πŸ”’
use soldb_ethdebug::EthdebugInfo; πŸ”’
use soldb_ethdebug::Instruction; πŸ”’
use soldb_ethdebug::SourceLocation; πŸ”’
use soldb_ethdebug::SourceMapContext; πŸ”’
use soldb_ethdebug::SourceMapJump; πŸ”’
use soldb_repl::BreakpointTarget; πŸ”’
use soldb_repl::DebuggerCommand; πŸ”’
use soldb_repl::DebuggerState; πŸ”’
use soldb_repl::Output; πŸ”’
use soldb_repl::Renderer; πŸ”’
use soldb_repl::Session; πŸ”’
use soldb_tui::Exit; πŸ”’
use std::borrow::Cow; πŸ”’
use std::collections::BTreeMap; πŸ”’
use std::collections::BTreeSet; πŸ”’
use std::collections::HashMap; πŸ”’
use std::io; πŸ”’
use std::io::IsTerminal; πŸ”’
use std::io::Write; πŸ”’
use std::ops::Range; πŸ”’
use std::path::Component; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use std::sync::Arc; πŸ”’

StructsΒ§

CombinedJson πŸ”’
One contract of a bundle’s combined.json.
ExecutedProgram πŸ”’
A program the trace executes and the local artifact that describes it.
SoldbDebugger πŸ”’
A soldb session over the recorded call traces.
TraceBuilder πŸ”’
Collects the soldb steps, calls, and creations of a trace in execution order.

EnumsΒ§

Flow πŸ”’
What the session asks the frontend to do after a command.

FunctionsΒ§

contract_debug_info πŸ”’
Adapts the source map of program to its instructions, in the ETHDebug shape soldb reads.
emit πŸ”’
Prints the session’s answers.
executed_programs πŸ”’
The programs arenas run that local artifacts describe, once per address and environment.
instruction_context πŸ”’
The ETHDebug context of one source map element: its source range, if the build has the source, and the invoke or return marker of a jump into or out of a function.
open_tui πŸ”’
Opens the full-screen view until the user leaves it.
recorded_steps πŸ”’
The step table that holds the steps of recordings, and where each recording’s steps start in it.
status_error πŸ”’
The error a failed step or call ended with.
transaction_trace πŸ”’
Converts arenas into a soldb trace: their steps in execution order, with each call and creation recorded at the steps it spans.
write_bundle πŸ”’
Writes a bundle that soldb’s own tools read, for example soldb profile --trace-file <dir>/trace.json --contracts <dir>/contracts.json.

Type AliasesΒ§

BreakpointFrames πŸ”’
The frames that run a breakpoint location, as the steps they span and their depth.
BreakpointSteps πŸ”’
The frames that run each breakpoint’s code address and program counter.