summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-09-21 14:34:35 -0400
committerGlenn Smith <glenn@vector35.com>2022-09-29 21:02:23 -0400
commitf6cceb21200acd65510940f03e90d96e2f3d77ea (patch)
treefba8f3af542208abc5c7173568f1856284c0e1ba /rust/src
parent37e078eb3ebf5393d3bdad7f8014e83d654f9857 (diff)
[Rust API] impl Debug for CallingConvention
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/callingconvention.rs9
1 files changed, 8 insertions, 1 deletions
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<A> {
}
}
+impl Debug for CallingConvention<CoreArchitecture> {
+ fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+ write!(f, "<cc: {} arch: {}>", self.name(), self.arch_handle.name())
+ }
+}
+
pub struct ConventionBuilder<A: Architecture> {
caller_saved_registers: Vec<A::Register>,
_callee_saved_registers: Vec<A::Register>,