Update rabbitizer to v2.0.0-alpha.4 (#226)

* Update rabbitizer to v2.0.0-alpha.4

* Cargo update
This commit is contained in:
Ethan Roseman 2025-07-28 00:13:42 -04:00 committed by GitHub
parent 00ad0d8094
commit 85fb18a21a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 593 additions and 590 deletions

1155
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,7 @@ use alloc::{
use anyhow::{Result, bail}; use anyhow::{Result, bail};
use object::{Endian as _, Object as _, ObjectSection as _, ObjectSymbol as _, elf}; use object::{Endian as _, Object as _, ObjectSection as _, ObjectSymbol as _, elf};
use rabbitizer::{ use rabbitizer::{
IsaExtension, IsaVersion, Vram, IsaExtension, IsaVersion, Vram, abi::Abi, operands::ValuedOperand, registers_meta::Register,
abi::Abi,
operands::{IU16, ValuedOperand},
registers_meta::Register,
}; };
use crate::{ use crate::{
@ -349,14 +346,18 @@ fn push_args(
} }
match op { match op {
ValuedOperand::core_immediate(imm) => { ValuedOperand::core_imm_i16(imm) => {
if let Some(resolved) = relocation { if let Some(resolved) = relocation {
push_reloc(resolved.relocation, &mut arg_cb)?; push_reloc(resolved.relocation, &mut arg_cb)?;
} else { } else {
arg_cb(match imm { arg_cb(InstructionPart::signed(imm))?;
IU16::Integer(s) => InstructionPart::signed(s), }
IU16::Unsigned(u) => InstructionPart::unsigned(u), }
})?; ValuedOperand::core_imm_u16(imm) => {
if let Some(resolved) = relocation {
push_reloc(resolved.relocation, &mut arg_cb)?;
} else {
arg_cb(InstructionPart::unsigned(imm))?;
} }
} }
ValuedOperand::core_label(..) | ValuedOperand::core_branch_target_label(..) => { ValuedOperand::core_label(..) | ValuedOperand::core_branch_target_label(..) => {
@ -373,14 +374,13 @@ fn push_args(
))?; ))?;
} }
} }
ValuedOperand::core_immediate_base(imm, base) => { ValuedOperand::core_imm_rs(imm, base) => {
if let Some(resolved) = relocation { if let Some(resolved) = relocation {
push_reloc(resolved.relocation, &mut arg_cb)?; push_reloc(resolved.relocation, &mut arg_cb)?;
} else { } else {
arg_cb(InstructionPart::Arg(InstructionArg::Value(match imm { arg_cb(InstructionPart::Arg(InstructionArg::Value(
IU16::Integer(s) => InstructionArgValue::Signed(s as i64), InstructionArgValue::Signed(imm as i64),
IU16::Unsigned(u) => InstructionArgValue::Unsigned(u as u64), )))?;
})))?;
} }
arg_cb(InstructionPart::basic("("))?; arg_cb(InstructionPart::basic("("))?;
arg_cb(InstructionPart::opaque(base.either_name( arg_cb(InstructionPart::opaque(base.either_name(