From: Philippe Mathieu-Daudé Date: Sun, 26 Jan 2025 13:31:20 +0000 (+0100) Subject: target/mips: Set disassemble_info::endian value in disas_set_info() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7bb1a717cb2fd11962d1ad72933e6235c2d638c6;p=qemu.git target/mips: Set disassemble_info::endian value in disas_set_info() Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20250210212931.62401-6-philmd@linaro.org> --- diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 0b267d2e50..e76298699a 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -428,13 +428,13 @@ static void mips_cpu_reset_hold(Object *obj, ResetType type) static void mips_cpu_disas_set_info(CPUState *s, disassemble_info *info) { if (!(cpu_env(s)->insn_flags & ISA_NANOMIPS32)) { -#if TARGET_BIG_ENDIAN - info->print_insn = print_insn_big_mips; -#else - info->print_insn = print_insn_little_mips; -#endif + info->endian = TARGET_BIG_ENDIAN ? BFD_ENDIAN_BIG + : BFD_ENDIAN_LITTLE; + info->print_insn = TARGET_BIG_ENDIAN ? print_insn_big_mips + : print_insn_little_mips; } else { info->print_insn = print_insn_nanomips; + info->endian = BFD_ENDIAN_LITTLE; } }