-
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
[WIP] Compile-time Target Architecture Tags #143
Draft
Lancern
wants to merge
6
commits into
capstone-rust:master
Choose a base branch
from
Lancern:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on Aug 5, 2023
-
Add ArchTag trait and its implementations for supported architectures
This commit is the first commit among a series of patches that implement the compile-time architecture tag proposal in capstone-rust#118. It contains the following major changes: - Add the ArchTag trait. This trait indicates a "tag" type that represents a specific architecture. Its associated types specify specific data types corresponding to the architecture it represents. - Add ArchTag implementations for supported architectures, and a special DynamicArchTag that indicates the target architecture is unknown at compile time. - Update existing general type definitions (e.g. Capstone, Insn, etc.) to acquire a general arch tag type parameter.
Configuration menu - View commit details
-
Copy full SHA for 182e5a0 - Browse repository at this point
Copy the full SHA 182e5a0View commit details
Commits on Aug 20, 2023
-
Convert arch insn group and reg type to newtype enums
This commit changes the bindgen settings so that bindgen generates newtype enums instead of modules of constants for arch insn group types and reg types. Usages of these binding types are updated as well.
Configuration menu - View commit details
-
Copy full SHA for 260f346 - Browse repository at this point
Copy the full SHA 260f346View commit details
Commits on Aug 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 061994f - Browse repository at this point
Copy the full SHA 061994fView commit details
Commits on Aug 29, 2023
-
Make examples and benches compile
This commit contains changes that make existing examples and benches compile with the latest API design. Unit tests will be covered in later commits. The primary changes include: - Implement DetailArchInsn for ArchDetail. - Add ArchOperandIterator enum that iterates values of ArchOperand inside an ArchDetail. The enum is basically a wrapper that holds all available arch- specific operand iterators in different variants. This commit also contains some refactors and minor changes, including: - Rename ArchDetail to ArchInsnDetail as the old name is a bit confusing. - Fully add sysz support. - Update existing examples and benches. In most cases, to migrate these existing examples and benches, I just need to add a small number of generic type arguments (e.g. X86ArchTag, ArmArchTag, DynamicArchTag, etc.) and the code just compiles.
Configuration menu - View commit details
-
Copy full SHA for 3422ee7 - Browse repository at this point
Copy the full SHA 3422ee7View commit details
Commits on Aug 31, 2023
-
Make unit tests compile and pass all tests
This commit fixes a minor problem that prevents tests from compiling and running to success. Arch-specific register IDs (represented by ArchTag::RegId) and instruction group IDs (represented by ArchTag::InsnGroupId) are generated as newtype structs whose inner type is c_uint because their C definition are just C enums. However, in a cs_detail struct, the regs_read field is an array of u16, not an array of c_uint. So we cannot just type pun on the underlying array to get &[A::RegId] because the layout is totally different. The similar problem exists for InsnDetail::regs_write and InsnDetail::groups. This commit fixes the problem by making these function return an Iterator rather than a slice. The iterator will map the underlying array elements to actual arch-specific types when iterated.
Configuration menu - View commit details
-
Copy full SHA for 445e43a - Browse repository at this point
Copy the full SHA 445e43aView commit details
Commits on Oct 16, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5cd9258 - Browse repository at this point
Copy the full SHA 5cd9258View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.