From f6cceb21200acd65510940f03e90d96e2f3d77ea Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Wed, 21 Sep 2022 14:34:35 -0400 Subject: [Rust API] impl Debug for CallingConvention --- rust/src/callingconvention.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'rust/src') diff --git a/rust/src/callingconvention.rs b/rust/src/callingconvention.rs index 672b2c1b..79fe7201 100644 --- a/rust/src/callingconvention.rs +++ b/rust/src/callingconvention.rs @@ -15,6 +15,7 @@ //! Contains and provides information about different systems' calling conventions to analysis. use std::borrow::Borrow; +use std::fmt::{Debug, Formatter}; use std::marker::PhantomData; use std::mem; use std::os::raw::c_void; @@ -23,7 +24,7 @@ use std::slice; use binaryninjacore_sys::*; -use crate::architecture::{Architecture, ArchitectureExt, Register}; +use crate::architecture::{Architecture, ArchitectureExt, CoreArchitecture, Register}; use crate::rc::{ CoreArrayProvider, CoreArrayWrapper, CoreOwnedArrayProvider, Guard, Ref, RefCountable, }; @@ -612,6 +613,12 @@ unsafe impl<'a, A: Architecture> CoreArrayWrapper<'a> for CallingConvention { } } +impl Debug for CallingConvention { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "", self.name(), self.arch_handle.name()) + } +} + pub struct ConventionBuilder { caller_saved_registers: Vec, _callee_saved_registers: Vec, -- cgit v1.3.1