This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] ppc: Fix stwux and stdux masks in skip_prologue


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7a8f494c7b171f6cbad20a14ef03a5d7acaa6ccb

commit 7a8f494c7b171f6cbad20a14ef03a5d7acaa6ccb
Author: Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Date:   Thu Mar 22 10:22:45 2018 -0300

    ppc: Fix stwux and stdux masks in skip_prologue
    
    This patch merges the masks for matching the stwux and stdux
    instructions in rs6000-tdep.c:skip_prologue into a single mask that
    only matches these two instructions.
    
    Commit 72dd273062 fixed the warning described in PR tdep/18295, this
    patch addresses the comment in the same PR indicating that the mask
    was too permissive.
    
    gdb/Changelog:
    
    	PR tdep/18295
    	* rs6000-tdep.c (skip_prologue): Match both stwux and stdux
    	a single mask.

Diff:
---
 gdb/ChangeLog     |  6 ++++++
 gdb/rs6000-tdep.c | 11 ++---------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf996bc..ef11361 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2018-03-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
 
+	PR tdep/18295
+	* rs6000-tdep.c (skip_prologue): Match both stwux and stdux
+	a single mask.
+
+2018-03-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
+
 	* rs6000-tdep.c (store_insn_p): New function.
 	(skip_prologue): New variable alloca_reg_offset. Set lr_reg
 	and cr_reg to their unshifted values. Use store_insn_p to
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index d61fe58..37cbcb6 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1889,8 +1889,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
 	  offset = fdata->offset;
 	  continue;
 	}
-      else if ((op & 0xfc1f016e) == 0x7c01016e)
-	{			/* stwux rX,r1,rY */
+      else if ((op & 0xfc1f07fa) == 0x7c01016a)
+	{		/* stwux rX,r1,rY  || stdux rX,r1,rY */
 	  /* No way to figure out what r1 is going to be.  */
 	  fdata->frameless = 0;
 	  offset = fdata->offset;
@@ -1903,13 +1903,6 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
 	  offset = fdata->offset;
 	  continue;
 	}
-      else if ((op & 0xfc1f016a) == 0x7c01016a)
-	{			/* stdux rX,r1,rY */
-	  /* No way to figure out what r1 is going to be.  */
-	  fdata->frameless = 0;
-	  offset = fdata->offset;
-	  continue;
-	}
       else if ((op & 0xffff0000) == 0x38210000)
  	{			/* addi r1,r1,SIMM */
  	  fdata->frameless = 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]