This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: Add 64-bit support to MIPS register-dump.h (bug 14893)
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-ports at sourceware dot org
- Date: Thu, 29 Nov 2012 19:49:31 -0500
- Subject: Re: Add 64-bit support to MIPS register-dump.h (bug 14893)
- References: <Pine.LNX.4.64.1211292304100.27729@digraph.polyomino.org.uk>
On Thu, Nov 29, 2012 at 6:04 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> Reviewing compiler warnings for MIPS glibc builds showed that the MIPS
> register-dump.h was not adapted for 64-bit multilibs; it always used
> struct sigcontext, when actually the definitions in sigcontextinfo.h
> mean ucontext_t is the relevant type for 64-bit, so resulting in
> warnings about incompatible types being passed, and no doubt accesses
> to the wrong structure fields.
>
> I've applied this patch to add 64-bit support to this file, so fixing
> the warnings. So that the existing _itoa_word use in register-dump.h
> continued to work for dumping the full content of a register, I made
> MIPS n32 use 64-bit _itoa_word, like x32.
>
> Note that the output formatting could still do with cleanup for 64-bit
> (putting fewer registers on a line of output when each register
> occupies 16 characters of output rather than 8).
>
> 2012-11-29 Joseph Myers <joseph@codesourcery.com>
>
> [BZ #14893]
> * sysdeps/mips/mips64/n32/_itoa.h: New file.
> * sysdeps/unix/sysv/linux/mips/register-dump.h: Include
> <sgidefs.h>.
> (CTX_TYPE): New macro.
> (CTX_REG): Likewise.
> (CTX_PC): Likewise.
> (CTX_MDHI): Likewise.
> (CTX_MDLO): Likewise.
> (REG_HEX_SIZE): Likewise.
> (hexvalue): Take _ITOA_WORD_TYPE argument.
> (register_dump): Use these macros instead of hardcoding struct
> sigcontext * type and accesses and 8-byte textual output for
> registers.
This looks good to me.
Cheers,
Carlos.