aboutsummaryrefslogtreecommitdiff
path: root/src/armv7.rs
diff options
context:
space:
mode:
authornovafacing <rowanbhart@gmail.com>2024-06-24 13:00:04 -0700
committeriximeow <me@iximeow.net>2024-06-25 14:09:39 -0700
commit739317f268b4ed1a8f3e06af6c6fdf977219d4f9 (patch)
treef5a0f76b7d18063a6d395af516e9b07aafb2bb02 /src/armv7.rs
parent997c73be34576fa7cb8c67be5b363498dd82b45d (diff)
Bump yaxpeax-arch and bitvec, allow use of deprecated yaxpeax-arch traits, fix bitvec syntax changes
Diffstat (limited to 'src/armv7.rs')
-rw-r--r--src/armv7.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/armv7.rs b/src/armv7.rs
index 99df077..e025267 100644
--- a/src/armv7.rs
+++ b/src/armv7.rs
@@ -7,7 +7,9 @@
use core::fmt::{self, Display, Formatter};
-use yaxpeax_arch::{Arch, AddressDiff, Colorize, Decoder, LengthedInstruction, Reader, ReadError, NoColors, ShowContextual, YaxColors};
+use yaxpeax_arch::{Arch, AddressDiff, Decoder, LengthedInstruction, Reader, ReadError};
+#[allow(deprecated)]
+use yaxpeax_arch::{Colorize, NoColors, ShowContextual, YaxColors};
mod thumb;
@@ -29,6 +31,7 @@ impl Display for ConditionedOpcode {
/// displaying an instruction the same way its `Display` impl would.
pub struct NoContext;
+#[allow(deprecated)]
fn reg_name_colorize<Y: YaxColors>(reg: Reg, colors: &Y) -> impl fmt::Display {
match reg.number() {
0 => colors.register("r0"),
@@ -52,6 +55,7 @@ fn reg_name_colorize<Y: YaxColors>(reg: Reg, colors: &Y) -> impl fmt::Display {
}
#[allow(non_snake_case)]
+#[allow(deprecated)]
impl <T: fmt::Write, Y: YaxColors> ShowContextual<u32, NoContext, T, Y> for Instruction {
fn contextualize(&self, colors: &Y, _address: u32, _context: Option<&NoContext>, out: &mut T) -> fmt::Result {
match self.opcode {
@@ -388,6 +392,7 @@ impl <T: fmt::Write, Y: YaxColors> ShowContextual<u32, NoContext, T, Y> for Inst
}
}
+#[allow(deprecated)]
impl <T: fmt::Write, Y: YaxColors> Colorize<T, Y> for ConditionedOpcode {
fn colorize(&self, colors: &Y, out: &mut T) -> fmt::Result {
match self.0 {
@@ -1552,6 +1557,7 @@ impl Display for Bank {
}
}
+#[allow(deprecated)]
impl <T: fmt::Write, Y: YaxColors> Colorize<T, Y> for Operand {
fn colorize(&self, colors: &Y, f: &mut T) -> fmt::Result {
match self {
@@ -1768,6 +1774,7 @@ impl Instruction {
pub fn thumb(&self) -> bool { self.thumb }
}
+#[allow(deprecated)]
fn format_reg_list<T: fmt::Write, Y: YaxColors>(f: &mut T, mut list: u16, colors: &Y) -> Result<(), fmt::Error> {
write!(f, "{{")?;
let mut i = 0;
@@ -1789,6 +1796,7 @@ fn format_reg_list<T: fmt::Write, Y: YaxColors>(f: &mut T, mut list: u16, colors
}
#[allow(non_snake_case)]
+#[allow(deprecated)]
fn format_shift<T: fmt::Write, Y: YaxColors>(f: &mut T, shift: RegShift, colors: &Y) -> Result<(), fmt::Error> {
match shift.into_shift() {
RegShiftStyle::RegImm(imm_shift) => {
@@ -1805,6 +1813,7 @@ fn format_shift<T: fmt::Write, Y: YaxColors>(f: &mut T, shift: RegShift, colors:
}
#[allow(non_snake_case)]
+#[allow(deprecated)]
fn format_reg_shift_mem<T: fmt::Write, Y: YaxColors>(f: &mut T, Rd: Reg, shift: RegShift, add: bool, pre: bool, wback: bool, colors: &Y) -> Result<(), fmt::Error> {
let op = if add { "" } else { "-" };
@@ -1830,6 +1839,7 @@ fn format_reg_shift_mem<T: fmt::Write, Y: YaxColors>(f: &mut T, Rd: Reg, shift:
}
#[allow(non_snake_case)]
+#[allow(deprecated)]
fn format_reg_imm_mem<T: fmt::Write, Y: YaxColors>(f: &mut T, Rn: Reg, imm: u16, add: bool, pre: bool, wback: bool, colors: &Y) -> Result<(), fmt::Error> {
if imm != 0 {
let op = if add { "" } else { "-" };
@@ -1862,6 +1872,7 @@ fn format_reg_imm_mem<T: fmt::Write, Y: YaxColors>(f: &mut T, Rn: Reg, imm: u16,
impl Display for Instruction {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
+ #[allow(deprecated)]
self.contextualize(&NoColors, 0, Some(&NoContext), f)
}
}