Skip to main content

Crate soldb_repl

Crate soldb_repl 

Source
Expand description

The interactive debugger: its command language, its state machine, and its answers.

DebuggerCommand::parse turns a typed line into a command; a Session runs it and answers with Output values, which Renderer turns into text and serde into JSON. Underneath, DebuggerState holds the trace, the breakpoints, and the position, and DebuggerState::apply_command applies the commands that move or change breakpoints, returning a StepOutcome.

This crate performs no I/O: it neither reads stdin nor prints. The frontend owns the terminal — a line-oriented REPL, a full-screen view, an editor over DAP, a script — and renders what the session answers, which is what makes stepping, breakpoints, command parsing, and the answers themselves testable without a terminal or a node.

The trace is a complete recording, so every movement is a search over it, forward or backward, and a breakpoint is a predicate on a step: a program counter, the start of a source line, the entry of a function, a storage write, a revert, a call, an opcode. Source-level movement comes from soldb_debugger::StepMap, which every frontend shares, so next means the same thing in the terminal and in an editor.

Structs§

ArgumentInfo
Breakpoint
A breakpoint as set, with a stable number the user can delete it by.
BreakpointInfo
CommandSpec
One command’s description: what help prints, and what the parser answers to.
DebuggerState
FrameInfo
ListedLine
LoadedContract
MemoryInfo
MemoryWord
Renderer
Renders Output as lines of text.
ResourceInfo
Session
A debugging session over one trace.
SlotInfo
SourceBreakpointTarget
StepVariables
The variables of the function executing at a step.
Stop
StopLocation
VariableInfo

Enums§

BreakpointEvent
BreakpointKind
BreakpointTarget
What the user asked to break on, before it is resolved against the trace.
CommandGroup
What a command is for, which is how help groups them.
DebuggerCommand
A command as typed, with its arguments parsed.
DebuggerInfoCommand
DisplayMode
Level
Output
One item of a command’s answer.
StateInfo
The state variables at a step, or why there are none to show.
StepOutcome
StopReason
Why the debugger stopped where it did.
ValueStatus
VariablesOrigin
Where a step’s variables came from.

Constants§

COMMANDS
Every command, in the order help lists them.
FRAME_ARGUMENTS_NOTE
The note under FRAME_ARGUMENTS_WARNING.
FRAME_ARGUMENTS_WARNING
What backtrace says once about arguments read off the stack.
LISTING_RADIUS
How many lines list shows on each side of the current one.

Functions§

breakpoint_lines
Whether a breakpoint stops on a source line, for a view that marks lines.
command_spec
The command a word names, by name or alias.
shorten_hex
A long hex word as its first digits: 0x1234....