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 --- CHANGELOG | 4 ++++ Cargo.toml | 4 ++-- src/lib.rs | 11 ++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0c9b6f0..5239408 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +# 0.1.1 + +add support for `yaxpeax_arch::AnnotatingDecoder` + # 0.1.0 update yaxpeax-arch to 0.2.3, apply API updates diff --git a/Cargo.toml b/Cargo.toml index c4f97b8..1209f10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "yaxpeax-msp430" -version = "0.1.0" +version = "0.1.1" authors = [ "iximeow " ] license = "0BSD" repository = "http://git.iximeow.net/yaxpeax-msp430/" description = "msp430 decoders for the yaxpeax project" [dependencies] -yaxpeax-arch = { version = "0.2.3", default-features = false, features = [] } +yaxpeax-arch = { version = "0.2.7", default-features = false, features = [] } "serde" = { version = "1.0", optional = true } "serde_derive" = { version = "1.0", optional = true } 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