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] S390: Fix infcalls in s390-vregs test case


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

commit 634c1c3109a2ffdf43ef9dab839c88108d9980f3
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date:   Fri Jan 19 19:59:53 2018 +0100

    S390: Fix infcalls in s390-vregs test case
    
    GDB used to assume that functions without debug info return int.  It
    accepted an expression containing such a function call and silently
    interpreted the function's return value as int.  But nowadays GDB yields
    an error message instead, see
    
      https://sourceware.org/ml/gdb-patches/2017-07/msg00139.html
    
    This affects the s390-vregs test case, because it contains calls to
    setrlimit64 and chdir.  When no glibc debug info is installed, these lead
    to unnecessary FAILs.  Fix this by adding appropriate casts to the
    inferior function calls.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.arch/s390-vregs.exp: Explicitly cast the return values of
    	setrlimit and chdir to int.

Diff:
---
 gdb/testsuite/ChangeLog               | 5 +++++
 gdb/testsuite/gdb.arch/s390-vregs.exp | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d510b79..36c4924 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 2018-01-19  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
+	* gdb.arch/s390-vregs.exp: Explicitly cast the return values of
+	setrlimit and chdir to int.
+
+2018-01-19  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
 	* gdb.arch/s390-tdbregs.c (my_tbegin): Add comment documenting the
 	function.
 	(my_tend): Likewise.
diff --git a/gdb/testsuite/gdb.arch/s390-vregs.exp b/gdb/testsuite/gdb.arch/s390-vregs.exp
index 915fcfc..1fdb5c0 100644
--- a/gdb/testsuite/gdb.arch/s390-vregs.exp
+++ b/gdb/testsuite/gdb.arch/s390-vregs.exp
@@ -83,9 +83,9 @@ if [expr $before_pc + 6 != $after_pc] {
 # directory.
 
 if { $coredir != "" } {
-    gdb_test {print setrlimit (4, &(unsigned long [2]){~0UL, ~0UL})} \
+    gdb_test {print (int) setrlimit (4, &(unsigned long [2]){~0UL, ~0UL})} \
 	" = .*" "setrlimit"
-    gdb_test "print chdir (\"${coredir}\")" " = 0" "chdir"
+    gdb_test "print (int) chdir (\"${coredir}\")" " = 0" "chdir"
 }
 
 # Initialize all vector registers with GDB "set" commands, using


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