From: Edgar E. Iglesias Date: Wed, 19 May 2010 13:09:28 +0000 (+0200) Subject: microblaze: Add linux-user core dumping support. X-Git-Tag: TizenStudio_2.0_p2.3~4801 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=127c2cad7bd1a2558b5419782666117523510576;p=sdk%2Femulator%2Fqemu.git microblaze: Add linux-user core dumping support. Signed-off-by: Edgar E. Iglesias --- diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 4ef77bc..6bc51da 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -644,6 +644,24 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i #define ELF_EXEC_PAGESIZE 4096 +#define USE_ELF_CORE_DUMP +#define ELF_NREG 38 +typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; + +/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) +{ + int i, pos = 0; + + for (i = 0; i < 32; i++) { + (*regs)[pos++] = tswapl(env->regs[i]); + } + + for (i = 0; i < 6; i++) { + (*regs)[pos++] = tswapl(env->sregs[i]); + } +} + #endif /* TARGET_MICROBLAZE */ #ifdef TARGET_SH4