From 3401b8e3a6c461e75cc73aaae1e47046eb481399 Mon Sep 17 00:00:00 2001 From: pjht Date: Fri, 29 Sep 2023 15:47:39 -0500 Subject: [PATCH] Commit work --- Cargo.toml | 6 ----- cdylib/Cargo.toml | 12 ---------- cdylib/src/lib.rs | 8 ------- example/Cargo.toml | 8 ------- example/src/main.rs | 56 --------------------------------------------- 5 files changed, 90 deletions(-) delete mode 100644 cdylib/Cargo.toml delete mode 100644 cdylib/src/lib.rs delete mode 100644 example/Cargo.toml delete mode 100644 example/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 973fa00..b27aef4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,6 @@ license = "MIT OR Apache-2.0" description = "Unwinding library in Rust and for Rust" repository = "https://github.com/nbdd0121/unwinding/" -[workspace] -members = ["cdylib", "example"] - [dependencies] gimli = { version = "0.26.1", default-features = false, features = ["read-core"] } libc = { version = "0.2", optional = true } @@ -36,8 +33,5 @@ panic-handler-dummy = [] system-alloc = [] default = ["unwinder", "dwarf-expr", "hide-trace", "fde-phdr-dl", "fde-registry"] -[profile.release] -debug = true - [package.metadata.docs.rs] features = ["panic-handler"] diff --git a/cdylib/Cargo.toml b/cdylib/Cargo.toml deleted file mode 100644 index e79d1b9..0000000 --- a/cdylib/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "unwinding_dyn" -version = "0.1.0" -authors = ["Gary Guo "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -unwinding = { path = "../", features = ["system-alloc", "personality-dummy", "panic-handler-dummy"] } -libc = "0.2" diff --git a/cdylib/src/lib.rs b/cdylib/src/lib.rs deleted file mode 100644 index 71cdd2e..0000000 --- a/cdylib/src/lib.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![no_std] -#![feature(default_alloc_error_handler)] -#![warn(rust_2018_idioms)] -#![warn(unsafe_op_in_unsafe_fn)] - -// Keep this explicit -#[allow(unused_extern_crates)] -extern crate unwinding; diff --git a/example/Cargo.toml b/example/Cargo.toml deleted file mode 100644 index 6a6b603..0000000 --- a/example/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "example" -version = "0.1.0" -edition = "2018" - -[dependencies] -unwinding = { path = "../", features = ["system-alloc", "personality", "panic-handler"] } -libc = "0.2" diff --git a/example/src/main.rs b/example/src/main.rs deleted file mode 100644 index 689df99..0000000 --- a/example/src/main.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![no_std] -#![feature(start)] -#![feature(default_alloc_error_handler)] - -extern crate alloc; -extern crate unwinding; - -use alloc::{borrow::ToOwned, string::String}; -use unwinding::print::*; - -#[link(name = "c")] -extern "C" {} - -struct PrintOnDrop(String); - -impl Drop for PrintOnDrop { - fn drop(&mut self) { - println!("dropped: {:?}", self.0); - } -} - -struct PanicOnDrop; - -impl Drop for PanicOnDrop { - fn drop(&mut self) { - panic!("panic on drop"); - } -} - -fn foo() { - panic!("panic"); -} - -fn bar() { - let _p = PrintOnDrop("string".to_owned()); - foo() -} - -fn main() { - let _ = unwinding::panic::catch_unwind(|| { - bar(); - println!("done"); - }); - println!("caught"); - let _p = PanicOnDrop; - foo(); -} - -#[start] -fn start(_argc: isize, _argv: *const *const u8) -> isize { - unwinding::panic::catch_unwind(|| { - main(); - 0 - }) - .unwrap_or(101) -}