aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-07-03 13:34:22 +0100
committerPedro Alves <palves@redhat.com>2020-07-03 14:58:20 +0100
commit2eb821570037e8836d61ab3dcb9331c21f8a64d9 (patch)
tree47c3fc7b3beecb00174c8d0d4770589e65b71ca6 /gdb
parent9adda7af10c354a62146d917a30a2fae8df370d1 (diff)
downloadgdb-2eb821570037e8836d61ab3dcb9331c21f8a64d9.zip
gdb-2eb821570037e8836d61ab3dcb9331c21f8a64d9.tar.gz
gdb-2eb821570037e8836d61ab3dcb9331c21f8a64d9.tar.bz2
Remove stale -DNO_PROTOTYPES bits from gdb testsuite
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog15
-rw-r--r--gdb/testsuite/gdb.base/call-sc.exp15
-rw-r--r--gdb/testsuite/gdb.base/overlays.c8
-rw-r--r--gdb/testsuite/gdb.base/ovlymgr.h11
-rw-r--r--gdb/testsuite/gdb.base/reread.exp2
-rw-r--r--gdb/testsuite/gdb.base/structs.exp15
-rw-r--r--gdb/testsuite/gdb.base/structs2.exp26
-rw-r--r--gdb/testsuite/gdb.base/varargs.exp2
8 files changed, 27 insertions, 67 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f6c7e5a..47e4d7c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,20 @@
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.
* gdb.base/ovlymgr.c: Remove all code guarded by __D10V__.
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index 7190004..9544dcc 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.base/overlays.c b/gdb/testsuite/gdb.base/overlays.c
index d02ed70..e9dc9a0 100644
--- a/gdb/testsuite/gdb.base/overlays.c
+++ b/gdb/testsuite/gdb.base/overlays.c
@@ -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 ()
{
diff --git a/gdb/testsuite/gdb.base/ovlymgr.h b/gdb/testsuite/gdb.base/ovlymgr.h
index bd0d40a..1633505 100644
--- a/gdb/testsuite/gdb.base/ovlymgr.h
+++ b/gdb/testsuite/gdb.base/ovlymgr.h
@@ -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);
diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp
index e38a5f2..f824156 100644
--- a/gdb/testsuite/gdb.base/reread.exp
+++ b/gdb/testsuite/gdb.base/reread.exp
@@ -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 {
{ "" "" }
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index 8eaa365..db258f9 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
index 84920c4..8a7d9c6 100644
--- a/gdb/testsuite/gdb.base/structs2.exp
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -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
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
index f6f4f65..40dcd08 100644
--- a/gdb/testsuite/gdb.base/varargs.exp
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -29,8 +29,6 @@
-set prototypes 0
-
standard_testfile .c
if [get_compiler_info] {