foundry-rs / foundry-rs/foundry

[debug] integrate soldb into foundry

Open
#16,557 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

Foundry's built-in debugger is an opcode-level stepper; source-level breakpoints remain a pain point ([#5765](https://github.com/foundry-rs/foundry/issues/5765), [#5510](https://github.com/foundry-rs/foundry/issues/5510)). `soldb` is an ETHDebug-first, LLDB-style Solidity debugger (REPL with `break/step/print`, DAP server, `tx trace/simulate`, per-line gas profiling) that falls back to legacy source maps, if there is no `ETHDebug` generated.

Some potential ways to do it:
- `forge test --debug / forge debug` hand execution to `soldb`, either by linking `soldb-debugger/soldb-repl` (preferred: `forge tests` run in `revm` or `evm2` in-process, so `soldb` can consume forge's step traces directly), or by shelling out to the CLI for on-chain txs (`cast run`)
- forge emits ETHDebug/legacy-source-mappings artifacts and auto-builds the `address:Contract:dir` mappings from its traces
- later: `soldb-dap` for IDE attach

Of course part of the problem is in compiler, so both `solar` and `solc` will need to generate proper debug info, so consumers such as `soldb` can consume it right.

The repo: https://github.com/walnuthq/soldb

Contributor guide

Open the contributing guide

Research direction

Start with Foundry's `forge test --debug`, `forge debug`, and `cast run` entry points, then review the soldb repository and its REPL, trace, and DAP interfaces. Determine how in-process forge traces or emitted ETHDebug/legacy source mappings could be consumed. Done means an agreed integration path and working source-level debugging, with compatible debug information from `solc` and `solar`.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, solidity
Domain
blockchain, devtools, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.