Commit 23bfdacf authored by Will Deacon's avatar Will Deacon Committed by Russell King

ARM: 6798/1: aout-core: zero thread debug registers in a.out core dump

The removal of the single-step emulation from ptrace on ARM means that
thread_struct no longer has software breakpoint fields in its debug
member.

This patch fixes the a.out core dump code so that the debug registers
are zeroed rather than trying to copy from non-existent fields.

Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 6fa85e5c
...@@ -32,11 +32,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) ...@@ -32,11 +32,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT; dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
dump->u_ssize = 0; dump->u_ssize = 0;
dump->u_debugreg[0] = tsk->thread.debug.bp[0].address; memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));
dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
dump->u_debugreg[4] = tsk->thread.debug.nsaved;
if (dump->start_stack < 0x04000000) if (dump->start_stack < 0x04000000)
dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT; dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
......
...@@ -71,7 +71,7 @@ struct user{ ...@@ -71,7 +71,7 @@ struct user{
/* the registers. */ /* the registers. */
unsigned long magic; /* To uniquely identify a core file */ unsigned long magic; /* To uniquely identify a core file */
char u_comm[32]; /* User command that was responsible */ char u_comm[32]; /* User command that was responsible */
int u_debugreg[8]; int u_debugreg[8]; /* No longer used */
struct user_fp u_fp; /* FP state */ struct user_fp u_fp; /* FP state */
struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */ struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
/* the FP registers. */ /* the FP registers. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment