From b3f2ef82dd8fdc20887c09532c328356cf3552b6 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 27 Jan 2025 19:06:18 -0500 Subject: Update some rust impl Debug If a function had a tag it would recurse cyclicly --- rust/src/symbol.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'rust/src/symbol.rs') diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index 21df31a7..9c29af17 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -15,6 +15,7 @@ //! Interfaces for the various kinds of symbols in a binary. use std::fmt; +use std::fmt::Debug; use std::hash::{Hash, Hasher}; use std::ptr; @@ -286,16 +287,18 @@ impl Symbol { unsafe impl Send for Symbol {} unsafe impl Sync for Symbol {} -impl fmt::Debug for Symbol { +impl Debug for Symbol { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!( - f, - "", - self.sym_type(), - self.full_name(), - self.address(), - self.handle - ) + f.debug_struct("Symbol") + .field("type", &self.sym_type()) + .field("binding", &self.binding()) + .field("full_name", &self.full_name()) + .field("short_name", &self.short_name()) + .field("raw_name", &self.raw_name()) + .field("address", &self.address()) + .field("auto_defined", &self.auto_defined()) + .field("external", &self.external()) + .finish() } } -- cgit v1.3.1