-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add Support for BPF arch #144
Conversation
Thank you for the contribution! I'll take a look at your changes. |
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.
Overall the changes look good, but please also add tests in capstone-rs/src/test.rs
.
You can find tests by building/running capstone-sys/capstone/tests/test_bpf.c
.
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.
Please read through the directions in capstone-sys/pre_generated/update-bindings.md
; it looks like this file is unformatted
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #144 +/- ##
==========================================
- Coverage 93.99% 93.35% -0.65%
==========================================
Files 22 23 +1
Lines 2733 2799 +66
Branches 2687 2753 +66
==========================================
+ Hits 2569 2613 +44
- Misses 164 186 +22 ☔ View full report in Codecov by Sentry. |
The BPF arch added in this PR looks good and it should be easy to merge it with my PR. If you decide that this PR lands after my PR, I'll try finish my PR quickly. |
@Lancern If you're fine handling any conflicts, then I'll just "merge" whichever PR is ready first. Also, please don't literally |
Hi @tmfink, I have added some tests and fixed the formatting of the generated 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.
After making the changes, please run cargo fmt
to format the entire repo.
|
||
} | ||
|
||
fn test_ebpf() { |
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.
Also add a test function test_arch_bpf_detail()
that tests the details for each instruction. These test_arch_*_detail()
tests catch a lot of bugs and changes in behavior when we upgrade the C library. For an example, see test_arch_x86_detail()
:
capstone-rs/capstone-rs/src/test.rs
Line 2681 in 7c9a51f
fn test_arch_x86_detail() { |
Hi, are there any plans to merge this PR? I look forward to using this feature. Thanks. |
Hi @tmfink and @chengshuyi I have added the tests requested. Please let me know if there are any more changes needed |
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.
minor issues; I'll clean them up
Thanks for the PR! |
Did some minor clean-up w/ 38bbcce |
Hello,
Thanks for maintaining this project. This PR adds support for BPF in capstone-rs. I regenerated the bindings in capstone-sys using a newer version of bindgen in Cargo.toml since it did not work with clang-16. I am yet to write some tests for the implementation. Please let me know if I am on the right track with this or if I am missing something! :-)