#debug #macros

bugsalot

Debugging macros and APIs for shipping stable codebases

10 releases

✓ Uses Rust 2018 edition

0.2.0 Dec 1, 2019
0.1.8 Dec 1, 2019
0.1.4 Jun 30, 2019

#58 in Debugging

Download history 50/week @ 2019-08-18 51/week @ 2019-08-25 33/week @ 2019-09-01 18/week @ 2019-09-08 19/week @ 2019-09-15 32/week @ 2019-09-22 6/week @ 2019-09-29 5/week @ 2019-10-06 16/week @ 2019-10-13 7/week @ 2019-10-20 12/week @ 2019-10-27 5/week @ 2019-11-03 1/week @ 2019-11-10 16/week @ 2019-11-17 16/week @ 2019-11-24

72 downloads per month
Used in 2 crates

MIT/Apache

28KB
371 lines

bugsalot

GitHub Build Status Crates.io unsafe: yes rust: 1.36.0+ Open issues License Docs dependency status

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, ?, Results, 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.

Platforms

Platform Breakpoints Debugger CI Stable Beta Nightly
Windows Supported Supported Tests Status
Android Supported Supported Build Status
Linux Supported Supported Tests Status Status Status
(Release) Status
FreeBSD Untested Untested No
NetBSD Untested Untested No
OS X Untested Untested Tests Status
iOS Untested Untested Build Status
WASM Supported N/A Build Status

Quick Start

Add to your cargo.toml:

[dependencies]
bugsalot = "0.1"

Write your code (see examples and documentation for more code):

use bugsalot::debugger;

fn main() {
    let _ = debugger::wait_until_attached(None); // Wait for a debugger to be attached

    loop {
        let a : Option<i32> = Some(42);
        let b : Result<i32, &'static str> = 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

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.

Dependencies

~0–275KB