mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
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>
24 lines
446 B
C
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";
|
|
}
|