-
-
Notifications
You must be signed in to change notification settings - Fork 495
doc(reg): improve README and add examples #5637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Rot127
left a comment
There was a problem hiding this 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?
@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. |
For RzReg idk tbh. Don't have an immediate good use case. Something like:
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. |
|
@Rot127 - Yes I'm tackling each librz/* libs one by one 👍 I'll keep that in mind when working on librz/analysis and friends |
f690b89 to
bb20371
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filessee 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
bb20371 to
80145ed
Compare
80145ed to
a96d0fe
Compare
| ## 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 | ||
| ] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Gemini 3 Flash / Antigravity
Detailed description
This PR improves the documentation and provides a practical example for the
librz/regmodule.Key Changes:
librz/reg/README.md: