From 7b994612e4cf90c9c8669cdab4def7d0777a0f48 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 22 Aug 2021 15:11:38 -0700 Subject: support field annotations in decoding using yaxpeax-arch=0.2.7 --- src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index ea83289..c700094 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ extern crate serde; extern crate yaxpeax_arch; use yaxpeax_arch::{Arch, AddressDiff, Decoder, LengthedInstruction, Reader, StandardDecodeError, U16le}; -use yaxpeax_arch::{AnnotatingDecoder, DescriptionSink, NullSink}; +use yaxpeax_arch::annotation::{AnnotatingDecoder, DescriptionSink, NullSink}; mod display; pub use display::NoContext; @@ -197,6 +197,15 @@ pub struct MSP430FieldDescription { id: u32, } +impl yaxpeax_arch::annotation::FieldDescription for MSP430FieldDescription { + fn id(&self) -> u32 { + self.id + } + fn is_separator(&self) -> bool { + false + } +} + #[derive(Clone, PartialEq, Eq)] pub enum MSP430Field { Opcode(Opcode), -- cgit v1.1