diff mbox

[PING] Power: Correct little-endian e500v2 GPR frame offsets

Message ID alpine.DEB.1.10.1403181936230.23119@tp.orcam.me.uk
State Committed
Headers show

Commit Message

Maciej W. Rozycki March 18, 2014, 7:51 p.m. UTC
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
diff mbox

Patch

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);
-            }
+	    }
 	}
     }