Without this, only the crash frame's window is spilled to the stack; all deeper call frames remain in the register file and are absent from the core's memory segments. Stack unwinding fails past the first DWARF step because the callers' register save areas contain stale/garbage data. The real kernel calls flush_all_user_windows() at the top of do_coredump(). Mirror that via a weak target_flush_windows() hook called from dump_core_and_abort(), with the SPARC override calling the existing flush_windows() in cpu_loop.c. Signed-off-by: Matt Turner <mattst88@gmail.com> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Helge Deller <deller@gmx.de>
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation, or (at your option) any
|
|
* later version. See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef SPARC_TARGET_ELF_H
|
|
#define SPARC_TARGET_ELF_H
|
|
|
|
#ifndef TARGET_SPARC64
|
|
# define ELF_CLASS ELFCLASS32
|
|
# define ELF_MACHINE EM_SPARC
|
|
#elif defined(TARGET_ABI32)
|
|
# define ELF_CLASS ELFCLASS32
|
|
# define ELF_MACHINE EM_SPARC32PLUS
|
|
# define elf_check_machine(x) ((x) == EM_SPARC32PLUS || (x) == EM_SPARC)
|
|
#else
|
|
# define ELF_CLASS ELFCLASS64
|
|
# define ELF_MACHINE EM_SPARCV9
|
|
#endif
|
|
|
|
#define HAVE_ELF_HWCAP 1
|
|
#define HAVE_ELF_CORE_DUMP 1
|
|
|
|
/*
|
|
* Matches the kernel's elf_gregset_t.
|
|
* sparc32/sparc32plus (ELF_NGREG = 38):
|
|
* psr, pc, npc, y, u_regs[16] (g0-g7, o0-o7),
|
|
* reg_window[16] (l0-l7, i0-i7), stack_check[2]
|
|
* sparc64 (ELF_NGREG = 36):
|
|
* u_regs[16] (g0-g7, o0-o7), reg_window[16] (l0-l7, i0-i7),
|
|
* tstate, tpc, tnpc, y
|
|
*/
|
|
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
|
# define TARGET_ELF_NGREG 36
|
|
#else
|
|
# define TARGET_ELF_NGREG 38
|
|
#endif
|
|
typedef struct target_elf_gregset_t {
|
|
abi_ulong regs[TARGET_ELF_NGREG];
|
|
} target_elf_gregset_t;
|
|
|
|
#endif
|