Repository navigation
Conversation
Pin foundry-core to foundry-rs/foundry-core#248, which keeps the compiler's ETHDebug programs on artifacts. With `--debugger soldb`, forge, script, and cast request them: always for solar, which emits them for optimized builds, and for solc only through via-IR with the optimizer disabled, with `experimental` set from 0.8.35. The soldb adapter prefers the compiler's program over the legacy source map, and the `--dump` bundle writes the programs in the layout soldb loads. With solc, `experimental` grows the CBOR metadata by 14 bytes; the executed code is unchanged. Refs #16557
|
Just a follow-up on this: soldb also works with older solc versions that don't emit ETHDebug. Without an ETHDebug program, it falls back to the compiler's legacy source map. That still gives lines, functions, frames, breakpoints, and state variables from the storage layout -> https://github.com/walnuthq/soldb#try-it |
Follow the SolDB replacement: every debug run requests ETHDebug, since SolDB is the only debugger. Move the foundry-core pin to the ETHDebug branch merged with current main.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Before: SolDB gets debug info only from legacy source maps, which have no variable locations.
After: debug runs also give SolDB the compiler's ETHDebug programs, which will carry variable locations when compilers emit them (paradigmxyz/solar#1800, argotorg/solidity#16990, walnuthq/soldb#181). Today the programs give the same stops as source maps, so this PR stays a draft.
Change
Stacked on #17429, with foundry-core pinned to foundry-rs/foundry-core#248. Debug runs request ETHDebug: always for solar, and for solc only with via-IR and the optimizer off, which also sets
experimental. The adapter prefers the program over the source map, and--dumpwrites it into the bundle.Downstream
With solc,
experimentaladds 14 bytes to the CBOR metadata of debug builds; the executed code does not change. Before merge, move the foundry-core pin to the merged #248 commit.