This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH] Power: Correct little-endian e500v2 GPR frame offsets
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Joel Brobecker <brobecker at adacore dot com>, Stan Shebs <stanshebs at earthlink dot net>
- Cc: <gdb-patches at sourceware dot org>, Andrew Cagney <cagney at gnu dot org>, Kevin Buettner <kevinb at redhat dot com>
- Date: Tue, 18 Mar 2014 19:51:09 +0000
- Subject: Re: [PING][PATCH] Power: Correct little-endian e500v2 GPR frame offsets
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 1 dot 10 dot 1402282355070 dot 18199 at tp dot orcam dot me dot uk> <alpine dot DEB dot 1 dot 10 dot 1403101843310 dot 23119 at tp dot orcam dot me dot uk> <20140312083446 dot GE4882 at adacore dot com>
On Wed, 12 Mar 2014, Joel Brobecker wrote:
> > > gdb/
> > > * rs6000-tdep.c (rs6000_frame_cache): Correct little-endian
> > > GPR offset into SPE pseudo registers.
>
> Sorry for the delay. This is OK, but with one small comment.
No worries and sorry to trouble you -- I missed Stan's earlier reply.
> > > int i;
> > > CORE_ADDR ev_addr = cache->base + fdata.ev_offset;
> > > + CORE_ADDR off = byte_order == BFD_ENDIAN_BIG ? 4 : 0;
> > > for (i = fdata.saved_ev; i < ppc_num_gprs; i++)
>
> Would you mind adding an empty line after the local variable
> declarations?
Sure, I have taken Stan's suggestion into account too. Here's the final
version I applied. Thank you both for the review.
2014-03-18 Maciej W. Rozycki <macro@codesourcery.com>
gdb/
* rs6000-tdep.c (rs6000_frame_cache): Correct little-endian GPR
offset into SPE pseudo registers.
Maciej
gdb-rs6000-ev-gpr-le.diff
Index: gdb-fsf-trunk-quilt/gdb/rs6000-tdep.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/rs6000-tdep.c 2014-03-18 19:00:27.000000000 +0000
+++ gdb-fsf-trunk-quilt/gdb/rs6000-tdep.c 2014-03-18 19:05:33.938923879 +0000
@@ -3257,12 +3257,14 @@ rs6000_frame_cache (struct frame_info *t
{
int i;
CORE_ADDR ev_addr = cache->base + fdata.ev_offset;
+ CORE_ADDR off = (byte_order == BFD_ENDIAN_BIG ? 4 : 0);
+
for (i = fdata.saved_ev; i < ppc_num_gprs; i++)
{
cache->saved_regs[tdep->ppc_ev0_regnum + i].addr = ev_addr;
- cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = ev_addr + 4;
+ cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = ev_addr + off;
ev_addr += register_size (gdbarch, tdep->ppc_ev0_regnum);
- }
+ }
}
}