cargo-compiler-interrupts

crates.io docs.rs license

cargo-compiler-interrupts provides you a seamless way to integrate the Compiler Interrupts to any Rust packages. Check out the Compiler Interrupts main repository for more info.

Requirements

Installation

cargo-compiler-interrupts is a Cargo package and can be installed via cargo install.

sh cargo install cargo-compiler-interrupts

You can also fetch the repo and install using --path.

sh git clone https://github.com/bitslab/cargo-compiler-interrupts cargo install --path ./cargo-compiler-interrupts

Getting started

cargo-compiler-interrupts provides three subcommands:

sh cargo lib-ci --install # install the CI library cargo build-ci # build and integrate CI to the binary cargo run-ci # run the CI-integrated binary

Make sure your program registers the Compiler Interrupts handler before running cargo build-ci. Compiler Interrupts APIs are provided through the compiler-interrupts package.

``` rust fn interrupt_handler(ic: i64) { println!("Compiler interrupt called with instruction count: {}", ic); }

unsafe { compilerinterrupts::register(1000, 1000, interrupthandler); } ```

For more detailed usages and internals, run the command with --help option and check out the documentation.

Contribution

All issue reports, feature requests, pull requests and GitHub stars are welcomed and much appreciated. Issues relating to the Compiler Interrupts integration should be reported to the main repository.

Author

Quan Tran (@quanshousio)

Acknowledgements

License

cargo-compiler-interrupts is available under the MIT license. See the LICENSE file for more info.