Remove stale -DNO_PROTOTYPES bits from gdb testsuite
authorPedro Alves <palves@redhat.com>
Fri, 3 Jul 2020 12:34:22 +0000 (13:34 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 3 Jul 2020 13:58:20 +0000 (14:58 +0100)
The gdb.base/call-sc.exp, gdb.base/structs.exp and
gdb.base/structs2.exp testcases still try compiling the sources with
-DNO_PROTOTYPES, but the corresponding sources don't have any #ifdef
NO_PROTOTYPES any longer.  Those were removed throughout years ago.

OTOH, gdb.base/ovlymgr.h does check for NO_PROTOTYPES, but no .exp
file compiles it with -DNO_PROTOTYPES.

gdb.base/reread.exp and gdb.base/varargs.exp set a 'prototypes'
global, which is a stale bit left behind when the "try-compiling
without and then with -DNO_PROTOTYPES" logic was around.

gdb/testsuite/ChangeLog:

* gdb.base/call-sc.exp (start_scalars_test): Use
prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
* gdb.base/overlays.c: Remove references to PARAMS.
* gdb.base/ovlymgr.h (PARAMS): Delete, and remove all references.
* gdb.base/reread.exp: Don't set 'prototypes' global.
* gdb.base/structs.exp (start_structs_test): Use
prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
* gdb.base/structs2.exp: Don't set 'prototypes' global.  Use
prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
Don't issue "set width 0".  Remove gdb_stop_suppressing_tests
call.
* gdb.base/varargs.exp: Don't set 'prototypes' global.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/call-sc.exp
gdb/testsuite/gdb.base/overlays.c
gdb/testsuite/gdb.base/ovlymgr.h
gdb/testsuite/gdb.base/reread.exp
gdb/testsuite/gdb.base/structs.exp
gdb/testsuite/gdb.base/structs2.exp
gdb/testsuite/gdb.base/varargs.exp

index f6c7e5a62e78d156d586f9863c9a0478027f7fb8..47e4d7c509a1c458df46a72d2168034ac41d0836 100644 (file)
@@ -1,3 +1,18 @@
+2020-07-03  Pedro Alves  <palves@redhat.com>
+
+       * gdb.base/call-sc.exp (start_scalars_test): Use
+       prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
+       * gdb.base/overlays.c: Remove references to PARAMS.
+       * gdb.base/ovlymgr.h (PARAMS): Delete, and remove all references.
+       * gdb.base/reread.exp: Don't set 'prototypes' global.
+       * gdb.base/structs.exp (start_structs_test): Use
+       prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
+       * gdb.base/structs2.exp: Don't set 'prototypes' global.  Use
+       prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
+       Don't issue "set width 0".  Remove gdb_stop_suppressing_tests
+       call.
+       * gdb.base/varargs.exp: Don't set 'prototypes' global.
+
 2020-07-03  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/m32rovly.c: Delete.
index 719000435a7cfaf95eb1bd32183be1892a8fa693..9544dcc40494fbe6c57e76f629f21d7e2c5f08c1 100644 (file)
@@ -55,21 +55,10 @@ proc start_scalars_test { type } {
     set testfile "call-sc-${type}"
 
     set binfile [standard_output_file ${testfile}]
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
-       # built the second test case since we can't use prototypes
-       warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
-       if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
-           untested "failed to compile"
-           return -1
-       }
+    if { [prepare_for_testing "failed to prepare" $binfile $srcfile $flags] } {
+       return -1
     }
 
-    # Start with a fresh gdb.
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
-
     # Make certain that the output is consistent
     with_test_prefix "testfile=$testfile" {
        gdb_test_no_output "set print sevenbit-strings"
index d02ed707cd1b59781ffb4a61d1e2145f644d1b64..e9dc9a0b586c0687aea3f986abb03e9bb0352013 100644 (file)
@@ -3,10 +3,10 @@
 
 #include "ovlymgr.h"
 
-extern int foo PARAMS((int));
-extern int bar PARAMS((int));
-extern int baz PARAMS((int));
-extern int grbx PARAMS((int));
+extern int foo (int);
+extern int bar (int);
+extern int baz (int);
+extern int grbx (int);
 
 int main ()
 {
index bd0d40a26403cbf58603e5f25d4f9bb99bc3722e..16335056724392608cfd8698fdac48b4571c982a 100644 (file)
@@ -2,16 +2,9 @@
  * Sample runtime overlay manager.
  */
 
-#ifdef NO_PROTOTYPES
-#define PARAMS(paramlist) ()
-#else
-#define PARAMS(paramlist) paramlist
-#endif
-
 typedef enum { FALSE, TRUE } bool;
 
 /* Entry Points: */
 
-bool OverlayLoad   PARAMS((unsigned long ovlyno));
-bool OverlayUnload PARAMS((unsigned long ovlyno));
-
+bool OverlayLoad (unsigned long ovlyno);
+bool OverlayUnload (unsigned long ovlyno);
index e38a5f200d5aa4d360c464a460312ab5f452ed27..f824156cc3912353241a44254723fbc04d3be562 100644 (file)
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set prototypes 1
-
 # Build programs in PIE mode, to reproduce PR 21555.
 foreach_with_prefix opts {
     { "" "" }
index 8eaa36512f2be2a3d5f7f4153c097d3b521984a2..db258f9c7c7988771e9021082dc26f52b57afd26 100644 (file)
@@ -66,21 +66,10 @@ proc start_structs_test { types } {
     }
 
     set binfile [standard_output_file ${testfile}]
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
-       # built the second test case since we can't use prototypes
-       warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
-       if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
-           untested "failed to compile"
-           return -1
-       }
+    if { [prepare_for_testing "failed to prepare" $binfile $srcfile $flags] } {
+       return -1
     }
 
-    # Start with a fresh gdb.
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
-
     # Make certain that the output is consistent
     with_test_prefix "types=$types" {
        gdb_test_no_output "set print sevenbit-strings"
index 84920c446adb9158c62f5a781128a268399a0b2b..8a7d9c693783dc6812f4802188c52a166b3b5cbc 100644 (file)
@@ -13,7 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set prototypes 1
 standard_testfile .c
 
 # Create and source the file that provides information about the compiler
@@ -22,30 +21,15 @@ if [get_compiler_info] {
     return -1
 }
 
-# build the first test case
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    # built the second test case since we can't use prototypes
-    warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
-       untested "failed to compile"
-       return -1
-    }
-    set prototypes 0
+if { [prepare_for_testing "failed to prepare" $binfile $srcfile {debug}] } {
+    return -1
 }
 
-# Start with a fresh gdb.
-
-clean_restart ${binfile}
-
-gdb_test_no_output "set width 0"
-
 if ![runto_main] then {
     fail "can't run to main"
     return 0
 }
 
-# Ok, we're finally ready to actually do our tests.
-
 gdb_test "f" \
     ".*bkpt = 0.*" \
     "structs2 sanity check"
@@ -67,9 +51,3 @@ if [test_compiler_info gcc-3-*] {
 gdb_test "continue" \
     ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
     "structs2 continue2"
-
-# End of tests.
-
-gdb_stop_suppressing_tests
-
-return 0
index f6f4f659653d543fae77bbec054dabeba25d2bdd..40dcd087a6fa62709f4939ea854a481183ad3257 100644 (file)
@@ -29,8 +29,6 @@
 
 
 
-set prototypes 0
-
 standard_testfile .c
 
 if [get_compiler_info] {
This page took 0.033481 seconds and 4 git commands to generate.