From: Alan Modra <amodra@bigpond.net.au>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: powerpc-linux biarch corefile support
Date: Wed, 29 Aug 2007 07:26:00 -0000 [thread overview]
Message-ID: <20070829072556.GA25275@bubble.grove.modra.org> (raw)
In-Reply-To: <200708282303.l7SN35rM004362@d12av02.megacenter.de.ibm.com>
On Wed, Aug 29, 2007 at 01:03:05AM +0200, Ulrich Weigand wrote:
> In particular, the original code appears to treat CCR, XER, and CTR
> as left-aligned, and the others as right-aligned:
[snip]
>
> Your new code makes no such distinction, they're all treated as
> right-aligned.
>
> I wonder whether this change was deliberate? It does appear the
> original code is actually wrong; the kernel stores CCR, XER, and
> CRT just the same as e.g. NIP and LNK, as far as I can see.
I should have mentioned this change. It was deliberate. The old code
was just plain wrong (and the reason why "info reg" on a 64-bit core
file always showed zero for CR and XER). It was inconsistent too.
CTR used right fill in ppc-linux-nat.c:fill_gregset but left fill in
ppc-linux-tdep.c:ppc_linux_supply_gregset. I suspect that using left
fill for CTR was just a copy and paste error, but the comment Andrew
Cagney added seems to indicate he meant to use left-fill for CR and
XER. Perhaps the ppc64 linux kernel stored them that way at some
stage? I'll ask some kernel experts.
> Did you verify that those registers are now handled correctly in
> both 64x64 and 32x64 cases (native and core)?
Yes.
> Also, you missed setting the gpr_size field in a couple of cases:
> rs6000-aix-tdep.c:rs6000_aix32_reg_offsets
> rs6000-aix-tdep.c:rs6000_aix64_reg_offsets
> ppcobsd-nat.c:ppcobsd_reg_offsets
Oops, shame on me. I'll fix that.
> And, since you're now using gpr_size in the _fpregset routines as
> well, I guess ppcobsd_fpreg_offsets would need to set gpr_size too.
> However, I think it would be preferable to not use gpr_size in
> those routines in the first place; the size of this register is in
> fact always 4.
However, the fpscr field is 64 bits in struct ucontext on both
powerpc64-linux and powerpc-linux, and the definition of PT_FPSCR
points to the low 32 bits on powerpc-linux and the full 64-bit word on
powerpc64-linux. Since the size passed to ppc_supply_reg and
ppc_collect_reg is that of the field, I figured that it ought to be 8
bytes on powerpc64-linux. I could make the size 4 and adjust the
offset in ppc64_linux_reg_offsets, but I had ideas of using
ppc_greg_offset and ppc_fpreg_offset in place of
ppc-linux-nat.c:ppc_register_u_addr, which provides an offset into
ucontext. PTRACE_PEEKUSER and PTRACE_POKEUSER bomb on ppc64 if the
offset isn't a multiple of 8...
--
Alan Modra
Australia Development Lab, IBM
next prev parent reply other threads:[~2007-08-29 7:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-22 16:43 Alan Modra
2007-01-22 17:12 ` Mark Kettenis
2007-01-23 6:57 ` Alan Modra
2007-02-08 14:40 ` Daniel Jacobowitz
2007-04-28 16:24 ` Ulrich Weigand
2007-08-25 1:23 ` Alan Modra
2007-08-28 23:03 ` Ulrich Weigand
2007-08-29 7:26 ` Alan Modra [this message]
2007-08-29 8:28 ` Alan Modra
[not found] ` <OFA57C40FB.23E13286-ON42257346.004A0E7C-42257346.004A56D1@de.ibm.com>
2007-08-30 12:14 ` Alan Modra
2007-08-30 12:50 ` Ulrich Weigand
2007-08-30 13:14 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070829072556.GA25275@bubble.grove.modra.org \
--to=amodra@bigpond.net.au \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox