capstone-rust / capstone-rs

high-level Capstone system bindings for Rust
217 stars 75 forks source link

capstone: add support for cs_ac_type in x86 #76

Closed hghwng closed 4 years ago

hghwng commented 4 years ago

I don't think that generating cs_ac_type as an enum is a good option — it's a bitflag in fact. I had to write a ton of if-else as a workaround. Suggestions are appreciated!

hghwng commented 4 years ago

Hmm, I forgot the test :sweat_smile: Now it's fixed!

codecov[bot] commented 4 years ago

Codecov Report

Merging #76 into master will increase coverage by 0.44%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
+ Coverage   93.85%   94.29%   +0.44%     
==========================================
  Files          20       20              
  Lines        2700     2979     +279     
==========================================
+ Hits         2534     2809     +275     
- Misses        166      170       +4
Impacted Files Coverage Δ
capstone-rs/src/instruction.rs 91.26% <100%> (+3.18%) :arrow_up:
capstone-rs/src/arch/x86.rs 99.53% <100%> (-0.47%) :arrow_down:
capstone-rs/src/test.rs 96.62% <100%> (+0.61%) :arrow_up:
capstone-rs/src/error.rs 63.41% <0%> (-1.59%) :arrow_down:
capstone-rs/src/arch/m68k.rs 91.94% <0%> (+0.15%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ba6f9a...cea9bac. Read the comment docs.

tmfink commented 4 years ago

Thanks for the PR! I just posted some review comments. Ask me if you have any questions.

tmfink commented 4 years ago

To update capstone-sys pre-generated bindings:

hghwng commented 4 years ago

Thanks for the thoughtful comments — I learned a lot! I'll work on it soon.

hghwng commented 4 years ago

How about this?

tmfink commented 4 years ago

@hghwng any update?

hghwng commented 4 years ago

@tmfink Sorry about the long delay. On the other hand, the delay helps me to reread and rethink your thoughtful comments. Now all of them makes sense :+1:

tmfink commented 4 years ago

@hghwng great work! Thanks again.