Files
qemu/linux-user/alpha/elfload.c
Matt Turner 9db18ed063 linux-user/alpha: add coredump support
Define HAVE_ELF_CORE_DUMP and target_elf_gregset_t in target_elf.h,
mirroring the kernel's elf_gregset_t (ELF_NGREG = 66): r0-r31
[0..31], f0-f31 [32..63], pc [64], unique [65].  Implement
elf_core_copy_regs() in elfload.c to populate the gregset from
CPUAlphaState.

Without this, bprm->core_dump is NULL for Alpha targets.  When a
guest signal goes unhandled, dump_core_and_abort() skips the core
write and falls through to die_with_signal(), which re-raises the
signal to the host.  The host kernel then writes an x86-64 core file
for the qemu-alpha process instead of an Alpha guest core.

v2: Store thread unique field, same as in Linux kernel. Added by Helge &
suggested by Richard.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2026-06-10 18:42:59 +02:00

24 lines
446 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "qemu/osdep.h"
#include "qemu.h"
#include "loader.h"
#include "target_elf.h"
void elf_core_copy_regs(target_elf_gregset_t *r, const CPUAlphaState *env)
{
int i;
for (i = 0; i < 31; i++) {
r->regs[i] = tswap64(env->ir[i]);
}
r->pc = tswap64(env->pc);
r->unique = tswap64(env->unique);
}
const char *get_elf_cpu_model(uint32_t eflags)
{
return "ev67";
}