* multi-threaded core dump
@ 2005-03-14 6:58 Atsushi Nemoto
2005-03-14 10:18 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2005-03-14 6:58 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
It seems linux-mips does not produce correct register dumps in core
file for multi-threaded programs. This patch tries to fix it. Could
you review it? Thank you.
diff -ur linux-mips/arch/mips/kernel/process.c linux/arch/mips/kernel/process.c
--- linux-mips/arch/mips/kernel/process.c 2005-03-04 10:19:33.000000000 +0900
+++ linux/arch/mips/kernel/process.c 2005-03-14 15:51:43.592837356 +0900
@@ -167,6 +167,14 @@
#endif
}
+int dump_task_regs (struct task_struct *tsk, elf_gregset_t *regs)
+{
+ struct thread_info *ti = tsk->thread_info;
+ long ksp = (unsigned long)ti + THREAD_SIZE - 32;
+ dump_regs(&(*regs)[0], (struct pt_regs *) ksp - 1);
+ return 1;
+}
+
int dump_task_fpu (struct task_struct *t, elf_fpregset_t *fpr)
{
memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu));
diff -ur linux-mips/include/asm-mips/elf.h linux/include/asm-mips/elf.h
--- linux-mips/include/asm-mips/elf.h 2005-03-04 10:19:35.000000000 +0900
+++ linux/include/asm-mips/elf.h 2005-03-14 15:52:22.000046107 +0900
@@ -225,10 +225,12 @@
#endif /* CONFIG_MIPS64 */
extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
+extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
#define ELF_CORE_COPY_REGS(elf_regs, regs) \
dump_regs((elf_greg_t *)&(elf_regs), regs);
+#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \
dump_task_fpu(tsk, elf_fpregs)
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: multi-threaded core dump
2005-03-14 6:58 multi-threaded core dump Atsushi Nemoto
@ 2005-03-14 10:18 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2005-03-14 10:18 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
On Mon, Mar 14, 2005 at 03:58:40PM +0900, Atsushi Nemoto wrote:
> It seems linux-mips does not produce correct register dumps in core
> file for multi-threaded programs. This patch tries to fix it. Could
> you review it? Thank you.
Thanks, applied.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-03-14 10:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-14 6:58 multi-threaded core dump Atsushi Nemoto
2005-03-14 10:18 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox