Skip to content

Commit 9216cd7

Browse files
committed
csky: Fixup wrong pt_regs size
The bug is from commit 2054f4a ("csky: bugfix gdb coredump error.") We change the ELF_NGREG to ELF_NGREG - 2 to fit gdb&gcc define, but forgot modify ptrace regset. Now coredump use ELF_NRGEG to parse GPRs and ptrace use pt_regs_regset, so there are two different reg_sets for userspace. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
1 parent 62eebea commit 9216cd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/csky/kernel/ptrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/ptrace.h>
99
#include <linux/regset.h>
1010
#include <linux/sched.h>
11+
#include <linux/sched/task_stack.h>
1112
#include <linux/signal.h>
1213
#include <linux/smp.h>
1314
#include <linux/uaccess.h>
@@ -159,7 +160,7 @@ static int fpr_set(struct task_struct *target,
159160
static const struct user_regset csky_regsets[] = {
160161
[REGSET_GPR] = {
161162
.core_note_type = NT_PRSTATUS,
162-
.n = ELF_NGREG,
163+
.n = sizeof(struct pt_regs) / sizeof(u32),
163164
.size = sizeof(u32),
164165
.align = sizeof(u32),
165166
.get = &gpr_get,

0 commit comments

Comments
 (0)