From 6f75ca031aa7e8f7e1c706d1880b202137b1996f Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 18 Dec 2025 17:14:06 -0500 Subject: [Rust] Enter more session scoped tracing spans for debug info and binary view callbacks --- rust/src/debuginfo.rs | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'rust/src/debuginfo.rs') diff --git a/rust/src/debuginfo.rs b/rust/src/debuginfo.rs index 5879f40d..f4cee4ff 100644 --- a/rust/src/debuginfo.rs +++ b/rust/src/debuginfo.rs @@ -216,12 +216,10 @@ impl DebugInfoParser { where C: CustomDebugInfoParser, { - ffi_wrap!("CustomDebugInfoParser::is_valid", unsafe { - let cmd = &*(ctxt as *const C); - let view = BinaryView::ref_from_raw(view); - - cmd.is_valid(&view) - }) + let cmd = unsafe { &*(ctxt as *const C) }; + let view = unsafe { BinaryView::ref_from_raw(view) }; + let _span = ffi_span!("CustomDebugInfoParser::is_valid", view); + cmd.is_valid(&view) } extern "C" fn cb_parse_info( @@ -235,28 +233,27 @@ impl DebugInfoParser { where C: CustomDebugInfoParser, { - ffi_wrap!("CustomDebugInfoParser::parse_info", unsafe { - let cmd = &*(ctxt as *const C); - let view = BinaryView::ref_from_raw(view); - let debug_file = BinaryView::ref_from_raw(debug_file); - let mut debug_info = DebugInfo::ref_from_raw(debug_info); - - cmd.parse_info( - &mut debug_info, - &view, - &debug_file, - Box::new(move |cur: usize, max: usize| match progress { - Some(func) => { - if func(progress_ctxt, cur, max) { - Ok(()) - } else { - Err(()) - } + let cmd = unsafe { &*(ctxt as *const C) }; + let view = unsafe { BinaryView::ref_from_raw(view) }; + let debug_file = unsafe { BinaryView::ref_from_raw(debug_file) }; + let mut debug_info = unsafe { DebugInfo::ref_from_raw(debug_info) }; + + let _span = ffi_span!("CustomDebugInfoParser::parse_info", view); + cmd.parse_info( + &mut debug_info, + &view, + &debug_file, + Box::new(move |cur: usize, max: usize| match progress { + Some(func) => unsafe { + if func(progress_ctxt, cur, max) { + Ok(()) + } else { + Err(()) } - _ => Ok(()), - }), - ) - }) + }, + _ => Ok(()), + }), + ) } let name = name.to_cstr(); -- cgit v1.3.1