-
Notifications
You must be signed in to change notification settings - Fork 80
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
regs_write() and regs_read() do not return complete results #84
Comments
Thanks for filing the issue! As you pointed out, this will mostly be solved once we fix #68. It seems like you probably have the right idea that we should always call |
Patch by bcantrill. See capstone-rust#84
Just hit this. Are you planning on fixing this? If you are busy, is the fix something I can help with? |
@vn-ki I did not make any plans to implement this myself. I would greatly appreciate help with this! The reason I have not gotten to this is that the support is limited to only a few architectures, which potentially complicates the implementation. Some open questions:
If you open a PR, please reference this issue (#84) and the original #63. |
@tmfink I'll be happy to open a PR. Some ideas:
I think approach 1 would be less confusing for the end user while approach 2 would be more inline with what upstream thinks is idiomatic (which might mean less headaches with future updates). Also with approach 2, maybe the user will have less of a headache if they want these regs to outlive the instruction? Tell me if you think of any of these ones are good or if you had some other ideas? |
@vn-ki Thanks for the proposals. My thoughts after thinking for a few days:
I think I favor approach 1. We already bend over backwards to adapt to Capstone's "interesting" C API. Some notes when implementing:
|
Hi, is @vn-ki still working on this? |
Patch by bcantrill. See capstone-rust#84
The instruction detail provided via
InsnDetail
'sregs_write()
andregs_read()
only return a subset of the registers written to or read from.For example, running the C-based
cstool
:In contrast, running the capstone-rs-based
cstool
:The problem -- alluded to in #63 -- is that the C-based consumers are explicitly calling
cs_regs_access()
while the Rust-based consumers have no way of knowing that this must be called. There are a number of ways of fixing this, but it seems that callinginsn_detail()
should return anInsnDetail
for whichregs_write()
/regs_read()
return correct data -- and therefore thatinsn_detail()
should explicitly make the call tocs_regs_access()
.Here is a diff that implements this:
Running with this diff, the capstone-rs-based
cstool
has the correct results:The text was updated successfully, but these errors were encountered: