diff --git a/rust-support/chatdbg/Cargo.toml b/rust-support/chatdbg/Cargo.toml index e8bec68..14b5762 100644 --- a/rust-support/chatdbg/Cargo.toml +++ b/rust-support/chatdbg/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chatdbg" -version = "0.1.1" +version = "0.1.2" edition = "2021" description = "Rust-specific support for ChatDBG (https://github.com/plasma-umass/chatdbg)." authors = ["Emery Berger "] @@ -11,8 +11,8 @@ repository = "https://github.com/plasma-umass/ChatDBG/" [dependencies] lazy_static = "1.4.0" -quote = "1.0.33" -syn = { version = "2.0.37", features = ["full"] } +# quote = "1.0.33" +# syn = { version = "2.0.37", features = ["full"] } -[lib] -proc-macro = true +# [lib] +# proc-macro = true diff --git a/rust-support/chatdbg/src/lib.rs b/rust-support/chatdbg/src/lib.rs index a0d99ad..53082b6 100644 --- a/rust-support/chatdbg/src/lib.rs +++ b/rust-support/chatdbg/src/lib.rs @@ -10,7 +10,7 @@ lazy_static::lazy_static! { static ref FILE_CREATED: AtomicBool = AtomicBool::new(false); } -fn chatdbg() { +pub fn chatdbg() { // Set a custom panic hook. panic::set_hook(Box::new(|info| { let _guard = FILE_MUTEX.lock().unwrap(); // Lock Mutex to synchronize access. @@ -50,25 +50,3 @@ fn chatdbg() { })); } -use proc_macro::TokenStream; -use quote::quote; -use syn::{parse_macro_input, ItemFn}; - -#[proc_macro_attribute] -pub fn startup(_attr: TokenStream, item: TokenStream) -> TokenStream { - let input = parse_macro_input!(item as ItemFn); - - let expanded = quote! { - #input // Repeat the original function - - fn main() { - chatdbg(); // Call your startup function - // Call the original main function - ::std::rt::resume_unwind(::std::panic::catch_unwind(|| { - #input - })); - } - }; - - TokenStream::from(expanded) -}