-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat!: update rust bindings #2138
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0ab4b7f
fix(mips): lowercase enum name `uc_mips_reg`
amaanq bc7e65c
style(test): use bitflag shorthands
amaanq bcec87a
test(m68k): actually assert an expectation
amaanq b27a2a9
feat(rust): introduce `unicorn-engine-sys` crate
amaanq da3d2fa
feat(rust): add a workspace `Cargo.toml`, and use `unicorn-engine-sys`
amaanq 0dd8783
refactor(rust): remove unnecessary code
amaanq d304da1
feat(rust): add missing `Context` methods
amaanq d1b58ee
feat(rust): add the ability to read the arm coprocessor register
amaanq 46e5332
feat(rust): add a hook for arm64 sys instructions
amaanq 78f2207
feat(rust): add tcg hook
amaanq 7db69a8
feat(rust): add comprehensive tests
amaanq 3059b25
docs(rust): update readme
amaanq 8df938c
fix(rust): correct unsound pointer cast
amaanq c1c7a8f
build(rust): set `rust-version` to 1.85
amaanq feb157b
ci(rust): rework workflow
amaanq edec130
address review
amaanq 04234ae
remove bindings.rs
amaanq dde4d50
alias `uc_mips_reg` to `UC_MIPS_REG`
amaanq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,31 @@ | ||
[package] | ||
name = "unicorn-engine" | ||
[workspace] | ||
default-members = ["bindings/rust"] | ||
members = ["bindings/rust", "bindings/rust/sys"] | ||
resolver = "2" | ||
|
||
[workspace.package] | ||
rust-version = "1.85.0" | ||
version = "2.1.3" | ||
authors = ["Ziqiao Kong", "Lukas Seidel"] | ||
authors = ["Ziqiao Kong", "Lukas Seidel", "Amaan Qureshi <[email protected]>"] | ||
keywords = ["unicorn", "cpu", "emulator", "bindings"] | ||
categories = ["api-bindings", "emulators", "no-std", "virtualization"] | ||
documentation = "https://github.com/unicorn-engine/unicorn/wiki" | ||
edition = "2021" | ||
edition = "2024" | ||
license = "GPL-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/unicorn-engine/unicorn" | ||
description = "Rust bindings for the Unicorn emulator with utility functions" | ||
build = "bindings/rust/build.rs" | ||
links = "unicorn" | ||
# use `cargo publish --list` to see files to be included | ||
# the resulting list what cargo uses to check for out-of-date files during build | ||
exclude = [ | ||
"/docs", | ||
"/bindings/dotnet", | ||
"/bindings/go", | ||
"/bindings/haskell", | ||
"/bindings/java", | ||
"/bindings/pascal", | ||
"/bindings/python", | ||
"/bindings/ruby", | ||
"/bindings/vb6", | ||
"/bindings/zig", | ||
"/samples", | ||
"/tests", | ||
] | ||
|
||
[lib] | ||
path = "bindings/rust/src/lib.rs" | ||
|
||
[dependencies] | ||
bitflags = "2.3.3" | ||
libc = "0.2" | ||
|
||
[build-dependencies] | ||
cc = { version = "1.0" } | ||
cmake = { version = "0.1" } | ||
pkg-config = { version = "0.3" } | ||
|
||
[features] | ||
default = ["arch_all"] | ||
dynamic_linkage = [] | ||
arch_all = ["arch_x86", "arch_arm", "arch_aarch64", "arch_riscv", "arch_mips", "arch_sparc", "arch_m68k", "arch_ppc", "arch_s390x", "arch_tricore"] | ||
arch_x86 = [] | ||
arch_arm = [] | ||
# NOTE: unicorn-c only separates on top-level arch name, | ||
# not on the bit-length, so we include both arm and aarch64 | ||
arch_aarch64 = ["arch_arm"] | ||
arch_riscv = [] | ||
arch_mips = [] | ||
arch_sparc = [] | ||
arch_m68k = [] | ||
arch_ppc = [] | ||
arch_s390x = [] | ||
arch_tricore = [] | ||
[workspace.lints.clippy] | ||
cast_lossless = "allow" | ||
cast_possible_truncation = "allow" | ||
cast_possible_wrap = "allow" | ||
cast_sign_loss = "allow" | ||
missing_errors_doc = "allow" | ||
missing_panics_doc = "allow" | ||
similar_names = "allow" | ||
unreadable_literal = "allow" | ||
use_self = "allow" | ||
pedantic = { level = "warn", priority = -1 } | ||
nursery = { level = "warn", priority = -1 } | ||
cargo = { level = "warn", priority = -1 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[package] | ||
name = "unicorn-engine" | ||
version.workspace = true | ||
authors.workspace = true | ||
keywords.workspace = true | ||
categories.workspace = true | ||
documentation.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
readme = "README.md" | ||
repository.workspace = true | ||
description.workspace = true | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
unicorn-engine-sys = { version = "2.1.3", path = "sys", features = [], default-features = false } | ||
|
||
[build-dependencies] | ||
bindgen = "0.71.1" | ||
cc = { version = "1.2.17" } | ||
cmake = { version = "0.1.54" } | ||
pkg-config = { version = "0.3.32" } | ||
|
||
[dev-dependencies] | ||
page_size = "0.6.0" | ||
|
||
[features] | ||
default = ["arch_all"] | ||
dynamic_linkage = ["unicorn-engine-sys/dynamic_linkage"] | ||
arch_all = [ | ||
"arch_x86", | ||
"arch_arm", | ||
"arch_aarch64", | ||
"arch_riscv", | ||
"arch_mips", | ||
"arch_sparc", | ||
"arch_m68k", | ||
"arch_ppc", | ||
"arch_s390x", | ||
"arch_tricore", | ||
] | ||
arch_x86 = ["unicorn-engine-sys/arch_x86"] | ||
arch_arm = ["unicorn-engine-sys/arch_arm"] | ||
arch_aarch64 = ["arch_arm", "unicorn-engine-sys/arch_aarch64"] | ||
arch_riscv = ["unicorn-engine-sys/arch_riscv"] | ||
arch_mips = ["unicorn-engine-sys/arch_mips"] | ||
arch_sparc = ["unicorn-engine-sys/arch_sparc"] | ||
arch_m68k = ["unicorn-engine-sys/arch_m68k"] | ||
arch_ppc = ["unicorn-engine-sys/arch_ppc"] | ||
arch_s390x = ["unicorn-engine-sys/arch_s390x"] | ||
arch_tricore = ["unicorn-engine-sys/arch_tricore"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.