diff options
| author | Mason Reed <mason@vector35.com> | 2025-01-27 19:06:18 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-01-27 19:07:19 -0500 |
| commit | b3f2ef82dd8fdc20887c09532c328356cf3552b6 (patch) | |
| tree | 35d33f72d16f5ec8f084b1785dd399c2a5cdd7a0 /rust/src/symbol.rs | |
| parent | 4551d1f3f4c99d72437d5908fe2aaa0ac850bb1f (diff) | |
Update some rust impl Debug
If a function had a tag it would recurse cyclicly
Diffstat (limited to 'rust/src/symbol.rs')
| -rw-r--r-- | rust/src/symbol.rs | 21 |
1 files changed, 12 insertions, 9 deletions
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, - "<sym {:?} '{}' @ {:x} (handle: {:?})>", - 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() } } |
