Skip to content

Conversation

@Maijin
Copy link
Member

@Maijin Maijin commented Dec 18, 2025

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.

Gemini 3 Flash / Antigravity

Detailed description
This PR improves the documentation and provides a practical example for the librz/reg module.

Key Changes:

  • Enhanced librz/reg/README.md:
  • **New Example

Copy link
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

I struggle to see how the example covers a common use case.
Because the reg profile on its own is not that important I think?
Could you elaborate on this?

@Maijin
Copy link
Member Author

Maijin commented Dec 19, 2025

I struggle to see how the example covers a common use case.
Because the reg profile on its own is not that important I think?
Could you elaborate on this?

@Rot127 Thanks for the review - Yes I thought of this flow mostly because that way I can then show the whole chain from ingestion of the profile to the manipulation. Most Reg Profiles are actually hardcoded in different part of Rizin code instead of being defined here - perhaps that's something that could be improved in future.

Open for ideas though if you think of a better chain to showcase this library.

@Rot127
Copy link
Member

Rot127 commented Dec 19, 2025

Open for ideas though if you think of a better chain to showcase this library.

For RzReg idk tbh. Don't have an immediate good use case.
But what would be great IMHO are examples which show basic analysis and how to get the results of it.

Something like:

  • Open file
  • Set some configs
  • Analyze it
  • Get all xrefs or similar.

Although this should wait until we have the new analysis ready in a few months.

But what would be useful is an example how to get the RzIL for an instruction.
Because it can be used easily from outside libraries.

@Maijin
Copy link
Member Author

Maijin commented Dec 20, 2025

@Rot127 - Yes I'm tackling each librz/* libs one by one 👍 I'll keep that in mind when working on librz/analysis and friends

@Maijin Maijin force-pushed the docs/reg-readme branch 2 times, most recently from f690b89 to bb20371 Compare December 26, 2025 14:04
@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.76%. Comparing base (24f9e33) to head (80145ed).
⚠️ Report is 36 commits behind head on dev.

Additional details and impacted files

see 8 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 24f9e33...80145ed. 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.

@wargio wargio enabled auto-merge (squash) December 26, 2025 16:13
@wargio wargio disabled auto-merge December 26, 2025 16:13
@notxvilka notxvilka requested review from Rot127 and wargio January 7, 2026 04:38
Comment on lines +75 to +86
## Adding New Register Profiles

To add a new register profile for a supported or new architecture, follow these steps:

1. **Create the Profile File**: Create a new `.sdb.txt` file in `librz/reg/d/`. Use the format described in the "Register Profile Format" section.
2. **Update the Build System**: Open `librz/reg/d/meson.build` and add the base filename (without `.sdb.txt`) to the `sdb_files` list.

```meson
sdb_files = [
'avr-ATmega8-8',
'my-new-arch' # Add your profile here
]
Copy link
Member

@Rot127 Rot127 Jan 7, 2026

Choose a reason for hiding this comment

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

This is not true as far as I can see. The files in reg/d/ map register names to memory addresses.
The register profile is only defined in analysis_ARCH.c as far as I know.

Copy link
Member

Choose a reason for hiding this comment

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

this is related to mmio registers, where for example in AVR the registers are also memory mapped, maybe it should be specified.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, and the docs here say

Use the format described in the "Register Profile Format" section.

Which is not the correct syntax for those files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes actually the LLM had it right in the first place and then I got carried away when I was reviewing it and I changed this by mistake. I'll update this section and separate both.

When I was looking at these I was even thinking that registry profiles should all be moved away from the analysis_ARCH files and moved over here instead of being hardcoded in but that's a different discussion.

Copy link
Member

Choose a reason for hiding this comment

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

Yes actually the LLM had it right in the first place and then I got carried away when I was reviewing it and I changed this by mistake.

This is why I think documentation is written in the best case, while you are actively doing something with the module. So you not just read the code, but interact with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants