Skip to content

Commit

Permalink
ARC: gdbserver using regset interface possibly broken
Browse files Browse the repository at this point in the history
ptrace regset interface relies on ELF_NGREG for ceiling the size of user
request. So any larger request (even if legit)  would be clipped.

The existing def of ELF_NGREG didn't use user_regs_struct and was
technically one placeholder short (stop_pc) - although the current code
would still work because pt_regs includes a bunch of extra fields,
making
      ELF_NGREG >= sizeof(struct user_regs_struct)/sizeof(long)

But we need to remove this ambiguity, specially since pt_regs should NOT
be directly associated with with anything userspace-ish.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Feb 27, 2013
1 parent 7e0d306 commit 5dc99e5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions arch/arc/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
typedef unsigned long elf_greg_t;
typedef unsigned long elf_fpregset_t;


/* core dump regs is in the order pt_regs, callee_regs, stop_pc (for gdb) */
#define ELF_NGREG ((sizeof(struct pt_regs) + sizeof(struct callee_regs) \
+ sizeof(unsigned long)) / sizeof(elf_greg_t))

#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];

/*
Expand Down

0 comments on commit 5dc99e5

Please sign in to comment.