https://github.com/maulingmonkey/bugsalot
Rust macros for bug wrangling.
https://github.com/maulingmonkey/bugsalot
android crate debug debugger linux macros rust wasm windows
Last synced: 12 months ago
JSON representation
Rust macros for bug wrangling.
- Host: GitHub
- URL: https://github.com/maulingmonkey/bugsalot
- Owner: MaulingMonkey
- License: apache-2.0
- Created: 2019-06-20T22:16:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-03T02:14:24.000Z (almost 3 years ago)
- Last Synced: 2025-06-24T19:49:03.767Z (about 1 year ago)
- Topics: android, crate, debug, debugger, linux, macros, rust, wasm, windows
- Language: HTML
- Homepage:
- Size: 75.2 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# bugsalot
[](https://github.com/MaulingMonkey/bugsalot)
[](https://github.com/MaulingMonkey/bugsalot/search?q=unsafe+extension%3Ars)
[](https://gist.github.com/MaulingMonkey/c81a9f18811079f19326dac4daa5a359#minimum-supported-rust-versions-msrv)
[](https://github.com/MaulingMonkey/bugsalot)
[](https://deps.rs/repo/github/MaulingMonkey/bugsalot)
This crate provides macros and methods for bug wrangling. Specifically, I want all the advantages of crashing (bug
reports, ease of debugging, etc.) with none of the drawbacks (lost progress, pissed off gamers, etc). Rust's error
handling mechanisms (`Try`, `?`, `Result`s, etc.) are great, but leave something to be desired when it comes to actual
bugs. Similarly, Rust's `panic!`, `.unwrap()`, `.expect()`, etc. are decent when it comes to giving context for bugs,
but less great for writing stable software. This crate will attempt to bridge the gap.
| Branch | Badges | Notes |
| ------ | ------ | ----- |
| [publish] | [](https://crates.io/crates/bugsalot) [](https://docs.rs/bugsalot/) | Stable/published version
| [master] | [](https://travis-ci.org/MaulingMonkey/bugsalot) [](https://github.com/MaulingMonkey/bugsalot/issues) | "Completed" stuff that hasn't been published.
| wip/* | | "Work In Progress" - incomplete, use at your own risk.
| dead/* | | Abandoned threads of work
[publish]: https://github.com/MaulingMonkey/bugsalot/tree/publish
[master]: https://github.com/MaulingMonkey/bugsalot/tree/master
## Platforms
| Platform | Breakpoints | Debugger | CI | Stable | Beta | Nightly |
| --------- | ----------- | --------- | -- | ------ | ---- | ------- |
| Windows | ![Supported] | ![Supported] | ![Tests] |  |
| Android | ![Supported] | ![Supported] | ![Build] |  |
| Linux | ![Supported] | ![Supported] | ![Tests] |  |  |  |
| (Release) | | | |  |
| FreeBSD | ![Untested] | ![Untested] | ![No] |
| NetBSD | ![Untested] | ![Untested] | ![No] |
| OS X | ![Untested] | ![Untested] | ![Tests] |  |
| iOS | ![Untested] | ![Untested] | ![Build] |  |
| WASM | ![Supported] | ![N/A] | ![Build] |  |
[Supported]: https://img.shields.io/badge/-supported-green.svg
[Untested]: https://img.shields.io/badge/-untested-yellow.svg
[N/A]: https://img.shields.io/badge/-N/A-red.svg
[Tests]: https://img.shields.io/badge/-tests-green.svg
[Build]: https://img.shields.io/badge/-build-yellow.svg
[No]: https://img.shields.io/badge/-no-red.svg
## Quick Start
Add **one** of the following bugsalot dependencies to your Cargo.toml:
```toml
[dependencies]
bugsalot = "0.2" # Or...
bugsalot = { version = "0.2", features = ["wasm-bindgen"] } # If using: wasm-pack
bugsalot = { version = "0.2", features = ["stdweb"] } # If using: cargo web build
```
Write your code (see [examples](examples) and [documentation](https://docs.rs/bugsalot/) for more code):
```rust
use bugsalot::*;
fn main() {
let _ = debugger::wait_until_attached(None); // Wait for a debugger to be attached
loop {
let a : Option = Some(42);
let b : Result = Err("Unavailable");
let a = expect!(a, "Unable to do something or other", return);
let b = expect!(b, "Unable to do something or other", break);
// Debugger will pause on the above line, continuing will break out of the loop
}
expect!(true, "Booleans work too");
}
```
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.