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§
- Argument
Info - Breakpoint
- A breakpoint as set, with a stable number the user can delete it by.
- Breakpoint
Info - Command
Spec - One command’s description: what
helpprints, and what the parser answers to. - Debugger
State - Frame
Info - Listed
Line - Loaded
Contract - Memory
Info - Memory
Word - Renderer
- Renders
Outputas lines of text. - Resource
Info - Session
- A debugging session over one trace.
- Slot
Info - Source
Breakpoint Target - Step
Variables - The variables of the function executing at a step.
- Stop
- Stop
Location - Variable
Info
Enums§
- Breakpoint
Event - Breakpoint
Kind - Breakpoint
Target - What the user asked to break on, before it is resolved against the trace.
- Command
Group - What a command is for, which is how
helpgroups them. - Debugger
Command - A command as typed, with its arguments parsed.
- Debugger
Info Command - Display
Mode - Level
- Output
- One item of a command’s answer.
- State
Info - The state variables at a step, or why there are none to show.
- Step
Outcome - Stop
Reason - Why the debugger stopped where it did.
- Value
Status - Variables
Origin - Where a step’s variables came from.
Constants§
- COMMANDS
- Every command, in the order
helplists them. - FRAME_
ARGUMENTS_ NOTE - The note under
FRAME_ARGUMENTS_WARNING. - FRAME_
ARGUMENTS_ WARNING - What
backtracesays once about arguments read off the stack. - LISTING_
RADIUS - How many lines
listshows 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....