Use eBPF files for debugging instead of executable created from tests#38
Merged
failfmi merged 3 commits intoLimeChain:mainfrom Jul 30, 2025
Merged
Conversation
failfmi
previously approved these changes
Jul 30, 2025
5442ec1 to
5097b5c
Compare
a3e3e2a to
453617b
Compare
…ad of cargo test executable ones Signed-off-by: ERoydev <e.roydev@gmail.com>
Signed-off-by: ERoydev <e.roydev@gmail.com>
Signed-off-by: ERoydev <e.roydev@gmail.com>
453617b to
1e22b9d
Compare
failfmi
approved these changes
Jul 30, 2025
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.
What
I have implemented a debugging workflow using
agave-ledger-toolandsolana-lldbto debug the eBPF compiled files directly.The previous approach relied on running a binary executable created with cargo test --no-run ..., which only allowed debugging in a Rust environment.
Why
Our goal is to build a debugger that can debug Solana programs "on-chain"—that is, running on a local ledger—so we can inspect the actual deployed program behavior rather than just the Rust code.
This approach provides a more accurate and realistic debugging experience, closer to production conditions.
Here is what is happening
User first starts his
solana-local-validatorThen:
cargo build-sbf --debugto create sBPF.soand.debugstripped files..sofile on a local ledger usingagave-ledger-toolin debug mode, starting a GDB remote server (usually on port 9001) forsolana-lldbto attach and control execution.solana-lldband attach it to that GDB remote port, loading the.debugfile for debugging.Now, the user can observe what is actually happening on-chain by reading the executed opcodes and instructions.
Limitations / Next steps: