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/architecture.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'rust/src/architecture.rs') diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 09808b39..857a6e88 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -1377,7 +1377,7 @@ impl Drop for CoreArchitectureList { } } -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[derive(Copy, Clone, Eq, PartialEq, Hash)] pub struct CoreArchitecture { pub(crate) handle: *mut BNArchitecture, } @@ -1895,6 +1895,20 @@ impl Architecture for CoreArchitecture { } } +impl Debug for CoreArchitecture { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("CoreArchitecture") + .field("name", &self.name()) + .field("endianness", &self.endianness()) + .field("address_size", &self.address_size()) + .field("default_integer_size", &self.default_integer_size()) + .field("instruction_alignment", &self.instruction_alignment()) + .field("max_instr_len", &self.max_instr_len()) + .field("opcode_display_len", &self.opcode_display_len()) + .finish() + } +} + macro_rules! cc_func { ($get_name:ident, $get_api:ident, $set_name:ident, $set_api:ident) => { fn $get_name(&self) -> Option> { -- cgit v1.3.1