Skip to content

Commit

Permalink
csky: bugfix gdb coredump error.
Browse files Browse the repository at this point in the history
In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of
elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough
for coredump and no need full sizeof(struct pt_regs).

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Reported-by: Lu Baoquan <lu.baoquan@intellif.com>
Reported-by: Liu Mao <liu.mao@intellif.com>
  • Loading branch information
Guo Ren committed Dec 31, 2018
1 parent 2b070cc commit 2054f4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/csky/include/asm/elf.h
Original file line number Diff line number Diff line change
@@ -31,7 +31,12 @@ typedef unsigned long elf_greg_t;

typedef struct user_fp elf_fpregset_t;

#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
/*
* In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of
* elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough
* for coredump and no need full sizeof(struct pt_regs).
*/
#define ELF_NGREG ((sizeof(struct pt_regs) / sizeof(elf_greg_t)) - 2)

typedef elf_greg_t elf_gregset_t[ELF_NGREG];

0 comments on commit 2054f4a

Please sign in to comment.