-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forge test debugger does not show sourcemaps for inherited contracts #7043
Comments
@DaniPopes any idea if this is related to #6522? I'm pretty sure it's been broken for longer, but something about looking up sourcemaps from inherited contracts is broken at some point. Trying my best to figure out if that's loading the sources when building the debugger or when looking up the pc in the map. |
I've located the issue.
In The problem is that this will never return source code for inherited contracts, because it is only loading source code for (contracts with the same name as) the contract being invoked; if the
|
@emo-eth I having this same issue where the contract source is not loaded. I am reading your comments here but it doesn't mention anything about how to resolve it. Can you share how to get the contract to be loaded on the debug panel? |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (2cf84d9 2024-02-07T00:15:49.638525000Z)
What command(s) is the bug in?
forge test --debug
Operating System
None
Describe the bug
Sourcemaps for inherited contracts are not found/shown by the Forge test debugger.
In this case, the call to the inheriting contract is displayed correctly with sourcemap:
But once the function is dispatched to the inherited contract (
JUMPI
->JUMPDEST
), the debugger reports no sourcemap:Code for minimal repro; run with
forge clean; forge test --debug test_Increment.
Tested with solc0.8.13
and0.8.23
.Counter.sol
AltCounter.sol (inheriting contract)
Counter.t.sol
The text was updated successfully, but these errors were encountered: