public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [SPARC] callfuncs.exp: avoid spurious register differences in sparc64 targets.
@ 2015-11-19 15:55 Jose E. Marchesi
  2015-11-19 16:18 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Jose E. Marchesi @ 2015-11-19 15:55 UTC (permalink / raw)
  To: gdb-patches


Hi all!  Ok to commit?

commit 50fa72dabc43ba7fabbd5d213013d78cd22e2342
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Thu Nov 19 10:55:06 2015 -0500

    callfuncs.exp: avoid spurious register differences in sparc64 targets.
    
    The Linux kernel disables the FPU upon returning to userland.  This
    introduces spurious failures in the register preservation tests in
    callfuncs.exp, since the pstate.PEF bit gets cleared after system calls.
    
    This patch filters out the pstate register in sparc64-*-linux-gnu
    targets, so the relevant tests are no longer fooled and pass.
    
    gdb/testsuite/ChangeLog:
    
    2015-11-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* gdb.base/callfuncs.exp (fetch_all_registers): Filter out the
    	pstate register when comparing registers values in
    	sparc64-*-linux-gnu targets to avoid spurious differences.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 14c4b41..e712bc5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+	* gdb.base/callfuncs.exp (fetch_all_registers): Filter out the
+	pstate register when comparing registers values in
+	sparc64-*-linux-gnu targets to avoid spurious differences.
+
 2015-11-17  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
 	* lib/dwarf.exp (_note): Fix left shift of negative value.
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index fda3cb7..28e2fe1 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -254,6 +254,16 @@ proc fetch_all_registers {test} {
 	    }
 	    exp_continue
 	}
+	-re  "^pstate\[ \t\]+\[^\r\n\]+\r\n" {
+	    if [istarget "sparc64-*-linux-gnu"] {
+		# Filter out the pstate register, since in sparc64
+		# targets the Linux kernel disables pstate.PEF when
+		# returning from traps, giving spurious differences.
+	    } else {
+		lappend all_registers_lines $expect_out(0,string)
+	    }
+	    exp_continue
+	}
 	-re "^last_break\[ \t\]+\[^\r\n\]+\r\n" {
 	    if [istarget "s390*-*-*"] {
 		# Filter out last_break which is read-only,

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-20 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-19 15:55 [PATCH] [SPARC] callfuncs.exp: avoid spurious register differences in sparc64 targets Jose E. Marchesi
2015-11-19 16:18 ` Pedro Alves
2015-11-19 17:12   ` Jose E. Marchesi
2015-11-19 17:28     ` Pedro Alves
2015-11-20 10:29       ` Jose E. Marchesi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).