Skip to content

Add all call and other xrefs to the abl output#6269

Draft
Rot127 wants to merge 8 commits into
rizinorg:devfrom
Rot127:abl
Draft

Add all call and other xrefs to the abl output#6269
Rot127 wants to merge 8 commits into
rizinorg:devfrom
Rot127:abl

Conversation

@Rot127

@Rot127 Rot127 commented Apr 21, 2026

Copy link
Copy Markdown
Member

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

The abl (list all basic blocks) command has a column which lists the call targets from a basic block.
It gets the call targets by disassembling each instruction in it and checks if it is a call. Then adds op.jump to the list of calls.

This method fails though if the call is indirect (no statically known target), but there were some added during dynamic analysis.
Those xrefs are added now.

Additionally, this fixes a bug. Because the xref column was filled with the call targets 🙄

Test plan

All green, possibly fix some tests.

Closing issues

...

notxvilka

This comment was marked as resolved.

@Rot127

This comment was marked as resolved.

@Rot127 Rot127 marked this pull request as draft April 21, 2026 18:41
@Rot127 Rot127 marked this pull request as ready for review May 30, 2026 16:10
@Rot127 Rot127 changed the title Add known call xregs to a block's call list Add all call and other xrefs to the abl output May 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the abl basic-block listing command so call targets and xrefs are gathered more accurately, including call xrefs discovered by analysis for indirect calls.

Changes:

  • Adds rz_analysis_op_is_call() as a reusable analysis helper.
  • Switches abl call/xref collection to RzSetU, deduplicating addresses.
  • Fixes the table xrefs column to use actual xrefs and updates command tests.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
librz/arch/analysis.c Adds the new call-detection helper implementation.
librz/include/rz_analysis.h Declares the new rz_analysis_op_is_call() API.
librz/core/cmd/cmd_analysis.c Updates abl xref/call collection and output formatting.
test/db/cmd/cmd_ab Updates expected ablt table output for deduplicated calls and corrected xrefs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread librz/core/cmd/cmd_analysis.c Outdated
Comment thread librz/core/cmd/cmd_analysis.c Outdated
Comment thread librz/core/cmd/cmd_analysis.c Outdated
Rot127 and others added 3 commits May 31, 2026 17:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.45455% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.25%. Comparing base (b784b16) to head (6a213cd).
⚠️ Report is 21 commits behind head on dev.

Files with missing lines Patch % Lines
librz/core/cmd/cmd_analysis.c 85.41% 2 Missing and 5 partials ⚠️
librz/arch/analysis.c 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
librz/arch/block.c 83.16% <100.00%> (+0.02%) ⬆️
librz/include/rz_analysis.h 77.77% <ø> (ø)
librz/arch/analysis.c 64.31% <83.33%> (+0.13%) ⬆️
librz/core/cmd/cmd_analysis.c 52.77% <85.41%> (+0.60%) ⬆️

... and 46 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b784b16...6a213cd. 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.

Comment thread librz/arch/analysis.c Outdated
@Rot127 Rot127 force-pushed the abl branch 2 times, most recently from de2d87b to 2f6cfff Compare June 3, 2026 15:19
@Rot127 Rot127 marked this pull request as draft June 3, 2026 15:22
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.

4 participants