On 7/10/26 10:43, Anton Johansson wrote:
Reviewed-by: Pierrick Bouvier <[email protected]>
Signed-off-by: Anton Johansson <[email protected]>
---
  target/riscv/arch_dump.c | 13 +++++++------
  target/riscv/meson.build |  2 +-
  2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/target/riscv/arch_dump.c b/target/riscv/arch_dump.c


@@ -175,11 +176,11 @@ int cpu_get_dump_info(ArchDumpInfo *info,
info->d_machine = EM_RISCV; -#if defined(TARGET_RISCV64)
-    info->d_class = ELFCLASS64;
-#else
-    info->d_class = ELFCLASS32;
-#endif
+    if (target_riscv64()) {
+        info->d_class = ELFCLASS64;
+    } else {
+        info->d_class = ELFCLASS32;
+    }
If this is good enough to link:
Acked-by: Philippe Mathieu-Daudé <[email protected]>

But FYI the whole "system/dump-arch.h" API is not ready for
heterogenous emulation. We discussed it once with Marc-André
and there is no good way to adapt it, since it was not designed
with that in mind, and is restricted to a single architecture
which doesn't change (word size, endianness) at runtime.
IIRC we ended agreeing dump can not be supported in Het.Emu.,
and the plan was to refactor get_dump_info() as a CPUClass
handler, if not heterogenous then dispatch if available
otherwise fallback to "not supported" stub.

Reply via email to