This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Are ppc*_elf_write_core_note Os-specific?
- From: Alan Modra <amodra at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, John Baldwin <jhb at freebsd dot org>, Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>, Binutils <binutils at sourceware dot org>, GDB <gdb at sourceware dot org>
- Date: Wed, 20 Jan 2016 13:37:21 +1030
- Subject: Re: Are ppc*_elf_write_core_note Os-specific?
- Authentication-results: sourceware.org; auth=none
- References: <1736699 dot V7zq9VJIrx at ralph dot baldwin dot cx> <1866442 dot mSXmZIT7y1 at ralph dot baldwin dot cx> <CAMe9rOo9j=+m+--q8Wzt4+kx0KfvcSfFd3uEq==9HHAfBd9Mnw at mail dot gmail dot com> <1502134 dot K9IMtmAub2 at ralph dot baldwin dot cx> <569EA298 dot 8070303 at redhat dot com> <CAMe9rOqYLnZZXe9wyDDh_aOh1XT-nNBKmrDN+tXu4j9WFw81Fg at mail dot gmail dot com> <569EBE31 dot 9070902 at redhat dot com>
On Tue, Jan 19, 2016 at 10:52:33PM +0000, Pedro Alves wrote:
> I think that ideally we'd give the same treatment to
> elfcore_write_prstatus; it's just that nobody ever did the leg work.
Some leg work. For all linux targets except mips n32 which has a
64-bit pr_sigpend and pr_sighold, we have
struct elf_prstatus
{
struct elf_siginfo pr_info;
short int pr_cursig;
unsigned long int pr_sigpend;
unsigned long int pr_sighold;
__pid_t pr_pid;
__pid_t pr_ppid;
__pid_t pr_pgrp;
__pid_t pr_sid;
struct timeval pr_utime;
struct timeval pr_stime;
struct timeval pr_cutime;
struct timeval pr_cstime;
elf_gregset_t pr_reg;
int pr_fpvalid;
};
struct elf_siginfo is three ints, struct timeval is two longs except
for sparc where tv_usec is an int, __pid_t is an int. elf_gregset_t
of course varies. Unless I'm missing some odd target struct alignment
rule, I think that means linux needs a 32-bit and 64-bit variant of
elfcore_write_linux_prprstatus with parameters similar to
elfcore_write_linux_prpsinfo*, and special cases for mips n32 and
sparc64. I'd assume gdb's new elf_internal_linux_prstatus struct
would contain a pointer to and size of regs in target format. Host
format would be messy since some 64-bit targets have the odd 32-bit
reg hidden away in elf_gregset_t.
--
Alan Modra
Australia Development Lab, IBM