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] Don't allow non-stack memory writes in the prologue for nios2.


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

commit e1b5381f1b24d2c6b1e254cf7e35f8a470394adc
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Thu Jul 30 13:26:03 2015 -0700

    Don't allow non-stack memory writes in the prologue for nios2.
    
    2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/
    	* nios2-tdep.c (nios2_analyze_prologue): Do what the comment
    	already says and disallow non-stack memory writes in the prologue.

Diff:
---
 gdb/ChangeLog    | 5 +++++
 gdb/nios2-tdep.c | 4 +---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 120148a..b52367e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
 
+	* nios2-tdep.c (nios2_analyze_prologue): Do what the comment
+	already says and disallow non-stack memory writes in the prologue.
+
+2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
+
 	* nios2-tdep.c (nios2_analyze_prologue): Update comments to
 	reflect how current GCC emits stack overflow checks.  Match
 	both trap and break instructions for backward compatbility.
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 1c5dcde..12056b5 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -935,9 +935,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
 	  if (orig > 0
 	      && (value[rb].offset == 0
 		  || (orig == NIOS2_EA_REGNUM && value[rb].offset == -4))
-	      && ((value[ra].reg == NIOS2_SP_REGNUM
-		   && cache->reg_saved[orig].basereg != NIOS2_SP_REGNUM)
-		  || cache->reg_saved[orig].basereg == -1))
+	      && value[ra].reg == NIOS2_SP_REGNUM)
 	    {
 	      if (pc < current_pc)
 		{


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