mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
disas: Remove target_words_bigendian() call in initialize_debug_target()
All CPUClass implementating disas_set_info() must set the disassemble_info::endian value. Ensure that by setting %endian to BFD_ENDIAN_UNKNOWN before calling the CPUClass::disas_set_info() handler, then asserting %endian is not BFD_ENDIAN_UNKNOWN after the call. This allows removing the target_words_bigendian() call in disas/. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20250210212931.62401-11-philmd@linaro.org>
This commit is contained in:
parent
059eb605fd
commit
ae24e13a9f
1 changed files with 2 additions and 6 deletions
|
@ -7,7 +7,6 @@
|
|||
#include "disas/disas.h"
|
||||
#include "disas/capstone.h"
|
||||
#include "hw/core/cpu.h"
|
||||
#include "exec/tswap.h"
|
||||
#include "disas-internal.h"
|
||||
|
||||
|
||||
|
@ -61,15 +60,12 @@ void disas_initialize_debug_target(CPUDebug *s, CPUState *cpu)
|
|||
|
||||
s->cpu = cpu;
|
||||
s->info.print_address_func = print_address;
|
||||
if (target_words_bigendian()) {
|
||||
s->info.endian = BFD_ENDIAN_BIG;
|
||||
} else {
|
||||
s->info.endian = BFD_ENDIAN_LITTLE;
|
||||
}
|
||||
s->info.endian = BFD_ENDIAN_UNKNOWN;
|
||||
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
if (cc->disas_set_info) {
|
||||
cc->disas_set_info(cpu, &s->info);
|
||||
g_assert(s->info.endian != BFD_ENDIAN_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue