From: Petar Jovanovic Date: Wed, 27 Jun 2012 14:14:26 +0000 (+0000) Subject: Calculate the size of vki_elf_gregset_t via operator sizeof on MIPS platforms. X-Git-Tag: svn/VALGRIND_3_8_0~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c370a82bbb4879218a0841d7030fd52c649d5255;p=thirdparty%2Fvalgrind.git Calculate the size of vki_elf_gregset_t via operator sizeof on MIPS platforms. The value VKI_ELF_NGREG is now defined with the the help of operator sizeof. Incorrect size triggered an assertion in the file coredump-elf.c. The issue was reported as coredump problem at: https://bugs.kde.org/show_bug.cgi?id=270777 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12677 --- diff --git a/include/vki/vki-mips32-linux.h b/include/vki/vki-mips32-linux.h index fa042dd82e..255e0d6bfc 100644 --- a/include/vki/vki-mips32-linux.h +++ b/include/vki/vki-mips32-linux.h @@ -660,22 +660,6 @@ struct vki_pollfd { short revents; }; //---------------------------------------------------------------------- -// From linux-2.6.35.5/include/asm-mips/elf.h -//---------------------------------------------------------------------- - -#define VKI_ELF_NGREG 45 /* includes nip, msr, lr, etc. */ -#define VKI_ELF_NFPREG 33 /* includes fpscr */ - -typedef unsigned long vki_elf_greg_t; -typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG]; - -typedef double vki_elf_fpreg_t; -typedef vki_elf_fpreg_t vki_elf_fpregset_t[VKI_ELF_NFPREG]; - -typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t; - -#define VKI_AT_SYSINFO 32 -//---------------------------------------------------------------------- // From linux-2.6.35.5/include/asm-mips/ucontext.h //---------------------------------------------------------------------- @@ -868,6 +852,22 @@ struct vki_pt_regs { #define VKI_PTRACE_GETFPREGS 14 #define VKI_PTRACE_SETFPREGS 15 //---------------------------------------------------------------------- +// From linux-2.6.35.5/include/asm-mips/elf.h +//---------------------------------------------------------------------- +typedef unsigned long vki_elf_greg_t; + +#define VKI_ELF_NGREG (sizeof (struct vki_user_regs_struct) / sizeof(vki_elf_greg_t)) +#define VKI_ELF_NFPREG 33 /* includes fpscr */ + +typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG]; + +typedef double vki_elf_fpreg_t; +typedef vki_elf_fpreg_t vki_elf_fpregset_t[VKI_ELF_NFPREG]; + +typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t; + +#define VKI_AT_SYSINFO 32 +//---------------------------------------------------------------------- // From linux-2.6.35.5/include/asm-generic/siginfo.h //---------------------------------------------------------------------- #define HAVE_ARCH_SIGINFO_T