Skip to content

Feat/function address mapping#41

Merged
ERoydev merged 4 commits intoLimeChain:mainfrom
ERoydev:feat/function-address-mapping
Aug 12, 2025
Merged

Feat/function address mapping#41
ERoydev merged 4 commits intoLimeChain:mainfrom
ERoydev:feat/function-address-mapping

Conversation

@ERoydev
Copy link
Copy Markdown
Collaborator

@ERoydev ERoydev commented Aug 11, 2025

What

  1. I have implemented breakpoints to be set on address instead of line.
  2. When user have set his breakpoints he use command to start agave-ledger-tool on a specific breakpoint.
  3. It runs the agave-ledger-tool using the input.json user have created for the specific function.
  4. Starts stepping using next

Plan

  • Implement breakpoint setting based on instruction address rather than source line(bp.location), since only one instruction can be debugged per run.

  • Ensure that when hitting a breakpoint in a different instruction, the user restarts agave-ledger-tool to load the new instruction input.

  • Enable solana-lldb to reuse the same .debug symbols and reconnect automatically on each new breakpoint.

What has been done

  1. Breakpoints are now set on instruction addresses instead of source lines.
  2. After user sets breakpoints, they start agave-ledger-tool targeting a specific breakpoint.
  3. The tool runs with user-provided input JSON matching the instruction.

Step-through debugging is started when user uses Continue process or type continue in solanaLLDB

Usage Rules

  • User must create an input folder with a .json file per instruction named exactly after the instruction, e.g. input/initialize.json for pub fn initialize.

  • User must have Solana toolchain and LLVM tools (llvm-objdump, solana-lldb) in their system PATH.

  • Breakpoints can only be set inside lib.rs.

For native Solana programs, instructions to debug must have #[no_mangle] and #[inline(never)] annotations to ensure proper symbol visibility and debugging.

@ERoydev ERoydev requested a review from failfmi August 11, 2025 13:40
Comment thread extension.js Outdated
Comment thread extension.js
}

async function startSolanaDebugger() {
// TODO: Maybe these can be moved to a separate config file with all the validation checks
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't implemented that yet, because i try to follow the mindset of applying the smallest changes possible in the code in order to not introduce new bugs and issues.

Comment thread extension.js
@ERoydev ERoydev merged commit 78416f5 into LimeChain:main Aug 12, 2025
@ERoydev ERoydev deleted the feat/function-address-mapping branch October 6, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants