Skip to content

Feature: Implement gadget cache #6328

Draft
MrQuantum1915 wants to merge 3 commits into
rizinorg:devfrom
MrQuantum1915:feat/gadget-cache
Draft

Feature: Implement gadget cache #6328
MrQuantum1915 wants to merge 3 commits into
rizinorg:devfrom
MrQuantum1915:feat/gadget-cache

Conversation

@MrQuantum1915
Copy link
Copy Markdown
Contributor

@MrQuantum1915 MrQuantum1915 commented May 8, 2026

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository.
  • I made sure to follow the project's coding style.
  • I've documented every RZ_API function and struct this PR changes.
  • I've added tests that prove my changes are effective (required for changes to RZ_API).
  • I've updated the Rizin book with the relevant information (if needed).
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

ok so this is requiring way more refactoring than i thought
TODO:

  • refactor seperate filtering from searching (past: apply filter while searching; new : search then filter)
  • implement cache building
  • implement cache hit
  • what about search by address range?
  • max_count config , (seperate filtering from building)?
  • what about gadget len config change?
  • use 3 seperate cache trees for JOP/ROP/COP or ues same tree with a GadgetType TAG maybe?
  • implement forward disassembly or cache hitlist directly
  • complete failing paths
  • is there a leak of global_var_tree ?
  • Option to clear cache
  • cache by default?
  • fix 26 memleaks

Test plan

...

Closing issues

closes #5544

@MrQuantum1915 MrQuantum1915 force-pushed the feat/gadget-cache branch 2 times, most recently from 6323bdd to e64f1a7 Compare May 10, 2026 12:03
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

❌ Patch coverage is 29.05405% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.77%. Comparing base (2d1cff7) to head (937a7aa).

Files with missing lines Patch % Lines
librz/core/gadget.c 27.81% 84 Missing and 12 partials ⚠️
librz/arch/analysis.c 40.00% 9 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
librz/include/rz_analysis.h 77.77% <ø> (ø)
librz/arch/analysis.c 63.59% <40.00%> (-0.48%) ⬇️
librz/core/gadget.c 58.17% <27.81%> (-3.25%) ⬇️

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d1cff7...937a7aa. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MrQuantum1915 MrQuantum1915 force-pushed the feat/gadget-cache branch 2 times, most recently from 873377a to fad34d5 Compare May 11, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement rop.cache to cache ROP gadgets

1 participant