public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/16]  GDB testsuite cleanup, fix warnings with -std=gnu11
@ 2014-10-29 15:51 Andreas Arnez
  2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
                   ` (16 more replies)
  0 siblings, 17 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 15:51 UTC (permalink / raw)
  To: gdb-patches

This patch set was triggered by the fact that upstream GCC has changed
the default C language dialect to 'gnu11':

  https://gcc.gnu.org/ml/gcc/2014-10/msg00053.html

While the GDB source code doesn't seem to have any issues with that,
the test suite has, because it contains many functions without return
types and lots of implicit function declarations.

But while fixing these, I noticed that many test cases still rely on
literal line numbers and thus would fail after fixing the warnings.
Thus the first part of the patch set deals with eliminating literal
line numbers from various test cases.

Another observation is that many existing C source files in the test
suite contain code like this:

  #ifdef PROTOTYPES
  <prototyped function header>
  #else
  <old-style function header>
  #endif

And that the prototyped variant would sometimes *fix* the warning.
However, the PROTOTYPES macro is never defined, hence the old-style
version is always used.  Thus the second part of the patch series
performs some clean-up in this area by consequently migrating to the
prototyped variants and getting rid of such preprocessor conditionals.

The final part of the series then fixes the remaining warnings.

Andreas Arnez (16):
  Eliminate literal line numbers in so-impl-ld.exp
  Eliminate literal line numbers in dbx.exp
  Eliminate literal line numbers in call-ar-st.exp
  Eliminate literal line numbers in call-rt-st.exp
  Eliminate literal line numbers in ending-run.exp
  Eliminate literal line numbers in foll-exec.exp
  Eliminate literal line numbers in jump.exp
  Eliminate literal line numbers in shlib-call.exp
  Eliminate literal line numbers in mi-console.exp
  'callfuncs' test case: Fix typo in prototyped version
  Drop non-prototype C function header variants: solib1.c
  Drop non-prototype C function header variants: 'break' test case
  Drop non-prototype C function header variants: 'list' test case
  Drop non-prototype C function header variants: 'sepdebug' test case
  GDB testsuite: drop non-prototype C function header variants
  GDB testsuite: Fix warnings with -std=gnu11

 gdb/testsuite/gdb.ada/cond_lang/foo.c              |   2 +-
 gdb/testsuite/gdb.base/advance.c                   |  10 +-
 gdb/testsuite/gdb.base/annota1.c                   |  13 -
 gdb/testsuite/gdb.base/annota3.c                   |  13 -
 gdb/testsuite/gdb.base/async-shell.c               |   2 +
 gdb/testsuite/gdb.base/async.c                     |  28 +-
 gdb/testsuite/gdb.base/attach-pie-misread.c        |   1 +
 gdb/testsuite/gdb.base/attach-twice.c              |   1 +
 gdb/testsuite/gdb.base/average.c                   |  17 +-
 gdb/testsuite/gdb.base/break-interp-lib.c          |   1 +
 gdb/testsuite/gdb.base/break.c                     |  29 --
 gdb/testsuite/gdb.base/break.exp                   |  29 +-
 gdb/testsuite/gdb.base/break1.c                    |   7 -
 gdb/testsuite/gdb.base/call-ar-st.c                | 308 +--------------
 gdb/testsuite/gdb.base/call-ar-st.exp              | 165 ++++----
 gdb/testsuite/gdb.base/call-rt-st.c                | 157 +-------
 gdb/testsuite/gdb.base/call-rt-st.exp              |  11 +-
 gdb/testsuite/gdb.base/call-sc.c                   |   7 +-
 gdb/testsuite/gdb.base/call-strs.c                 |  22 --
 gdb/testsuite/gdb.base/callfuncs.c                 | 131 +------
 gdb/testsuite/gdb.base/catch-signal-fork.c         |   2 +
 gdb/testsuite/gdb.base/checkpoint.c                |   7 +-
 gdb/testsuite/gdb.base/code_elim2.c                |  12 +-
 gdb/testsuite/gdb.base/coremaker.c                 |   1 +
 gdb/testsuite/gdb.base/dbx.exp                     |  16 +-
 gdb/testsuite/gdb.base/dprintf-non-stop.c          |   2 +
 gdb/testsuite/gdb.base/dump.c                      |   2 +
 gdb/testsuite/gdb.base/ending-run.c                |   9 +-
 gdb/testsuite/gdb.base/ending-run.exp              |  38 +-
 gdb/testsuite/gdb.base/execd-prog.c                |   8 +-
 gdb/testsuite/gdb.base/exprs.c                     |   7 -
 gdb/testsuite/gdb.base/fileio.c                    |   1 +
 gdb/testsuite/gdb.base/foll-exec.c                 |   8 +-
 gdb/testsuite/gdb.base/foll-exec.exp               |  37 +-
 gdb/testsuite/gdb.base/foll-fork.c                 |   9 -
 gdb/testsuite/gdb.base/foll-vfork.c                |   4 -
 gdb/testsuite/gdb.base/funcargs.c                  | 334 ----------------
 gdb/testsuite/gdb.base/gcore.c                     |   6 +-
 gdb/testsuite/gdb.base/global-var-nested-by-dso.c  |   3 +
 gdb/testsuite/gdb.base/huge.c                      |   1 +
 gdb/testsuite/gdb.base/inferior-died.c             |   1 +
 gdb/testsuite/gdb.base/info-os.c                   |   1 +
 gdb/testsuite/gdb.base/jump.c                      |  11 +-
 gdb/testsuite/gdb.base/jump.exp                    |  29 +-
 gdb/testsuite/gdb.base/langs0.c                    |   6 -
 gdb/testsuite/gdb.base/langs1.c                    |   8 -
 gdb/testsuite/gdb.base/langs2.c                    |  17 -
 gdb/testsuite/gdb.base/list0.h                     |   8 +-
 gdb/testsuite/gdb.base/list1.c                     |  20 +-
 gdb/testsuite/gdb.base/mips_pro.c                  |  25 --
 gdb/testsuite/gdb.base/multi-forks.c               |   3 +-
 gdb/testsuite/gdb.base/nodebug.c                   |  32 --
 gdb/testsuite/gdb.base/opaque0.c                   |   2 -
 gdb/testsuite/gdb.base/opaque1.c                   |   5 -
 gdb/testsuite/gdb.base/pr10179-a.c                 |   1 +
 gdb/testsuite/gdb.base/recurse.c                   |   6 -
 gdb/testsuite/gdb.base/run.c                       |  11 -
 gdb/testsuite/gdb.base/savedregs.c                 |   2 +
 gdb/testsuite/gdb.base/scope0.c                    |  29 --
 gdb/testsuite/gdb.base/scope1.c                    |   4 -
 gdb/testsuite/gdb.base/sepdebug.c                  |  29 --
 gdb/testsuite/gdb.base/sepdebug.exp                |  30 +-
 gdb/testsuite/gdb.base/setshow.c                   |   7 -
 gdb/testsuite/gdb.base/setvar.c                    |   7 -
 gdb/testsuite/gdb.base/shlib-call.exp              |   2 +-
 gdb/testsuite/gdb.base/shmain.c                    |  10 -
 gdb/testsuite/gdb.base/shr1.c                      |  20 -
 gdb/testsuite/gdb.base/shr2.c                      |  10 +-
 gdb/testsuite/gdb.base/sigall.c                    | 426 ---------------------
 gdb/testsuite/gdb.base/sigaltstack.c               |   2 +
 gdb/testsuite/gdb.base/siginfo.c                   |   1 +
 gdb/testsuite/gdb.base/signals.c                   |   6 -
 gdb/testsuite/gdb.base/skip-solib-lib.c            |   8 +-
 gdb/testsuite/gdb.base/so-impl-ld.exp              |   4 +-
 gdb/testsuite/gdb.base/so-indr-cl.c                |   8 -
 gdb/testsuite/gdb.base/solib-weak.c                |   2 +
 gdb/testsuite/gdb.base/solib1.c                    |  16 +-
 gdb/testsuite/gdb.base/solib2.c                    |   5 -
 gdb/testsuite/gdb.base/structs.c                   |  91 +----
 gdb/testsuite/gdb.base/sum.c                       |   7 +-
 gdb/testsuite/gdb.base/testenv.c                   |   1 +
 gdb/testsuite/gdb.base/vforked-prog.c              |   4 -
 gdb/testsuite/gdb.base/watchpoint.c                |   4 -
 gdb/testsuite/gdb.base/weaklib1.c                  |   2 +
 gdb/testsuite/gdb.base/weaklib2.c                  |   2 +
 .../gdb.mi/mi-condbreak-call-thr-state-mt.c        |   2 +
 gdb/testsuite/gdb.mi/mi-console.c                  |   4 +-
 gdb/testsuite/gdb.mi/mi-console.exp                |   3 +-
 gdb/testsuite/gdb.mi/mi-exit-code.c                |   2 +
 gdb/testsuite/gdb.mi/mi-stack.c                    |   9 +-
 gdb/testsuite/gdb.mi/mi-syn-frame.c                |   2 +
 gdb/testsuite/gdb.mi/until.c                       |   2 +
 gdb/testsuite/gdb.mi/watch-nonstop.c               |   2 +
 gdb/testsuite/gdb.python/py-events.c               |   2 +
 gdb/testsuite/gdb.python/py-finish-breakpoint.c    |   1 +
 gdb/testsuite/gdb.reverse/shr2.c                   |   8 -
 gdb/testsuite/gdb.reverse/until-reverse.c          |  29 --
 gdb/testsuite/gdb.reverse/ur1.c                    |   7 -
 gdb/testsuite/gdb.reverse/watch-reverse.c          |   4 -
 99 files changed, 319 insertions(+), 2144 deletions(-)

-- 
1.8.4.2

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

* [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
@ 2014-10-29 16:00 ` Andreas Arnez
  2014-10-29 16:22   ` Sergio Durigan Junior
  2014-11-13 13:15   ` Yao Qi
  2014-10-29 16:01 ` [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp Andreas Arnez
                   ` (15 subsequent siblings)
  16 siblings, 2 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:00 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in so-impl-ld.exp.  Add
appropriate eye-catchers to solib1.c and refer to those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/solib1.c: Add eye-catchers.
	* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
	literal line numbers.
---
 gdb/testsuite/gdb.base/so-impl-ld.exp | 4 ++--
 gdb/testsuite/gdb.base/solib1.c       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
index 073c3df..03d10a5 100644
--- a/gdb/testsuite/gdb.base/so-impl-ld.exp
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
 
 # Verify that we can step into the second shlib call.
 #
-gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
+gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
     "step into solib call"
 
 # Verify that we can step within the shlib call.
 #
-gdb_test "next" "18\[ \t\]*\}" "step in solib call"
+gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
 
 # Verify that we can step out of the shlib call, and back out into
 # the caller.
diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c
index 2e51750..224a93d 100644
--- a/gdb/testsuite/gdb.base/solib1.c
+++ b/gdb/testsuite/gdb.base/solib1.c
@@ -14,5 +14,5 @@ int  solib_main (arg)
 #endif
 #endif
 {
-  return arg*arg;
-}
+  return arg*arg;		/* HERE */
+}				/* STEP */
-- 
1.8.4.2

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

* [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
  2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
@ 2014-10-29 16:01 ` Andreas Arnez
  2014-11-13 13:33   ` Yao Qi
  2014-10-29 16:01 ` [PATCH 05/16] Eliminate literal line numbers in ending-run.exp Andreas Arnez
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:01 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in call-ar-st.exp.  Add
appropriate eye-catchers to call-ar-st.c and refer to those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/call-ar-st.c: Add eye-catchers.
	* gdb.base/call-ar-st.exp: Refer to eye-catchers instead of
	literal line numbers.
---
 gdb/testsuite/gdb.base/call-ar-st.c   |  30 +++----
 gdb/testsuite/gdb.base/call-ar-st.exp | 165 +++++++++++++++++-----------------
 2 files changed, 100 insertions(+), 95 deletions(-)

diff --git a/gdb/testsuite/gdb.base/call-ar-st.c b/gdb/testsuite/gdb.base/call-ar-st.c
index d903f0d..f43e001 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.c
+++ b/gdb/testsuite/gdb.base/call-ar-st.c
@@ -303,8 +303,8 @@ void print_all_arrays( array_i, array_c, array_f, array_d )
      double array_d[];
 #endif
 {
-  print_int_array(array_i);
-  print_char_array(array_c);
+  print_int_array(array_i);	/* -step1- */
+  print_char_array(array_c);	/* -next1- */
   print_float_array(array_f);
   print_double_array(array_d);
 }
@@ -413,7 +413,7 @@ void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
 #endif
 {
 
-   bit_flags_combo->alpha = a;
+   bit_flags_combo->alpha = a;	/* -step3- */
    bit_flags_combo->beta = b;
    bit_flags_combo->ch1 = ch1;
    bit_flags_combo->gamma = g;
@@ -989,7 +989,7 @@ f1, f2, f3 )
      struct two_floats_t      f3;
 #endif
 {
-    printf("double : %f\n", a);
+    printf("double : %f\n", a);	/* -step2- */
     printf("double : %f\n", b);
     printf("int : %d\n", c);
     printf("int : %d\n", d);
@@ -1206,18 +1206,18 @@ int main ()  {
       float_array[index] = index/7.02;
   }
 
-  for (index = 0; index < 50; index++) {
+  for (index = 0; index < 50; index++) { /* -tbreak1- */
       integer_array[index] = -index;
   }
 
   /* Print arrays
    */
   print_char_array(char_array);
-  print_double_array(double_array);
+  print_double_array(double_array); /* -tbreak2- */
   print_float_array(float_array);
   print_student_id_shirt_color(student_id, my_shirt); 
   print_int_array(integer_array);
-  print_all_arrays(integer_array, char_array, float_array, double_array);
+  print_all_arrays(integer_array, char_array, float_array, double_array); /* -tbreak3- */
 
   /* Allocate space for large structures 
    */
@@ -1233,12 +1233,12 @@ int main ()  {
   init_array_rep(list3, 5);
   init_array_rep(list4, 10);
   printf("HELLO WORLD\n");
-  printf("BYE BYE FOR NOW\n");
-  printf("VERY GREEN GRASS\n");
+  printf("BYE BYE FOR NOW\n");	/* -tbreak4- */
+  printf("VERY GREEN GRASS\n");	/* -next2- */
 
   /* Print large structures 
    */
-  sum_array_print(10, *list1, *list2, *list3, *list4);
+  sum_array_print(10, *list1, *list2, *list3, *list4); /* -tbreak5- */
   print_array_rep(*list1, *list2, *list3);
   print_one_large_struct(*list1);
 
@@ -1278,12 +1278,12 @@ int main ()  {
    */
   a = 22.25;
   b = 33.375;
-  c = 0;
+  c = 0;			/* -tbreak6- */
   d = -25;
   e = 100;
   f = 2345;
 
-  print_long_arg_list ( a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, 
+  print_long_arg_list ( a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, /* -tbreak7- */
 			*flags, *flags_combo, *three_char, *five_char, *int_char_combo,
 			*d1, *d2, *d3, *f1, *f2, *f3);
 
@@ -1297,18 +1297,18 @@ int main ()  {
   init_two_floats ( f3, -2.345, 1.0); 
   init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, 
 		 (unsigned)0, (unsigned)1, (unsigned)0 ); 
-  init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
+  init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y', /* -tbreak8- */
 				     (unsigned)1, (unsigned)0, 'n',
 				     (unsigned)1, (unsigned)0 ); 
   init_three_chars(three_char, 'x', 'y', 'z');
   init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o');
-  init_int_char_combo(int_char_combo, 13, '!');
+  init_int_char_combo(int_char_combo, 13, '!'); /* -tbreak9- */
   init_struct_rep(struct1, 10);
   init_struct_rep(struct2, 20);
   init_struct_rep(struct3, 30);
   init_struct_rep(struct4, 40);
 
-  compute_with_small_structs(35);
+  compute_with_small_structs(35); /* -tbreak10- */
   loop_count();
   printf("HELLO WORLD\n");
   printf("BYE BYE FOR NOW\n");
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index 21ecb6e..f08b24d 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -60,13 +60,13 @@ if ![runto_main] then {
 
 get_debug_format
 
-#go -until 1209
-gdb_test "tbreak 1209" \
-    "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
-    "tbreakpoint line 1209"
+set stop_line [gdb_get_line_number "-tbreak1-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak1"
 
 gdb_test continue \
-"Continuing\\..*main \\(\\) at.*$srcfile:1209.*" \
+"Continuing\\..*main \\(\\) at.*$srcfile:$stop_line.*" \
 "run until breakpoint set at a line"
 
 
@@ -95,21 +95,21 @@ if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
     }
 }
 
-#go -until 1216
-gdb_test "tbreak 1216" \
-"Temporary breakpoint.*file.*$srcfile, line 1216.*" \
-"tbreakpoint line 1216"
+set stop_line [gdb_get_line_number "-tbreak2-"]
+gdb_test "tbreak $stop_line" \
+"Temporary breakpoint.*file.*$srcfile, line $stop_line.*" \
+"tbreakpoint at tbreak2"
 
-if ![gdb_skip_stdio_test "continue to 1216"] {
-    gdb_test_sequence "continue" "continue to 1216" {
+if ![gdb_skip_stdio_test "continue to tbreak2"] {
+    gdb_test_sequence "continue" "continue to tbreak2" {
 	"\[ \t\r\n\]+array_c :"
 	"\[ \t\r\n\]+========="
 	"\[ \t\r\n\]+\[ \t\r\n\]+Z"
 	"\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
 	"\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
 	"\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa"
-	"\[ \t\r\n\]+main.*at.*:1216"
-	"\[ \t\r\n\]+1216.*print_double_array\\(double_array\\)"
+	"\[ \t\r\n\]+main.*at.*:\[0-9\]+"
+	"\[ \t\r\n\]+\[0-9\]+.*print_double_array\\(double_array\\)"
     }
 } else {
     gdb_test "continue" ".*" ""
@@ -128,14 +128,14 @@ if ![gdb_skip_stdio_test "continue to 1216"] {
 #  }
 
 #set timeout $oldtimeout
-#go -until 1220
-gdb_test "tbreak 1220" \
-	"Temporary breakpoint.* file .*$srcfile, line 1220.*" \
-	"tbreakpoint line 1220"
-
-if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
-    ![gdb_skip_stdio_test "continuing to breakpoint 1220"] } {
-    gdb_test_sequence "continue" "continuing to breakpoint 1220" {
+set stop_line [gdb_get_line_number "-tbreak3-"]
+gdb_test "tbreak $stop_line" \
+	"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
+	"tbreakpoint at tbreak3"
+
+if {![gdb_skip_float_test "continuing to tbreak3"] && \
+    ![gdb_skip_stdio_test "continuing to tbreak3"] } {
+    gdb_test_sequence "continue" "continuing to tbreak3" {
 	"Continuing\\."
 	"\[ \t\r\n\]+array_d :"
 	"\[ \t\r\n\]+========="
@@ -145,21 +145,23 @@ if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
 	"array_f :"
 	"student id :\[\t \]+.*YELLOW"
 	"array_i :"
-	"main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
+	"main \\(\\) at .*call-ar-st.c:\[0-9\]+\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
     }
 } else {
     gdb_test "continue" ".*" ""
 }
 
 #step
+set stop_line [gdb_get_line_number "-step1-"]
 gdb_test "step" \
-    "print_all_arrays \\(array_i=<integer_array.*>, array_c=<char_array.*> .ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=<float_array.*>, array_d=<double_array.*>\\) at .*call-ar-st.c:306\[ \t\r\n\]+306.*print_int_array\\(array_i\\);.*" \
+    "print_all_arrays \\(array_i=<integer_array.*>, array_c=<char_array.*> .ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=<float_array.*>, array_d=<double_array.*>\\) at .*$srcfile:$stop_line\[ \t\r\n\]+$stop_line.*print_int_array\\(array_i\\);.*" \
     "step inside print_all_arrays"
 
 #step -over
 if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] {
+    set stop_line [gdb_get_line_number "-next1-"]
     gdb_test "next" \
-	"array_i :.*307.*print_char_array.*" \
+	"array_i :.*$stop_line.*print_char_array.*" \
 	"next over print_int_array in print-all_arrays"
 } else {
     gdb_test "next" ".*" ""
@@ -177,21 +179,21 @@ if {![gdb_skip_float_test "print print_double_array(array_d)"] && \
     }
 }
 
-#go -until 1236
-gdb_test "tbreak 1236" \
-"Temporary breakpoint.* file .*$srcfile, line 1236.*" \
-"tbreakpoint line 1236"
+set stop_line [gdb_get_line_number "-tbreak4-"]
+gdb_test "tbreak $stop_line" \
+"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
+"tbreakpoint at tbreak4"
 
-if {![gdb_skip_float_test "continuing to 1236"] && \
-    ![gdb_skip_stdio_test "continuing to 1236"] } {
-    gdb_test_sequence "continue" "continuing to 1236" {
+if {![gdb_skip_float_test "continuing to tbreak4"] && \
+    ![gdb_skip_stdio_test "continuing to tbreak4"] } {
+    gdb_test_sequence "continue" "continuing to tbreak4" {
 	"Continuing\\..*array_c"
 	"array_f"
 	"\[ \t\r\n\]+array_d :"
 	"\[ \t\r\n\]+========="
 	"\[ \t\r\n\]+0.000000"
 	"\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"
-	"\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
+	"\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:\[0-9\]+.*printf\\(.BYE BYE FOR NOW.n.\\)."
     }
 } else {
     gdb_test "continue" ".*" ""
@@ -207,10 +209,11 @@ if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
 }
 
 #step over
-if ![gdb_skip_stdio_test "next to 1237"] {
+set stop_line [gdb_get_line_number "-next2-"]
+if ![gdb_skip_stdio_test "next to next2"] {
     gdb_test "next" \
-	"BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*" \
-	"next to 1237"
+	"BYE BYE FOR NOW.*$stop_line.*printf\\(.VERY GREEN GRASS.n.\\);.*" \
+	"next to next2"
 } else {
     gdb_test "next" ".*" ""
 }
@@ -223,14 +226,14 @@ if ![gdb_skip_stdio_test "print print_array_rep(...)"] {
 	"print print_array_rep(*list1, *list2, *list3)"
 }
 
-#go -until 1241
-gdb_test "tbreak 1241" \
-    "Temporary breakpoint..* file .*$srcfile, line 1241.*" \
-    "tbreakpoint line 1241"
+set stop_line [gdb_get_line_number "-tbreak5-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint..* file .*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak5"
 
 gdb_test "continue" \
-    "main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \
-    "continue to 1241"
+    "main \\(\\) at .*$srcfile:$stop_line\r\n$stop_line\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \
+    "continue to tbreak5"
 
 
 # Run into sum_array_print, and verify that the arguments were passed
@@ -242,11 +245,11 @@ gdb_test "continue" \
 # may itself be a bug, but it's not the one we're trying to catch
 # here.  I've added something to step-test.exp for this.
 gdb_test "break sum_array_print" \
-	".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
+	".*Breakpoint ${decimal}: file .*$srcfile, line.*" \
 	"set breakpoint in sum_array_print"
 gdb_test_no_output "set print frame-arguments all"
 gdb_test "continue" \
-	".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
+    ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*$srcfile:${decimal}\[ \t\n\r\]+${decimal}.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
 	"check args of sum_array_print"
 
 #call print_array_rep(linked_list1, linked_list2, linked_list3)
@@ -263,15 +266,15 @@ gdb_test "continue" \
 #}
 
 
-#go -until 1281
-gdb_test "tbreak 1281" \
-    "Temporary breakpoint.* file .*call-ar-st.c, line 1281.*" \
-    "tbreakpoint line 1281"
+set stop_line [gdb_get_line_number "-tbreak6-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak6"
 
-if ![gdb_skip_stdio_test "continuing to 1281"] {
+if ![gdb_skip_stdio_test "continuing to tbreak6"] {
     gdb_test "continue" \
-	"Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c = 0.*" \
-	"continue to 1281"
+	"Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*$srcfile:$stop_line.*c = 0.*" \
+	"continue to tbreak6"
 } else {
     gdb_test "continue" ".*" ""
 }
@@ -339,13 +342,14 @@ if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \
     }
 }
 
-#go -until 1286
-gdb_test "tbreak 1286" \
-    "Temporary breakpoint .* file .*call-ar-st.c, line 1286.*" \
-    "tbreakpoint line 1286"
+set stop_line [gdb_get_line_number "-tbreak7-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint .* file .*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak7"
 
-gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286"
+gdb_test continue "Continuing\\..*main \\(.*\\) at.*$srcfile:$stop_line\[\t\r\n \]+$stop_line.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to tbreak7"
 
+set stop_line [gdb_get_line_number "-step2-"]
 if { [istarget "hppa*-*-hpux*"] } {
     #
     # NOTE:(FIXME)
@@ -359,24 +363,24 @@ if { [istarget "hppa*-*-hpux*"] } {
     # guo 990621
     #
     gdb_test "step" \
-	"print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);" \
+	"print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);" \
 	"step into print_long_arg_list"
 } else {
 
     # We can't just assume that a "step" will get us into
     # print_long_arg_list here,either.
     gdb_test "tbreak print_long_arg_list" \
-	"Temporary breakpoint .* file .*call-ar-st.c, line .*" \
+	"Temporary breakpoint .* file .*$srcfile, line .*" \
 	"tbreak in print_long_arg_list after stepping into memcpy"
     # The short match case below handles cases where a buffer
     # overflows or something, and expect can't deal with the full
     # line.  Perhaps a more elegant solution exists... -sts 1999-08-17
     if {![gdb_skip_float_test "step into print_long_arg_list"]} {
 	gdb_test_multiple "continue" "step into print_long_arg_list" {
-	    -re ".*print_long_arg_list \\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {
+	    -re ".*print_long_arg_list \\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {
 		pass "step into print_long_arg_list"
 	    }
-	    -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}.*\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {
+	    -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}.*\\) at .*${srcfile}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {
 		pass "step into print_long_arg_list (short match)"
 	    }
 	}
@@ -442,38 +446,39 @@ if {![gdb_skip_float_test "print_small_structs from print_long_arg_list"] && \
 }
 
 
-#go -until 1300
-gdb_test "tbreak 1300" \
-    "Temporary breakpoint.* file .*call-ar-st.c, line 1300.*" \
-    "tbreakpoint line 1300"
+set stop_line [gdb_get_line_number "-tbreak8-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak8"
 
-if ![gdb_skip_stdio_test "continuing to 1300"] {
-    gdb_test "continue" "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*call-ar-st.c:1300.*1300.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
-	    "continue to 1300"
+if ![gdb_skip_stdio_test "continuing to tbreak8"] {
+    gdb_test "continue" "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*$srcfile:$stop_line.*$stop_line.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
+	    "continue to tbreak8"
 } else {
     gdb_test "continue" ".*" ""
 }
 
 #step
+set stop_line [gdb_get_line_number "-step3-"]
 gdb_test "step" \
-    "init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:416\[ \t\n\r\]+416.*bit_flags_combo->alpha = a;" \
+    "init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*$srcfile:$stop_line\[ \t\n\r\]+$stop_line.*bit_flags_combo->alpha = a;.*" \
     "step into init_bit_flags_combo"
 
 #call print_bit_flags_combo(*bit_flags_combo)
-if ![gdb_skip_stdio_test "continuing to 1300"] {
+if ![gdb_skip_stdio_test "continuing at step3"] {
     gdb_test "print print_bit_flags_combo(*bit_flags_combo)" \
 	"alpha.*gamma.*epsilon.*ch1: y.*ch2: n.*" \
 	"print print_bit_flags_combo from init_bit_flags_combo"
 }
 
 
-#go -until 1305
-gdb_test "tbreak 1305" \
-    "Temporary breakpoint.* file .*call-ar-st.c, line 1305.*" \
-    "tbreakpoint line 1305"
+set stop_line [gdb_get_line_number "-tbreak9-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak9"
 
-gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
-"continue to 1305"
+gdb_test continue "Continuing\\..*main \\(\\) at .*$srcfile:$stop_line\[\r\n\t \]+$stop_line.*init_int_char_combo\\(int_char_combo, 13, .!.\\);.*" \
+"continue to tbreak9"
 
 #call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
 
@@ -526,13 +531,13 @@ if {![gdb_skip_float_test "print print_long_arg_list"] && \
 }
 
 
-#go -until 1311
-gdb_test "tbreak 1311" \
-    "Temporary breakpoint.* file .*call-ar-st.c, line 1311.*" \
-    "tbreakpoint line 1311"
+set stop_line [gdb_get_line_number "-tbreak10-"]
+gdb_test "tbreak $stop_line" \
+    "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
+    "tbreakpoint at tbreak10"
 
-gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \
-"continue to 1311"
+gdb_test continue "Continuing\\..*main \\(\\) at .*$srcfile:$stop_line\[ \t\n\r\]+$stop_line.*compute_with_small_structs\\(35\\);.*" \
+"continue to tbreak10"
 
 
 #call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
-- 
1.8.4.2

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

* [PATCH 02/16] Eliminate literal line numbers in dbx.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (2 preceding siblings ...)
  2014-10-29 16:01 ` [PATCH 05/16] Eliminate literal line numbers in ending-run.exp Andreas Arnez
@ 2014-10-29 16:01 ` Andreas Arnez
  2014-11-13 13:18   ` Yao Qi
  2014-10-29 16:01 ` [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp Andreas Arnez
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:01 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the commands and regexps in dbx.exp.
Add appropriate eye-catchers to average.c and sum.c and refer to those
instead.

gdb/testsuite/ChangeLog:

	* gdb.base/average.c: Add eye-catchers.
	* gdb.base/sum.c: Likewise.
	* gdb.base/dbx.exp: Use eye-catchers to determine line numbers for
	regexps dynamically.
---
 gdb/testsuite/gdb.base/average.c |  4 ++--
 gdb/testsuite/gdb.base/dbx.exp   | 16 ++++++++++------
 gdb/testsuite/gdb.base/sum.c     |  2 +-
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gdb/testsuite/gdb.base/average.c b/gdb/testsuite/gdb.base/average.c
index e1695ce..99c28cf 100644
--- a/gdb/testsuite/gdb.base/average.c
+++ b/gdb/testsuite/gdb.base/average.c
@@ -35,12 +35,12 @@ main ()
 #endif
 {
     char c;
-    int first = 0, last = 0;
+    int first = 0, last = 0;	/* stop-in-main */
     last = num-1;
 
     /* Try two test cases. */
     print_average (my_list, first, last);
-    print_average (my_list, first, last - 3);
+    print_average (my_list, first, last - 3); /* stop-at-call */
 
     exit(0);
 }
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 4383e79..20d21d1 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -243,10 +243,12 @@ proc gdb_file_cmd {arg} {
 #test_breakpoints
 #
 proc test_breakpoints { } {
-    gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
-    gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
-    gdb_test "stop at average.c:43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
-    gdb_test "stop in average.c:43" "Usage: stop in <function . address>"
+    set stop_line [gdb_get_line_number "stop-in-main"]
+    gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line $stop_line\."
+    gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:$stop_line.*"
+    set stop_line [gdb_get_line_number "stop-at-call"]
+    gdb_test "stop at average.c:$stop_line" "Breakpoint.*at.*: file.*average\.c, line $stop_line.*"
+    gdb_test "stop in average.c:$stop_line" "Usage: stop in <function . address>"
     gdb_test "stop at main" "Usage: stop at <line>"
 }
 
@@ -287,16 +289,18 @@ proc test_whereis { } {
 #test_func
 #
 proc test_func { } {
+    global srcfile2
     gdb_test "cont" ".*" "cont 1"
     gdb_test "step" ".*"
     # This always fails, but it's not clear why. -sts 1999-08-17
     setup_xfail "*-*-*"
     gdb_test "func sum" "'sum' not within current stack frame\."
-    gdb_test "stop in sum" "Breakpoint.*at.*: file.*sum\.c, line 11\."
+    set stop_line [gdb_get_line_number "stop-in-sum" $srcfile2]
+    gdb_test "stop in sum" "Breakpoint.*at.*: file.*sum\.c, line $stop_line\."
     gdb_test "cont" ".*" "cont 2"
     # This always fails, but it's not clear why. -sts 1999-08-17
     setup_xfail "*-*-*"
-    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:24\r\n24\[ \t\]+total = sum\\(list, low, high\\);"
+    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:\[0-9\]+\r\n\[0-9\]+\[ \t\]+total = sum\\(list, low, high\\);"
 }
 
 # Start with a fresh gdb.
diff --git a/gdb/testsuite/gdb.base/sum.c b/gdb/testsuite/gdb.base/sum.c
index f5a5dbf..6dd7a75 100644
--- a/gdb/testsuite/gdb.base/sum.c
+++ b/gdb/testsuite/gdb.base/sum.c
@@ -8,7 +8,7 @@ int sum(list, low, high)
 int *list, low, high;
 #endif
     {
-        int i = 0, s = 0;
+        int i = 0, s = 0;	/* stop-in-sum */
         for (i = low; i <= high; i++)
             s += list[i];
         return(s);
-- 
1.8.4.2

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

* [PATCH 05/16] Eliminate literal line numbers in ending-run.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
  2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
  2014-10-29 16:01 ` [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp Andreas Arnez
@ 2014-10-29 16:01 ` Andreas Arnez
  2014-11-13 13:44   ` Yao Qi
  2014-10-29 16:01 ` [PATCH 02/16] Eliminate literal line numbers in dbx.exp Andreas Arnez
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:01 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in ending-run.exp.  Add
appropriate eye-catchers to ending-run.c and refer to those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/ending-run.c: Add eye-catchers.
	* gdb.base/ending-run.exp: Refer to eye-catchers instead of
	literal line numbers.
---
 gdb/testsuite/gdb.base/ending-run.c   |  4 ++--
 gdb/testsuite/gdb.base/ending-run.exp | 38 +++++++++++++++++++----------------
 2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/gdb/testsuite/gdb.base/ending-run.c b/gdb/testsuite/gdb.base/ending-run.c
index 8c67706..d857cf8 100644
--- a/gdb/testsuite/gdb.base/ending-run.c
+++ b/gdb/testsuite/gdb.base/ending-run.c
@@ -11,7 +11,7 @@ int callee( x )
 int x;
 #endif
 {
-    int y = x * x;
+    int y = x * x;		/* -break1- */
     return (y - 2);
 }
 
@@ -28,6 +28,6 @@ int main()
             printf( "%d ", callee( i ));
             fflush (stdout);
         }
-    printf( " Goodbye!\n" ); fflush (stdout);
+    printf( " Goodbye!\n" ); fflush (stdout); /* -break2- */
     return 0;
 }
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 173cfd4..dc54d10 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -21,7 +21,9 @@
 
 # ending-run.exp -- Expect script to test ending a test run in gdb
 
-if { [prepare_for_testing ending-run.exp ending-run] } {
+standard_testfile
+
+if { [prepare_for_testing ${testfile}.exp $testfile] } {
     return -1
 }
 remote_exec build "rm -f core"
@@ -35,26 +37,28 @@ remote_exec build "rm -f core"
 gdb_test "b ending-run.c:1" ".*Breakpoint.*ending-run.c, line 1.*" \
 	"bpt at line before routine"
 
-gdb_test "b ending-run.c:14" \
-	".*Note.*also.*Breakpoint 2.*ending-run.c, line 14.*" \
-	"b ending-run.c:14, one"
+set break1_line [gdb_get_line_number "-break1-"]
+gdb_test "b ending-run.c:$break1_line" \
+	".*Note.*also.*Breakpoint 2.*ending-run.c, line $break1_line.*" \
+	"b ending-run.c:$break1_line, one"
 
 # Set up to go to the next-to-last line of the program
 #
-gdb_test "b ending-run.c:31" ".*Breakpoint 3.*ending-run.c, line 31.*"
+set break2_line [gdb_get_line_number "-break2-"]
+gdb_test "b ending-run.c:$break2_line" ".*Breakpoint 3.*ending-run.c, line $break2_line.*"
 
 # Expect to hit the bp at line "1", but symbolize this
 # as line "13".  Then try to clear it--this should work.
 #
 gdb_run_cmd
-gdb_test "" ".*Breakpoint.*1.*callee.*14.*" "run"
+gdb_test "" ".*Breakpoint.*1.*callee.*$break1_line.*" "run"
 
 gdb_test "cle" ".*Deleted breakpoints 1 2.*" "clear worked"
 gdb_test_multiple "i b" "cleared bp at line before routine" {
     -re ".* breakpoint .* breakpoint .*$gdb_prompt $" { 
 	fail "cleared bp at line before routine" 
     }
-    -re ".*3.*main.*31.*$gdb_prompt $" { 
+    -re ".*3.*main.*$break2_line.*$gdb_prompt $" { 
 	pass "cleared bp at line before routine" 
     }
 }
@@ -62,15 +66,15 @@ gdb_test_multiple "i b" "cleared bp at line before routine" {
 # Test some other "clear" combinations
 #
 gdb_test "b ending-run.c:1" ".*Breakpoint.*4.*"
-gdb_test "b ending-run.c:14" ".*Note.*also.*Breakpoint.*5.*" "b ending-run.c:14, two"
-gdb_test "cle ending-run.c:14" \
+gdb_test "b ending-run.c:$break1_line" ".*Note.*also.*Breakpoint.*5.*" "b ending-run.c:$break1_line, two"
+gdb_test "cle ending-run.c:$break1_line" \
 	".*Deleted breakpoint 5.*" "Cleared 2 by line"
 
-gdb_test_multiple "info line ending-run.c:14" "" {
+gdb_test_multiple "info line ending-run.c:$break1_line" "" {
     -re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
         set line_nine $expect_out(1,string)
-        gdb_test "b ending-run.c:14" ".*Breakpoint 6.*ending-run.c, line 14.*"
-        gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint 7.*" "Breakpoint 7 at *ending-run.c:14"
+        gdb_test "b ending-run.c:$break1_line" ".*Breakpoint 6.*ending-run.c, line $break1_line.*"
+        gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint 7.*" "Breakpoint 7 at *ending-run.c:$break1_line"
         gdb_test "cle" ".*Deleted breakpoints 4 6 7.*" "Clear 2 by default"
     }
     -re ".*$gdb_prompt $" {
@@ -82,7 +86,7 @@ gdb_test_multiple "i b" "all set to continue" {
     -re ".* breakpoint .* breakpoint .*$gdb_prompt $" {
         fail "all set to continue (didn't clear bps)" 
     }
-    -re ".*3.*main.*31.*$gdb_prompt $" {
+    -re ".*3.*main.*$break2_line.*$gdb_prompt $" {
         pass "all set to continue"
     }
     -re ".*$gdb_prompt $" {
@@ -95,13 +99,13 @@ gdb_test_multiple "i b" "all set to continue" {
 # is output from the program.
 #
 if ![gdb_skip_stdio_test "cont"] {
-    gdb_test "cont" ".*1 2 7 14 23 34 47 62 79.*Breakpoint.*31.*"
+    gdb_test "cont" ".*1 2 7 14 23 34 47 62 79.*Breakpoint.*$break2_line.*"
 } else {
-    gdb_test "cont" ".*Breakpoint.*31.*"
+    gdb_test "cont" ".*Breakpoint.*$break2_line.*"
 }
 
 if ![gdb_skip_stdio_test "Step to return"] {
-    gdb_test "next" ".*Goodbye!.*32.*" \
+    gdb_test "next" ".*Goodbye!.*[expr {$break2_line + 1}].*" \
 	    "Step to return"
 } else {
     gdb_test "next" ".*" ""
@@ -113,7 +117,7 @@ set program_exited 0
 set nexted 0
 
 gdb_test_multiple "next" "step out of main" {
-    -re "33\[ \t\]+\}.*$gdb_prompt $" {
+    -re "[expr {$break2_line + 2}]\[ \t\]+\}.*$gdb_prompt $" {
 	# sometimes we stop at the closing brace, if so, do another next
 	if { $nexted } {
 	    fail "step out of main"
-- 
1.8.4.2

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

* [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (3 preceding siblings ...)
  2014-10-29 16:01 ` [PATCH 02/16] Eliminate literal line numbers in dbx.exp Andreas Arnez
@ 2014-10-29 16:01 ` Andreas Arnez
  2014-11-13 13:36   ` Yao Qi
  2014-10-29 16:02 ` [PATCH 09/16] Eliminate literal line numbers in mi-console.exp Andreas Arnez
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:01 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in call-rt-st.exp.  Add
appropriate eye-catchers to call-rt-st.c and refer to those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/call-rt-st.c: Add eye-catchers.
	* gdb.base/call-rt-st.exp: Refer to eye-catchers instead of
	literal line numbers.
---
 gdb/testsuite/gdb.base/call-rt-st.c   |  6 +++---
 gdb/testsuite/gdb.base/call-rt-st.exp | 11 ++++++-----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/gdb/testsuite/gdb.base/call-rt-st.c b/gdb/testsuite/gdb.base/call-rt-st.c
index 09dd5bb..a583bab 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.c
+++ b/gdb/testsuite/gdb.base/call-rt-st.c
@@ -125,7 +125,7 @@ void loop_count () {
 
      int index;
 
-     for (index=0; index<4; index++);
+     for (index=0; index<4; index++); /* -break1- */
 }
 
 /*****************************************************************
@@ -772,9 +772,9 @@ int main ()  {
   print_int_char_combo(*int_char_combo);
   print_struct_rep(*struct1);
 
-  loop_count();
+  loop_count();			/* -finish2- */
 
-  return 0;
+  return 0;			/* -finish1- */
 }
 
 
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
index 0ca312c..925d896 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -64,19 +64,20 @@ if ![runto_main] then {
 }
 
 
+set stop_line [gdb_get_line_number "-break1-"]
 gdb_test "break loop_count" \
-    "Breakpoint.* file .*call-rt-st.c, line 128\\." \
+    "Breakpoint.* file .*call-rt-st.c, line $stop_line\\." \
     "breakpoint loop_count"
 
 gdb_test "continue" \
-    "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+128\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+" \
+    "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+$stop_line\[\t \]+for \\(index=0; index.4; index..\\);.*\[\r\n \]+" \
     "continue to loop_count"
 
 gdb_test_multiple "finish" "finish out from loop count" {
-    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*$gdb_prompt $" {
-	pass "finish out from loop_count (line 777)"
+    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
+	pass "finish out from loop_count (finish1)"
     }
-    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:775\[ \t\r\n\]+775\[\t \]+loop_count.*$gdb_prompt $" {
+    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
 	pass "finish out from loop_count (line 775)"
     }
 }
-- 
1.8.4.2

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

* [PATCH 06/16] Eliminate literal line numbers in foll-exec.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (7 preceding siblings ...)
  2014-10-29 16:02 ` [PATCH 07/16] Eliminate literal line numbers in jump.exp Andreas Arnez
@ 2014-10-29 16:02 ` Andreas Arnez
  2014-10-29 16:03 ` [PATCH 11/16] Drop non-prototype C function header variants: solib1.c Andreas Arnez
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:02 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in foll-exec.exp.  Add
appropriate eye-catchers to foll-exec.c and execd-proc.c and refer to
those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/execd-prog.c: Add eye-catchers.
	* gdb.base/foll-exec.c: Likewise.
	* gdb.base/foll-exec.exp: Refer to eye-catchers instead of literal
	line numbers.
---
 gdb/testsuite/gdb.base/execd-prog.c  |  2 +-
 gdb/testsuite/gdb.base/foll-exec.c   |  4 ++--
 gdb/testsuite/gdb.base/foll-exec.exp | 37 +++++++++++++++++++-----------------
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/gdb/testsuite/gdb.base/execd-prog.c b/gdb/testsuite/gdb.base/execd-prog.c
index 5469f65..5435f7d 100644
--- a/gdb/testsuite/gdb.base/execd-prog.c
+++ b/gdb/testsuite/gdb.base/execd-prog.c
@@ -20,7 +20,7 @@ main (argc, argv)
      should not be able to see that other definition of local_j
      after we are exec'd.
      */
-  int  local_j = argc;
+  int  local_j = argc;		/* after-exec */
   char *  s;
 
   printf ("Hello from execd-prog...\n");
diff --git a/gdb/testsuite/gdb.base/foll-exec.c b/gdb/testsuite/gdb.base/foll-exec.c
index 78c1cda..5b0d9c5 100644
--- a/gdb/testsuite/gdb.base/foll-exec.c
+++ b/gdb/testsuite/gdb.base/foll-exec.c
@@ -24,7 +24,7 @@ main ()
 
   printf ("foll-exec is about to execl(execd-prog)...\n");
 
-  execl (BASEDIR "/execd-prog",
+  execl (BASEDIR "/execd-prog",	/* tbreak-execl */
          BASEDIR "/execd-prog",
          "execl arg1 from foll-exec",
          "execl arg2 from foll-exec",
@@ -38,6 +38,6 @@ main ()
 
     printf ("foll-exec is about to execv(execd-prog)...\n");
 
-    execv (BASEDIR "/execd-prog", argv);
+    execv (BASEDIR "/execd-prog", argv); /* tbreak-execv */
   }
 }
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index c1b1354..e1b0a59 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -119,7 +119,7 @@ proc do_exec_tests {} {
    #
    send_gdb "next 3\n"
    gdb_expect {
-     -re "20.*execlp.*$gdb_prompt $"\
+     -re ".*execlp \\(.*$gdb_prompt $"\
                      {pass "step to exec call"}
      -re "$gdb_prompt $" {fail "step to exec call"}
      timeout         {fail "(timeout) step to exec call"}
@@ -149,9 +149,10 @@ proc do_exec_tests {} {
    # Try stepping through an execlp call, without catching it.
    # We should stop in execd-program, at its first statement.
    #
+   set execd_line [gdb_get_line_number "after-exec" $srcfile2]
    send_gdb "next\n"
    gdb_expect {
-     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int  local_j = argc;.*$gdb_prompt $"\
+     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int  local_j = argc;.*$gdb_prompt $"\
                      {pass "step through execlp call"}
      -re "$gdb_prompt $" {fail "step through execlp call"}
      timeout         {fail "(timeout) step through execlp call"}
@@ -162,7 +163,7 @@ proc do_exec_tests {} {
    #
    send_gdb "next\n"
    gdb_expect {
-     -re "26.*printf.*$gdb_prompt $"\
+     -re "printf \\(.Hello .*$gdb_prompt $"\
                      {pass "step after execlp call"}
      -re "$gdb_prompt $" {fail "step after execlp call"}
      timeout         {fail "(timeout) step after execlp call"}
@@ -256,7 +257,7 @@ proc do_exec_tests {} {
    #
    send_gdb "continue\n"
    gdb_expect {
-     -re ".*${srcfile2}:23.*$gdb_prompt $"\
+     -re ".*${srcfile2}:${execd_line}.*$gdb_prompt $"\
                      {pass "continue after hit catch exec"}
      -re "$gdb_prompt $" {fail "continue after hit catch exec"}
      timeout         {fail "(timeout) continue after hit catch exec"}
@@ -276,16 +277,17 @@ proc do_exec_tests {} {
    # Verify that we can follow through follow an execl()
    # call.  (We must jump around earlier exec* calls.)
    #
-   send_gdb "tbreak 27\n"
+   set tbreak_line [gdb_get_line_number "tbreak-execl" $srcfile]
+   send_gdb "tbreak ${tbreak_line}\n"
    gdb_expect {
-     -re "Temporary breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\
+     -re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\
                      {pass "prepare to jump to execl call"}
      -re "$gdb_prompt $" {fail "prepare to jump to execl call"}
      timeout         {fail "(timeout) prepare to jump to execl call"}
    }
-   send_gdb "jump 27\n"
+   send_gdb "jump ${tbreak_line}\n"
    gdb_expect {
-     -re "main.* at .*${srcfile}:27.*$gdb_prompt $"\
+     -re "main.* at .*${srcfile}:${tbreak_line}.*$gdb_prompt $"\
                      {pass "jump to execl call"}
      -re "$gdb_prompt $" {fail "jump to execl call"}
      timeout         {fail "(timeout) jump to execl call"}
@@ -298,14 +300,14 @@ proc do_exec_tests {} {
    #
    send_gdb "next 2\n"
    gdb_expect {
-     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int  local_j = argc;.*$gdb_prompt $"\
+     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int  local_j = argc;.*$gdb_prompt $"\
                      {pass "step through execl call"}
      -re "$gdb_prompt $" {fail "step through execl call"}
      timeout         {fail "(timeout) step through execl call"}
    }
    send_gdb "next\n"
    gdb_expect {
-     -re "26.*printf.*$gdb_prompt $"\
+     -re "printf \\(.Hello .*$gdb_prompt $"\
                      {pass "step after execl call"}
      -re "$gdb_prompt $" {fail "step after execl call"}
      timeout         {fail "(timeout) step after execl call"}
@@ -336,30 +338,31 @@ proc do_exec_tests {} {
    # Verify that we can follow through follow an execv()
    # call.  (We must jump around earlier exec* calls.)
    #
-   send_gdb "tbreak 41\n"
+   set tbreak_line [gdb_get_line_number "tbreak-execv"]
+   send_gdb "tbreak ${tbreak_line}\n"
    gdb_expect {
-     -re "Temporary breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\
+     -re "Temporary breakpoint .*file .*${srcfile}, line ${tbreak_line}.*$gdb_prompt $"\
                      {pass "prepare to jump to execv call"}
      -re "$gdb_prompt $" {fail "prepare to jump to execv call"}
      timeout         {fail "(timeout) prepare to jump to execv call"}
    }
-   send_gdb "jump 41\n"
+   send_gdb "jump ${tbreak_line}\n"
    gdb_expect {
-     -re "main.* at .*${srcfile}:41.*$gdb_prompt $"\
+     -re "main.* at .*${srcfile}:${tbreak_line}.*$gdb_prompt $"\
                      {pass "jump to execv call"}
      -re "$gdb_prompt $" {fail "jump to execv call"}
      timeout         {fail "(timeout) jump to execv call"}
    }
    send_gdb "next\n"
    gdb_expect {
-     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int  local_j = argc;.*$gdb_prompt $"\
+     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int  local_j = argc;.*$gdb_prompt $"\
                      {pass "step through execv call"}
      -re "$gdb_prompt $" {fail "step through execv call"}
      timeout         {fail "(timeout) step through execv call"}
    }
    send_gdb "next\n"
    gdb_expect {
-     -re "26.*printf.*$gdb_prompt $"\
+     -re "printf \\(.Hello .*$gdb_prompt $"\
                      {pass "step after execv call"}
      -re "$gdb_prompt $" {fail "step after execv call"}
      timeout         {fail "(timeout) step after execv call"}
@@ -393,7 +396,7 @@ proc do_exec_tests {} {
    #
    send_gdb "continue\n"
    gdb_expect {
-     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:23.*int  local_j = argc;.*$gdb_prompt $"\
+     -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line}.*int  local_j = argc;.*$gdb_prompt $"\
                      {pass "continue through exec"}
      -re "$gdb_prompt $" {fail "continue through exec"}
      timeout         {fail "(timeout) continue through exec"}
-- 
1.8.4.2

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

* [PATCH 07/16] Eliminate literal line numbers in jump.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (6 preceding siblings ...)
  2014-10-29 16:02 ` [PATCH 08/16] Eliminate literal line numbers in shlib-call.exp Andreas Arnez
@ 2014-10-29 16:02 ` Andreas Arnez
  2014-10-29 16:02 ` [PATCH 06/16] Eliminate literal line numbers in foll-exec.exp Andreas Arnez
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:02 UTC (permalink / raw)
  To: gdb-patches

Remove literal line numbers from the regexps in jump.exp.  Add
appropriate eye-catchers to jump.c and refer to those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/jump.c: Add eye-catchers.
	* gdb.base/jump.exp: Refer to eye-catchers instead of literal line
	numbers.
---
 gdb/testsuite/gdb.base/jump.c   |  6 +++---
 gdb/testsuite/gdb.base/jump.exp | 29 ++++++++++++++++-------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.base/jump.c b/gdb/testsuite/gdb.base/jump.c
index aae94f7..3c05244 100644
--- a/gdb/testsuite/gdb.base/jump.c
+++ b/gdb/testsuite/gdb.base/jump.c
@@ -9,7 +9,7 @@ static int square (x)
   int  x;
 #endif
 {
-  return x*x;
+  return x*x;			/* out-of-func */
 }
 
 
@@ -18,7 +18,7 @@ int main ()
   int i = 99;
 
   i++;
-  i = square (i);
-  i--;
+  i = square (i);		/* bp-on-call */
+  i--;				/* bp-on-non-call */
   return 0;
 }
diff --git a/gdb/testsuite/gdb.base/jump.exp b/gdb/testsuite/gdb.base/jump.exp
index f26c60c..7cc957d 100644
--- a/gdb/testsuite/gdb.base/jump.exp
+++ b/gdb/testsuite/gdb.base/jump.exp
@@ -38,8 +38,9 @@ if ![runto_main] then {
 # The statement doesn't contain a function call.
 #
 set bp_on_non_call 0
-gdb_test_multiple "break 22" "break before jump to non-call" {
-    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 22.*$gdb_prompt $" {
+set non_call_line [gdb_get_line_number "bp-on-non-call"]
+gdb_test_multiple "break $non_call_line" "break before jump to non-call" {
+    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
 	set bp_on_non_call $expect_out(1,string)
 	pass "break before jump to non-call"
     }
@@ -47,15 +48,16 @@ gdb_test_multiple "break 22" "break before jump to non-call" {
 
 # Can we jump to the statement?  Do we stop there?
 #
-gdb_test "jump 22" "Breakpoint \[0-9\]*, .*${srcfile}:22.*" \
+gdb_test "jump $non_call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
     "jump to non-call"
 
 # Set a breakpoint on the statement that we're about to jump to.
 # The statement does contain a function call.
 #
 set bp_on_call 0
-gdb_test_multiple "break 21" "break before jump to call" {
-    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 21.*$gdb_prompt $" {
+set call_line [gdb_get_line_number "bp-on-call"]
+gdb_test_multiple "break $call_line" "break before jump to call" {
+    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
 	set bp_on_call $expect_out(1,string)
 	pass "break before jump to call"
     }
@@ -63,8 +65,8 @@ gdb_test_multiple "break 21" "break before jump to call" {
 
 # Can we jump to the statement?  Do we stop there?
 #
-gdb_test "jump 21" \
-    "Breakpoint \[0-9\]*, .*${srcfile}:21.*" \
+gdb_test "jump $call_line" \
+    "Breakpoint \[0-9\]*, .*${srcfile}:$call_line.*" \
     "jump to call"
 
 # If we disable the breakpoint at the function call, and then
@@ -73,7 +75,7 @@ gdb_test "jump 21" \
 #
 gdb_test_no_output "disable $bp_on_call" "disable breakpoint on call"
 
-gdb_test "jump 21" "Breakpoint \[0-9\]*, .*${srcfile}:22.*" \
+gdb_test "jump $call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
     "jump to call with disabled breakpoint"
 
 # Verify that GDB responds gracefully to the "jump" command without
@@ -86,7 +88,7 @@ gdb_test "jump" "Argument required .starting address.*" \
 # Verify that GDB responds gracefully to the "jump" command with
 # trailing junk.
 #
-gdb_test "jump 21 100" \
+gdb_test "jump $call_line 100" \
     "malformed linespec error: unexpected number, \"100\"" \
     "jump with trailing argument junk"
 
@@ -99,16 +101,17 @@ gdb_test "jump 21 100" \
 # Try it both ways: confirming and not confirming the jump.
 #
 
-gdb_test "jump 12" \
+set out_line [gdb_get_line_number "out-of-func"]
+gdb_test "jump $out_line" \
     "Not confirmed.*" \
     "aborted jump out of current function" \
-    "Line 12 is not in `main'.  Jump anyway.*y or n. $" \
+    "Line $out_line is not in `main'.  Jump anyway.*y or n. $" \
     "n"
 
-gdb_test "jump 12" \
+gdb_test "jump $out_line" \
     "Continuing at.*" \
     "jump out of current function" \
-    "Line 12 is not in `main'.  Jump anyway.*y or n. $" \
+    "Line $out_line is not in `main'.  Jump anyway.*y or n. $" \
     "y"
 
 gdb_exit
-- 
1.8.4.2

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

* [PATCH 09/16] Eliminate literal line numbers in mi-console.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (4 preceding siblings ...)
  2014-10-29 16:01 ` [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp Andreas Arnez
@ 2014-10-29 16:02 ` Andreas Arnez
  2014-10-29 16:02 ` [PATCH 08/16] Eliminate literal line numbers in shlib-call.exp Andreas Arnez
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:02 UTC (permalink / raw)
  To: gdb-patches

Remove the literal line number from a regexp in mi-console.exp.  Add
an appropriate eye-catcher to mi-console.c and refer to that instead.

gdb/testsuite/ChangeLog:

	* gdb.mi/mi-console.c: Add eye-catcher.
	* gdb.mi/mi-console.exp (semihosted_string): Refer to eye-catcher
	instead of literal line number.
---
 gdb/testsuite/gdb.mi/mi-console.c   | 2 +-
 gdb/testsuite/gdb.mi/mi-console.exp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-console.c b/gdb/testsuite/gdb.mi/mi-console.c
index ffed9f0..0cd2243 100644
--- a/gdb/testsuite/gdb.mi/mi-console.c
+++ b/gdb/testsuite/gdb.mi/mi-console.c
@@ -11,4 +11,4 @@ int
 main ()
 {
   hello ();
-}
+} /* after-hello */
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
index a98cba3..86645c0 100644
--- a/gdb/testsuite/gdb.mi/mi-console.exp
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -89,7 +89,8 @@ mi_gdb_test "220-exec-next" \
 	    "Testing console output" \
 	    $output
 
-mi_expect_stop "end-stepping-range" "main" "" ".*mi-console.c" "14" "" \
+set line [gdb_get_line_number "after-hello"]
+mi_expect_stop "end-stepping-range" "main" "" ".*mi-console.c" $line "" \
     "finished step over hello"
     
 mi_gdb_exit
-- 
1.8.4.2

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

* [PATCH 08/16] Eliminate literal line numbers in shlib-call.exp
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (5 preceding siblings ...)
  2014-10-29 16:02 ` [PATCH 09/16] Eliminate literal line numbers in mi-console.exp Andreas Arnez
@ 2014-10-29 16:02 ` Andreas Arnez
  2014-10-29 16:02 ` [PATCH 07/16] Eliminate literal line numbers in jump.exp Andreas Arnez
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:02 UTC (permalink / raw)
  To: gdb-patches

Remove the literal line number from a regexp in shlib-call.exp.  Add
an appropriate eye-catcher to shr2.c and refer to that instead.

gdb/testsuite/ChangeLog:

	* gdb.base/shr2.c: Add eye-catcher.
	* gdb.base/shlib-call.exp: Refer to eye-catcher instead of literal
	line number.
---
 gdb/testsuite/gdb.base/shlib-call.exp | 2 +-
 gdb/testsuite/gdb.base/shr2.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 74a5429..f3f7bee 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -111,7 +111,7 @@ gdb_test "break shr2" \
     "breakpoint function shr2"
 
 gdb_test "continue" \
-	"Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:7.*7.*return 2.x;" \
+	"Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:.*shr2-return \\*\\/" \
 	"run until breakpoint set at a function"
 
 
diff --git a/gdb/testsuite/gdb.base/shr2.c b/gdb/testsuite/gdb.base/shr2.c
index de34986..36a71b3 100644
--- a/gdb/testsuite/gdb.base/shr2.c
+++ b/gdb/testsuite/gdb.base/shr2.c
@@ -4,7 +4,7 @@ int shr2(int x)
 int shr2(x) int x;
 #endif
 {
-  return 2*x;
+  return 2*x;			/* shr2-return */
 }
 
 #ifdef PROTOTYPES
-- 
1.8.4.2

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

* [PATCH 12/16] Drop non-prototype C function header variants: 'break' test case
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (10 preceding siblings ...)
  2014-10-29 16:03 ` [PATCH 10/16] 'callfuncs' test case: Fix typo in prototyped version Andreas Arnez
@ 2014-10-29 16:03 ` Andreas Arnez
  2014-10-29 16:04 ` [PATCH 14/16] Drop non-prototype C function header variants: 'sepdebug' " Andreas Arnez
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:03 UTC (permalink / raw)
  To: gdb-patches

Remove old-style function headers from break.c and break1.c.  Adjust
break.exp accordingly; in particular eliminate references to the
removed locations "breakpoint 9, 13, and 16" from break.exp.

gdb/testsuite/ChangeLog:

	* gdb.base/break.c: Remove #ifdef PROTOTYPES, keep prototyped
	variant.
	* gdb.base/break1.c: Likewise.
	* gdb.base/break.exp: Drop references to removed code.
---
 gdb/testsuite/gdb.base/break.c   | 29 -----------------------------
 gdb/testsuite/gdb.base/break.exp | 29 ++++++++++-------------------
 gdb/testsuite/gdb.base/break1.c  |  7 -------
 3 files changed, 10 insertions(+), 55 deletions(-)

diff --git a/gdb/testsuite/gdb.base/break.c b/gdb/testsuite/gdb.base/break.c
index 0fd8f44..b22e430 100644
--- a/gdb/testsuite/gdb.base/break.c
+++ b/gdb/testsuite/gdb.base/break.c
@@ -18,17 +18,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 extern int marker1 (void);
 extern int marker2 (int a);
 extern void marker3 (char *a, char *b);
 extern void marker4 (long d);
-#else
-extern int marker1 ();
-extern int marker2 ();
-extern void marker3 ();
-extern void marker4 ();
-#endif
 
 /* We're used by a test that requires malloc, so make sure it is in
    the executable.  */
@@ -42,17 +35,10 @@ void *need_malloc ()
  *	testing stack backtraces and such.
  */
 
-#ifdef PROTOTYPES
 int factorial(int);
 
 int
 main (int argc, char **argv, char **envp)
-#else
-int
-main (argc, argv, envp)
-int argc;
-char *argv[], **envp;
-#endif
 {
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
@@ -72,12 +58,7 @@ char *argv[], **envp;
     return argc;  /* set breakpoint 10 here */
 } /* set breakpoint 10a here */
 
-#ifdef PROTOTYPES
 int factorial (int value)
-#else
-int factorial (value)
-int value;
-#endif
 {
   if (value > 1) {  /* set breakpoint 7 here */
 	value *= factorial (value - 1);
@@ -85,12 +66,7 @@ int value;
     return (value); /* set breakpoint 19 here */
 }
 
-#ifdef PROTOTYPES
 int multi_line_if_conditional (int a, int b, int c)
-#else
-int multi_line_if_conditional (a, b, c)
-  int a, b, c;
-#endif
 {
   if (a    /* set breakpoint 3 here */
       && b
@@ -100,12 +76,7 @@ int multi_line_if_conditional (a, b, c)
     return 1;
 }
 
-#ifdef PROTOTYPES
 int multi_line_while_conditional (int a, int b, int c)
-#else
-int multi_line_while_conditional (a, b, c)
-  int a, b, c;
-#endif
 {
   while (a /* set breakpoint 4 here */
       && b
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index af4dbda..055c379 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -77,7 +77,7 @@ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 # board.  So, to be sure, we do a list command.
 #
 gdb_test "list main" \
-    ".*main \\(argc, argv, envp\\).*" \
+    ".*main \\(int argc, char \\*\\*argv, char \\*\\*envp\\).*" \
     "use `list' to establish default source file"
 gdb_test "break $bp_location1" \
     "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\." \
@@ -126,12 +126,11 @@ if {$hp_aCC_compiler} {
 
 set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
 set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
-set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
 
 gdb_test "info break" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$main_line.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile1:($bp_location8|$bp_location9).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile1:$bp_location8.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in factorial$proto at .*$srcfile:$bp_location7.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
@@ -363,7 +362,7 @@ gdb_test "" \
     "run until function breakpoint"
 
 # Test the 'list' commands sets current file for the 'break LINENO' command.
-set bp_marker1 [gdb_get_line_number "set breakpoint 16 here" ${srcfile1}]
+set bp_marker1 [gdb_get_line_number "set breakpoint 15 here" ${srcfile1}]
 gdb_test "list marker1" ".*"
 gdb_test "break $bp_marker1" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*${srcfile1}, line ${bp_marker1}\\." \
          "break lineno"
@@ -386,7 +385,7 @@ for {set i 6} {$i >= 1} {incr i -1} {
 #
 # Run until the breakpoint set at a quoted function
 #
-gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*" \
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:$bp_location8.*" \
 		"run until quoted breakpoint"
 #
 # run until the file:function breakpoint at a line number in a file
@@ -644,7 +643,7 @@ gdb_test "break \$foo" \
 # Verify that we can set and trigger a breakpoint in a user-called function.
 #
 gdb_test "break marker2" \
-    "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*" \
+    "Breakpoint (\[0-9\]*) at .*, line $bp_location8.*" \
     "set breakpoint on to-be-called function"
 
 gdb_test "print marker2(99)" \
@@ -658,10 +657,10 @@ gdb_test "print marker2(99)" \
 # for hppa*-*-hpux.
 #
 gdb_test_multiple "bt" "backtrace while in called function" {
-    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*_sr4export.*$gdb_prompt $" {
+    -re "#0\[ \t\]*($hex in )?marker2.*:$bp_location8\r\n#1.*_sr4export.*$gdb_prompt $" {
 	pass "backtrace while in called function"
     }
-    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*function called from gdb.*$gdb_prompt $" {
+    -re "#0\[ \t\]*($hex in )?marker2.*:$bp_location8\r\n#1.*function called from gdb.*$gdb_prompt $" {
 	pass "backtrace while in called function"
     }
 }
@@ -671,13 +670,13 @@ gdb_test_multiple "bt" "backtrace while in called function" {
 # breakpoint inserted by GDB at the program's entry point.
 #
 gdb_test_multiple "finish" "finish from called function" {
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.* in _sr4export.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.* in _sr4export.*$gdb_prompt $" {
 	pass "finish from called function"
     }
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*function called from gdb.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.*function called from gdb.*$gdb_prompt $" {
 	pass "finish from called function"
     }
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*Value returned.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.*Value returned.*$gdb_prompt $" {
 	pass "finish from called function"
     }
 }
@@ -880,19 +879,11 @@ gdb_test_multiple "" $test {
 # has no exactly matching line symbol, and GDB reports the breakpoint
 # as if it were in the middle of a line rather than at the beginning.
 
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
 set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
 
 gdb_test_multiple "continue" \
     "run until breakpoint set at small function, optimized file" {
-	-re "Breakpoint $decimal, marker4 \\(d=(d@entry=)?177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
-	    pass "run until breakpoint set at small function, optimized file"
-	}
-	-re "Breakpoint $decimal, $hex in marker4 \\(d=(d@entry=)?177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
-	    pass "run until breakpoint set at small function, optimized file"
-	}
 	-re "Breakpoint $decimal, marker4 \\(d=(d@entry=)?177601976\\) at .*$srcfile1:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
-	    # marker4() is defined at line 46 when compiled with -DPROTOTYPES
 	    pass "run until breakpoint set at small function, optimized file (line bp_location14)"
 	}
 	-re "Breakpoint $decimal, factorial \\(.*\\) .*\{\r\n$gdb_prompt" {
diff --git a/gdb/testsuite/gdb.base/break1.c b/gdb/testsuite/gdb.base/break1.c
index e536b72..d8060f3 100644
--- a/gdb/testsuite/gdb.base/break1.c
+++ b/gdb/testsuite/gdb.base/break1.c
@@ -53,14 +53,7 @@ int some_variable;
    These functions are in a separate source file to prevent an
    optimizing compiler from inlining them and optimizing them away. */
 
-#ifdef PROTOTYPES
 int marker1 (void) { return (0); }	/* set breakpoint 15 here */
 int marker2 (int a) { return (1); }	/* set breakpoint 8 here */
 void marker3 (char *a, char *b) {}	/* set breakpoint 17 here */
 void marker4 (long d) { values[0].a_field = d; }	/* set breakpoint 14 here */
-#else
-int marker1 () { return (0); }		/* set breakpoint 16 here */
-int marker2 (a) int a; { return (1); }	/* set breakpoint 9 here */
-void marker3 (a, b) char *a, *b; {}	/* set breakpoint 18 here */
-void marker4 (d) long d; { values[0].a_field = d; }	/* set breakpoint 13 here */
-#endif
-- 
1.8.4.2

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

* [PATCH 10/16] 'callfuncs' test case: Fix typo in prototyped version
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (9 preceding siblings ...)
  2014-10-29 16:03 ` [PATCH 11/16] Drop non-prototype C function header variants: solib1.c Andreas Arnez
@ 2014-10-29 16:03 ` Andreas Arnez
  2014-10-29 16:03 ` [PATCH 12/16] Drop non-prototype C function header variants: 'break' test case Andreas Arnez
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:03 UTC (permalink / raw)
  To: gdb-patches

Fix a small typo in callfuncs.c which leads to a compile error when
the PROTOTYPES macro is defined.

gdb/testsuite/ChangeLog:

	* gdb.base/callfuncs.c (t_structs_ldc): Renamed from t_structs_fc
	in conditional code guarded by #ifdef PROTOTYPES.
---
 gdb/testsuite/gdb.base/callfuncs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c
index 24fd33c..8548757 100644
--- a/gdb/testsuite/gdb.base/callfuncs.c
+++ b/gdb/testsuite/gdb.base/callfuncs.c
@@ -216,7 +216,7 @@ char  *t_structs_a (struct struct1 tstruct)
 #ifdef TEST_COMPLEX
 float _Complex t_structs_fc (struct struct1 tstruct) { return tstruct.fc;}
 double _Complex t_structs_dc (struct struct1 tstruct) { return tstruct.dc;}
-long double _Complex t_structs_fc (struct struct1 tstruct) { return tstruct.ldc;}
+long double _Complex t_structs_ldc (struct struct1 tstruct) { return tstruct.ldc;}
 #endif
 #else
 char   t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
-- 
1.8.4.2

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

* [PATCH 11/16] Drop non-prototype C function header variants: solib1.c
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (8 preceding siblings ...)
  2014-10-29 16:02 ` [PATCH 06/16] Eliminate literal line numbers in foll-exec.exp Andreas Arnez
@ 2014-10-29 16:03 ` Andreas Arnez
  2014-10-29 16:03 ` [PATCH 10/16] 'callfuncs' test case: Fix typo in prototyped version Andreas Arnez
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:03 UTC (permalink / raw)
  To: gdb-patches

Clean up solib1.c by removing the #ifdef PROTOTYPES conditional.

gdb/testsuite/ChangeLog:

	* gdb.base/solib1.c: Remove #ifdef PROTOTYPES, keep prototyped
	variant.
---
 gdb/testsuite/gdb.base/solib1.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c
index 224a93d..c7d17f4 100644
--- a/gdb/testsuite/gdb.base/solib1.c
+++ b/gdb/testsuite/gdb.base/solib1.c
@@ -3,16 +3,10 @@
    the square of its integer argument.
    */
 #if defined(__cplusplus) || defined(__STDCPP__)
-extern "C" int
-solib_main (int arg)
-#else
-#ifdef PROTOTYPES
-int  solib_main (int arg)
-#else
-int  solib_main (arg)
-  int  arg;
-#endif
+extern "C"
 #endif
+int
+solib_main (int arg)
 {
   return arg*arg;		/* HERE */
 }				/* STEP */
-- 
1.8.4.2

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

* [PATCH 14/16] Drop non-prototype C function header variants: 'sepdebug' test case
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (11 preceding siblings ...)
  2014-10-29 16:03 ` [PATCH 12/16] Drop non-prototype C function header variants: 'break' test case Andreas Arnez
@ 2014-10-29 16:04 ` Andreas Arnez
  2014-10-29 16:04 ` [PATCH 16/16] GDB testsuite: Fix warnings with -std=gnu11 Andreas Arnez
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:04 UTC (permalink / raw)
  To: gdb-patches

Remove old-style function header variants from sepdebug.c.  Eliminate
references to the removed locations "breakpoint 9" and "breakpoint 13"
from sepdebug.exp.

gdb/testsuite/ChangeLog:

	* gdb.base/sepdebug.c: Remove #ifdef PROTOTYPES, keep prototyped
	variant.
	* gdb.base/sepdebug.exp: Drop references to removed code.
---
 gdb/testsuite/gdb.base/sepdebug.c   | 29 -----------------------------
 gdb/testsuite/gdb.base/sepdebug.exp | 30 ++++++++++++------------------
 2 files changed, 12 insertions(+), 47 deletions(-)

diff --git a/gdb/testsuite/gdb.base/sepdebug.c b/gdb/testsuite/gdb.base/sepdebug.c
index 21e6200..36c9733 100644
--- a/gdb/testsuite/gdb.base/sepdebug.c
+++ b/gdb/testsuite/gdb.base/sepdebug.c
@@ -23,34 +23,20 @@
  * of gcc have or have had problems with this).
  */
 
-#ifdef PROTOTYPES
 int marker1 (void) { return (0); }
 int marker2 (int a) { return (1); } /* set breakpoint 8 here */
 void marker3 (char *a, char *b) {}
 void marker4 (long d) {} /* set breakpoint 14 here */
-#else
-int marker1 () { return (0); }
-int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
-void marker3 (a, b) char *a, *b; {}
-void marker4 (d) long d; {}  /* set breakpoint 13 here */
-#endif
 
 /*
  *	This simple classical example of recursion is useful for
  *	testing stack backtraces and such.
  */
 
-#ifdef PROTOTYPES
 int factorial(int);
 
 int
 main (int argc, char **argv, char **envp)
-#else
-int
-main (argc, argv, envp)
-int argc;
-char *argv[], **envp;
-#endif
 {
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
@@ -66,12 +52,7 @@ char *argv[], **envp;
     return argc;  /* set breakpoint 10 here */
 }
 
-#ifdef PROTOTYPES
 int factorial (int value)
-#else
-int factorial (value)
-int value;
-#endif
 {
   if (value > 1) {  /* set breakpoint 7 here */
 	value *= factorial (value - 1);
@@ -79,12 +60,7 @@ int value;
     return (value);
 }
 
-#ifdef PROTOTYPES
 int multi_line_if_conditional (int a, int b, int c)
-#else
-int multi_line_if_conditional (a, b, c)
-  int a, b, c;
-#endif
 {
   if (a    /* set breakpoint 3 here */
       && b
@@ -94,12 +70,7 @@ int multi_line_if_conditional (a, b, c)
     return 1;
 }
 
-#ifdef PROTOTYPES
 int multi_line_while_conditional (int a, int b, int c)
-#else
-int multi_line_while_conditional (a, b, c)
-  int a, b, c;
-#endif
 {
   while (a /* set breakpoint 4 here */
       && b
diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp
index b1ca433..d6abf9a 100644
--- a/gdb/testsuite/gdb.base/sepdebug.exp
+++ b/gdb/testsuite/gdb.base/sepdebug.exp
@@ -111,7 +111,7 @@ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 # board.  So, to be sure, we do a list command.
 #
 gdb_test "list main" \
-    ".*main \\(argc, argv, envp\\).*" \
+    ".*main \\(int argc, char \\*\\*argv, char \\*\\*envp\\).*" \
     "use `list' to establish default source file"
 gdb_test "break $bp_location1" \
     "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\." \
@@ -154,12 +154,11 @@ set main_line $bp_location6
 
 set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
 set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
-set bp_location9 [gdb_get_line_number "set breakpoint 9 here"]
 
 gdb_test "info break" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$main_line.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile:($bp_location8|$bp_location9).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile:$bp_location8.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in factorial at .*$srcfile:$bp_location7.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
@@ -198,7 +197,7 @@ for {set i 6} {$i >= 1} {incr i -1} {
 #
 # Run until the breakpoint set at a quoted function
 #
-gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile:($bp_location8|$bp_location9).*" \
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile:$bp_location8.*" \
 		"run until quoted breakpoint"
 #
 # run until the file:function breakpoint at a line number in a file
@@ -448,7 +447,7 @@ gdb_test "break \$foo" \
 #
 
 gdb_test "break marker2" \
-    "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*" \
+    "Breakpoint (\[0-9\]*) at .*, line $bp_location8.*" \
     "set breakpoint on to-be-called function"
 
 gdb_test "print marker2(99)" \
@@ -463,10 +462,10 @@ gdb_test "print marker2(99)" \
 #
 
 gdb_test_multiple "bt" "backtrace while in called function" {
-    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*_sr4export.*$gdb_prompt $" {
+    -re "#0\[ \t\]*($hex in )?marker2.*:$bp_location8\r\n#1.*_sr4export.*$gdb_prompt $" {
 	pass "backtrace while in called function"
     }
-    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*function called from gdb.*$gdb_prompt $" {
+    -re "#0\[ \t\]*($hex in )?marker2.*:$bp_location8\r\n#1.*function called from gdb.*$gdb_prompt $" {
 	pass "backtrace while in called function"
     }
 }
@@ -477,13 +476,13 @@ gdb_test_multiple "bt" "backtrace while in called function" {
 #
 
 gdb_test_multiple "finish" "finish from called function" {
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.* in _sr4export.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.* in _sr4export.*$gdb_prompt $" {
 	pass "finish from called function"
     }
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*function called from gdb.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.*function called from gdb.*$gdb_prompt $" {
 	pass "finish from called function"
     }
-    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*Value returned.*$gdb_prompt $" {
+    -re "Run till exit from .*marker2.* at .*$bp_location8\r\n.*Value returned.*$gdb_prompt $" {
 	pass "finish from called function"
     }
 }
@@ -694,21 +693,16 @@ proc test_different_dir {type test_different_dir xfail} {
 	# has no exactly matching line symbol, and GDB reports the breakpoint
 	# as if it were in the middle of a line rather than at the beginning.
 
-	set bp_location13 [gdb_get_line_number "set breakpoint 13 here"]
 	set bp_location14 [gdb_get_line_number "set breakpoint 14 here"]
 	if {$xfail} {
 	    setup_xfail "*-*-*"
 	}
 
 	gdb_test_multiple "continue" "run until breakpoint set at small function, optimized file" {
-	    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*$gdb_prompt $" {
-		pass "run until breakpoint set at small function, optimized file"
-	    }
-	    -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*$gdb_prompt $" {
-		pass "run until breakpoint set at small function, optimized file"
-	    }
 	    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*$gdb_prompt $" {
-		# marker4() is defined at line 46 when compiled with -DPROTOTYPES
+		pass "run until breakpoint set at small function, optimized file (line bp_location14)"
+	    }
+	    -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*$gdb_prompt $" {
 		pass "run until breakpoint set at small function, optimized file (line bp_location14)"
 	    }
 	}
-- 
1.8.4.2

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

* [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (14 preceding siblings ...)
  2014-10-29 16:04 ` [PATCH 15/16] GDB testsuite: drop non-prototype C function header variants Andreas Arnez
@ 2014-10-29 16:04 ` Andreas Arnez
  2014-11-12 12:33   ` Pedro Alves
  2014-11-13 14:06 ` [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Yao Qi
  16 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:04 UTC (permalink / raw)
  To: gdb-patches

Remove old-style function header variants from list0.h and list1.c.
Fill the removed lines with comments or empty lines, such that the
line numbering is undisturbed.

gdb/testsuite/ChangeLog:

	* gdb.base/list0.h: Remove #ifdef PROTOTYPES, keep prototyped
	variant.  Preserve original line numbering.
	* gdb.base/list1.c: Likewise.
---
 gdb/testsuite/gdb.base/list0.h |  8 ++++----
 gdb/testsuite/gdb.base/list1.c | 20 ++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.base/list0.h b/gdb/testsuite/gdb.base/list0.h
index d468330..42a4fe0 100644
--- a/gdb/testsuite/gdb.base/list0.h
+++ b/gdb/testsuite/gdb.base/list0.h
@@ -1,10 +1,10 @@
 /* An include file that actually causes code to be generated in the including file.  This is known to cause problems on some systems. */
-#ifdef PROTOTYPES
+
 extern void bar(int);
 static void foo (int x)
-#else
-static void foo (x) int x;
-#endif
+/* !
+   !
+   ! */
 {
     bar (x++);
     bar (x++);
diff --git a/gdb/testsuite/gdb.base/list1.c b/gdb/testsuite/gdb.base/list1.c
index 6094104..a9f614f 100644
--- a/gdb/testsuite/gdb.base/list1.c
+++ b/gdb/testsuite/gdb.base/list1.c
@@ -1,11 +1,11 @@
 #include <stdio.h>
 
-#ifdef PROTOTYPES
+
 void long_line (); int oof (int);
 void bar (int x)
-#else
-void bar (x) int x;
-#endif
+/* -
+   -
+   - */
 {
     printf ("%d\n", x);
 
@@ -18,9 +18,9 @@ unused ()
     /* Not used for anything */
 }
 /* This routine has a very long line that will break searching in older versions of GDB.  */
-#ifdef PROTOTYPES
+
 void
-#endif
+
 long_line ()
 {
   oof (67);
@@ -29,11 +29,11 @@ long_line ()
 
   oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*  5 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 10 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (!
 12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 15 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 20 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 25 */     !
  oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 30 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 35 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (1!
 2);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);!
   oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 40 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 45 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 50 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    !
 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 55 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /* 60 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12); !
  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oo!
 f (12);  oof (12);  oof (12);  oof (12); /* 65 */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (12); /*    */      oof (12);  oof (12);  oof (12);  oof (12);  oof (12);  oof (1234); /* 70 */
 }
-#ifdef PROTOTYPES
+
 int oof (int n)
-#else
-oof (n) int n;
-#endif
+/* o
+   o
+   o */
 {
   return n + 1;
 }
-- 
1.8.4.2

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

* [PATCH 15/16] GDB testsuite: drop non-prototype C function header variants
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (13 preceding siblings ...)
  2014-10-29 16:04 ` [PATCH 16/16] GDB testsuite: Fix warnings with -std=gnu11 Andreas Arnez
@ 2014-10-29 16:04 ` Andreas Arnez
  2014-10-29 16:04 ` [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case Andreas Arnez
  2014-11-13 14:06 ` [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Yao Qi
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:04 UTC (permalink / raw)
  To: gdb-patches

Remove many old-style function header variants in C source files of
the GDB test suite, using the 'unifdef' tool with '-DPROTOTYPES=1'.

gdb/testsuite/ChangeLog:

	* gdb.base/annota1.c: Remove #ifdef PROTOTYPES, keep prototyped
	variant.
	* gdb.base/annota3.c: Likewise.
	* gdb.base/async.c: Likewise.
	* gdb.base/average.c: Likewise.
	* gdb.base/call-ar-st.c: Likewise.
	* gdb.base/call-rt-st.c: Likewise.
	* gdb.base/call-sc.c: Likewise.
	* gdb.base/call-strs.c: Likewise.
	* gdb.base/callfuncs.c: Likewise.
	* gdb.base/ending-run.c: Likewise.
	* gdb.base/execd-prog.c: Likewise.
	* gdb.base/exprs.c: Likewise.
	* gdb.base/foll-exec.c: Likewise.
	* gdb.base/foll-fork.c: Likewise.
	* gdb.base/foll-vfork.c: Likewise.
	* gdb.base/funcargs.c: Likewise.
	* gdb.base/gcore.c: Likewise.
	* gdb.base/jump.c: Likewise.
	* gdb.base/langs0.c: Likewise.
	* gdb.base/langs1.c: Likewise.
	* gdb.base/langs2.c: Likewise.
	* gdb.base/mips_pro.c: Likewise.
	* gdb.base/nodebug.c: Likewise.
	* gdb.base/opaque0.c: Likewise.
	* gdb.base/opaque1.c: Likewise.
	* gdb.base/recurse.c: Likewise.
	* gdb.base/run.c: Likewise.
	* gdb.base/scope0.c: Likewise.
	* gdb.base/scope1.c: Likewise.
	* gdb.base/setshow.c: Likewise.
	* gdb.base/setvar.c: Likewise.
	* gdb.base/shmain.c: Likewise.
	* gdb.base/shr1.c: Likewise.
	* gdb.base/shr2.c: Likewise.
	* gdb.base/sigall.c: Likewise.
	* gdb.base/signals.c: Likewise.
	* gdb.base/so-indr-cl.c: Likewise.
	* gdb.base/solib2.c: Likewise.
	* gdb.base/structs.c: Likewise.
	* gdb.base/sum.c: Likewise.
	* gdb.base/vforked-prog.c: Likewise.
	* gdb.base/watchpoint.c: Likewise.
	* gdb.reverse/shr2.c: Likewise.
	* gdb.reverse/until-reverse.c: Likewise.
	* gdb.reverse/ur1.c: Likewise.
	* gdb.reverse/watch-reverse.c: Likewise.
---
 gdb/testsuite/gdb.base/annota1.c          |  13 -
 gdb/testsuite/gdb.base/annota3.c          |  13 -
 gdb/testsuite/gdb.base/async.c            |  15 --
 gdb/testsuite/gdb.base/average.c          |  13 -
 gdb/testsuite/gdb.base/call-ar-st.c       | 278 -------------------
 gdb/testsuite/gdb.base/call-rt-st.c       | 151 -----------
 gdb/testsuite/gdb.base/call-sc.c          |   5 -
 gdb/testsuite/gdb.base/call-strs.c        |  22 --
 gdb/testsuite/gdb.base/callfuncs.c        | 129 ---------
 gdb/testsuite/gdb.base/ending-run.c       |   5 -
 gdb/testsuite/gdb.base/execd-prog.c       |   6 -
 gdb/testsuite/gdb.base/exprs.c            |   7 -
 gdb/testsuite/gdb.base/foll-exec.c        |   4 -
 gdb/testsuite/gdb.base/foll-fork.c        |   9 -
 gdb/testsuite/gdb.base/foll-vfork.c       |   4 -
 gdb/testsuite/gdb.base/funcargs.c         | 334 -----------------------
 gdb/testsuite/gdb.base/gcore.c            |   5 -
 gdb/testsuite/gdb.base/jump.c             |   5 -
 gdb/testsuite/gdb.base/langs0.c           |   6 -
 gdb/testsuite/gdb.base/langs1.c           |   8 -
 gdb/testsuite/gdb.base/langs2.c           |  17 --
 gdb/testsuite/gdb.base/mips_pro.c         |  25 --
 gdb/testsuite/gdb.base/nodebug.c          |  32 ---
 gdb/testsuite/gdb.base/opaque0.c          |   2 -
 gdb/testsuite/gdb.base/opaque1.c          |   5 -
 gdb/testsuite/gdb.base/recurse.c          |   6 -
 gdb/testsuite/gdb.base/run.c              |  11 -
 gdb/testsuite/gdb.base/scope0.c           |  29 --
 gdb/testsuite/gdb.base/scope1.c           |   4 -
 gdb/testsuite/gdb.base/setshow.c          |   7 -
 gdb/testsuite/gdb.base/setvar.c           |   7 -
 gdb/testsuite/gdb.base/shmain.c           |  10 -
 gdb/testsuite/gdb.base/shr1.c             |  20 --
 gdb/testsuite/gdb.base/shr2.c             |   8 -
 gdb/testsuite/gdb.base/sigall.c           | 426 ------------------------------
 gdb/testsuite/gdb.base/signals.c          |   6 -
 gdb/testsuite/gdb.base/so-indr-cl.c       |   8 -
 gdb/testsuite/gdb.base/solib2.c           |   5 -
 gdb/testsuite/gdb.base/structs.c          |  90 -------
 gdb/testsuite/gdb.base/sum.c              |   5 -
 gdb/testsuite/gdb.base/vforked-prog.c     |   4 -
 gdb/testsuite/gdb.base/watchpoint.c       |   4 -
 gdb/testsuite/gdb.reverse/shr2.c          |   8 -
 gdb/testsuite/gdb.reverse/until-reverse.c |  29 --
 gdb/testsuite/gdb.reverse/ur1.c           |   7 -
 gdb/testsuite/gdb.reverse/watch-reverse.c |   4 -
 46 files changed, 1811 deletions(-)

diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
index 239ea16..424e1b8 100644
--- a/gdb/testsuite/gdb.base/annota1.c
+++ b/gdb/testsuite/gdb.base/annota1.c
@@ -2,28 +2,15 @@
 #include <signal.h>
 
 
-#ifdef PROTOTYPES
 void
 handle_USR1 (int sig)
 {
 }
-#else
-void
-handle_USR1 (sig)
-     int sig;
-{
-}
-#endif
 
 int value;
 
-#ifdef PROTOTYPES
 int
 main (void)
-#else
-int
-main ()
-#endif
 {
   int my_array[3] = { 1, 2, 3 };  /* break main */
   
diff --git a/gdb/testsuite/gdb.base/annota3.c b/gdb/testsuite/gdb.base/annota3.c
index 239ea16..424e1b8 100644
--- a/gdb/testsuite/gdb.base/annota3.c
+++ b/gdb/testsuite/gdb.base/annota3.c
@@ -2,28 +2,15 @@
 #include <signal.h>
 
 
-#ifdef PROTOTYPES
 void
 handle_USR1 (int sig)
 {
 }
-#else
-void
-handle_USR1 (sig)
-     int sig;
-{
-}
-#endif
 
 int value;
 
-#ifdef PROTOTYPES
 int
 main (void)
-#else
-int
-main ()
-#endif
 {
   int my_array[3] = { 1, 2, 3 };  /* break main */
   
diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c
index 649e9e6..32779d9 100644
--- a/gdb/testsuite/gdb.base/async.c
+++ b/gdb/testsuite/gdb.base/async.c
@@ -1,12 +1,7 @@
 
 
-#ifdef PROTOTYPES
 int
 foo (void)
-#else
-int
-foo ()
-#endif
 {
  int y;
  volatile int x;
@@ -17,13 +12,8 @@ foo ()
  return x + y;
 }
 
-#ifdef PROTOTYPES
 int
 main (void)
-#else
-int
-main ()
-#endif
 {
  int y, z;
  
@@ -37,13 +27,8 @@ main ()
 }
 
 
-#ifdef PROTOTYPES
 int
 baz (void)
-#else
-int
-baz ()
-#endif
 { 
   return 5;
 }
diff --git a/gdb/testsuite/gdb.base/average.c b/gdb/testsuite/gdb.base/average.c
index 99c28cf..874bb1a 100644
--- a/gdb/testsuite/gdb.base/average.c
+++ b/gdb/testsuite/gdb.base/average.c
@@ -3,22 +3,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 extern int sum(int *, int, int);
-#else
-extern int sum();
-#endif
 
 #define num   10
 
 static int my_list[num] = {3,4,2,0,2,1,8,3,6,7};
 
-#ifdef PROTOTYPES
 void print_average(int *list, int low, int high) 
-#else
-void print_average(list, low, high)
-int *list, low, high;
-#endif
     {
         int total = 0, num_elements = 0, average = 0;
         total = sum(list, low, high);
@@ -28,11 +19,7 @@ int *list, low, high;
         printf("%10.d\n", average);
     }
 
-#ifdef PROTOTYPES
 int main(void)
-#else
-main ()
-#endif
 {
     char c;
     int first = 0, last = 0;	/* stop-in-main */
diff --git a/gdb/testsuite/gdb.base/call-ar-st.c b/gdb/testsuite/gdb.base/call-ar-st.c
index f43e001..4b2ffb4 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.c
+++ b/gdb/testsuite/gdb.base/call-ar-st.c
@@ -141,13 +141,7 @@ struct int_char_combo_t {
  * IN     id_int student       -- enumerated type
  * IN     colors shirt         -- enumerated type
  *****************************************************************/
-#ifdef PROTOTYPES
 void print_student_id_shirt_color (id_int student, colors shirt)
-#else
-void print_student_id_shirt_color ( student, shirt ) 
- id_int student;
- colors shirt;
-#endif
 {
 
  printf("student id : %d\t", student);
@@ -196,12 +190,7 @@ void print_student_id_shirt_color ( student, shirt )
  * PRINT_CHAR_ARRAY : 
  * IN     char  array_c[]      -- character array 
  *****************************************************************/
-#ifdef PROTOTYPES
 void print_char_array (char array_c[])
-#else
-void print_char_array ( array_c ) 
-     char    array_c[];
-#endif
 {
 
   int index;
@@ -219,12 +208,7 @@ void print_char_array ( array_c )
  * PRINT_DOUBLE_ARRAY : 
  * IN     double array_d[]      -- array of doubles
  *****************************************************************/
-#ifdef PROTOTYPES
 void print_double_array (double  array_d[])
-#else
-void print_double_array (array_d) 
-     double  array_d[];
-#endif
 {
 
   int index;
@@ -242,12 +226,7 @@ void print_double_array (array_d)
  * PRINT_FLOAT_ARRAY: 
  * IN     float array_f[]      -- array of floats 
  *****************************************************************/
-#ifdef PROTOTYPES
 void print_float_array (float array_f[])
-#else
-void print_float_array ( array_f )
-     float array_f[];
-#endif
 {
 
   int index;
@@ -266,12 +245,7 @@ void print_float_array ( array_f )
  * PRINT_INT_ARRAY: 
  * IN     int  array_i[]      -- array of integers 
  *****************************************************************/
-#ifdef PROTOTYPES
 void print_int_array (int array_i[])
-#else
-void print_int_array ( array_i )
-     int array_i[];
-#endif
 {
 
   int index;
@@ -293,15 +267,7 @@ void print_int_array ( array_i )
  * IN     float array_f[]      -- array of floats 
  * IN     double array_d[]      -- array of doubles 
  *****************************************************************/
-#ifdef PROTOTYPES
 void print_all_arrays(int array_i[], char array_c[], float array_f[], double array_d[])
-#else
-void print_all_arrays( array_i, array_c, array_f, array_d )
-     int array_i[];
-     char array_c[];
-     float array_f[];
-     double array_d[];
-#endif
 {
   print_int_array(array_i);	/* -step1- */
   print_char_array(array_c);	/* -next1- */
@@ -325,12 +291,7 @@ void loop_count () {
  * A do nothing function. Used to provide a point at which calls can be made.  
  * IN  int seed
  *****************************************************************/
-#ifdef PROTOTYPES
 void compute_with_small_structs (int seed)
-#else
-void compute_with_small_structs ( seed ) 
- int seed;
-#endif
 {
 
      struct small_rep_info_t array[4];
@@ -360,18 +321,7 @@ void compute_with_small_structs ( seed )
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsigned g, unsigned d, unsigned e, unsigned o)
-#else
-void init_bit_flags ( bit_flags, a, b, g, d, e, o )
-struct bit_flags_t *bit_flags;
-unsigned a;
-unsigned b;
-unsigned g;
-unsigned d;
-unsigned e;
-unsigned o; 
-#endif
 {
 
    bit_flags->alpha = a;
@@ -397,20 +347,7 @@ unsigned o;
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a, unsigned b, char ch1, unsigned g, unsigned d, char ch2, unsigned e, unsigned o)
-#else
-void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
-     struct bit_flags_combo_t *bit_flags_combo;
-     unsigned a;
-     unsigned b;
-     char     ch1;
-     unsigned g;
-     unsigned d;
-     char     ch2;
-     unsigned e;
-     unsigned o; 
-#endif
 {
 
    bit_flags_combo->alpha = a;	/* -step3- */
@@ -429,13 +366,7 @@ void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
  * OUT  struct one_double_t *one_double  -- structure to fill 
  * IN   double init_val
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_one_double (struct one_double_t *one_double, double init_val)
-#else
-void init_one_double ( one_double, init_val )
-     struct one_double_t *one_double;
-     double init_val; 
-#endif
 {
 
      one_double->double1  = init_val;
@@ -447,14 +378,7 @@ void init_one_double ( one_double, init_val )
  * IN  float init_val1 
  * IN  float init_val2 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_two_floats (struct two_floats_t *two_floats, float init_val1, float init_val2)
-#else
-void init_two_floats ( two_floats, init_val1, init_val2 )
-     struct two_floats_t *two_floats; 
-     float init_val1;
-     float init_val2;
-#endif
 {
      two_floats->float1 = init_val1;
      two_floats->float2 = init_val2;
@@ -466,14 +390,7 @@ void init_two_floats ( two_floats, init_val1, init_val2 )
  * IN  char init_val1 
  * IN  char init_val2 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2)
-#else
-void init_two_chars ( two_char, init_val1, init_val2 )
-     struct two_char_t *two_char;
-     char init_val1;
-     char init_val2; 
-#endif
 {
 
      two_char->ch1 = init_val1;
@@ -487,15 +404,7 @@ void init_two_chars ( two_char, init_val1, init_val2 )
  * IN  char init_val2 
  * IN  char init_val3 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_three_chars (struct three_char_t *three_char, char init_val1, char init_val2, char init_val3)
-#else
-void init_three_chars ( three_char, init_val1, init_val2, init_val3 )  
-     struct three_char_t *three_char; 
-     char init_val1;
-     char init_val2;
-     char init_val3;
-#endif
 {
 
      three_char->ch1 = init_val1;
@@ -512,17 +421,7 @@ void init_three_chars ( three_char, init_val1, init_val2, init_val3 )
  * IN  char init_val4 
  * IN  char init_val5 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_five_chars (struct five_char_t *five_char, char init_val1, char init_val2, char init_val3, char init_val4, char init_val5)
-#else
-void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init_val5 )
-     struct five_char_t *five_char;
-     char init_val1;
-     char init_val2;
-     char init_val3;
-     char init_val4;
-     char init_val5;
-#endif
 {
      five_char->ch1 = init_val1;
      five_char->ch2 = init_val2;
@@ -537,14 +436,7 @@ void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init
  * IN  int  init_val1 
  * IN  char init_val2 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char init_val2)
-#else
-void init_int_char_combo ( combo, init_val1, init_val2 )
-     struct int_char_combo_t *combo;
-     int init_val1; 
-     char init_val2; 
-#endif
 {
 
      combo->int1 = init_val1;
@@ -556,13 +448,7 @@ void init_int_char_combo ( combo, init_val1, init_val2 )
  * OUT struct small_rep_into_t *small_struct -- structure to be filled
  * IN  int  seed 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_struct_rep(struct small_rep_info_t *small_struct, int seed)
-#else
-void init_struct_rep( small_struct, seed )
-     struct small_rep_info_t *small_struct;
-     int    seed;
-#endif
 {
 
       small_struct->value = 2 + (seed*2); 
@@ -574,7 +460,6 @@ void init_struct_rep( small_struct, seed )
  * Takes all the small structures as input and calls the appropriate
  * initialization routine for each structure
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_small_structs (
      struct small_rep_info_t  *struct1,
      struct small_rep_info_t  *struct2,
@@ -591,25 +476,6 @@ void init_small_structs (
      struct two_floats_t      *f1,
      struct two_floats_t      *f2,
      struct two_floats_t      *f3)
-#else
-void init_small_structs (struct1, struct2, struct3,struct4,flags,flags_combo,
-three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
-     struct small_rep_info_t  *struct1;
-     struct small_rep_info_t  *struct2;
-     struct small_rep_info_t  *struct3;
-     struct small_rep_info_t  *struct4;
-     struct bit_flags_t       *flags;
-     struct bit_flags_combo_t *flags_combo;
-     struct three_char_t      *three_char;
-     struct five_char_t       *five_char;
-     struct int_char_combo_t  *int_char_combo;
-     struct one_double_t      *d1;
-     struct one_double_t      *d2;
-     struct one_double_t      *d3;
-     struct two_floats_t      *f1;
-     struct two_floats_t      *f2;
-     struct two_floats_t      *f3;
-#endif
 {
 
      init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, 
@@ -636,7 +502,6 @@ three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
  * PRINT_TEN_DOUBLES : 
  * ?????????????????????????????
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_ten_doubles (
      double d1,
      double d2,
@@ -648,19 +513,6 @@ void print_ten_doubles (
      double d8,
      double d9,
      double d10)
-#else
-void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
-     double d1;
-     double d2;
-     double d3;
-     double d4;
-     double d5;
-     double d6;
-     double d7;
-     double d8;
-     double d9;
-     double d10; 
-#endif
 {
 
   printf("Two Doubles : %f\t%f\n", d1, d2);
@@ -674,12 +526,7 @@ void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
  * PRINT_BIT_FLAGS : 
  * IN struct bit_flags_t bit_flags 
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_bit_flags (struct bit_flags_t bit_flags)
-#else
-void print_bit_flags ( bit_flags )
-struct bit_flags_t bit_flags;
-#endif
 {
 
      if (bit_flags.alpha) printf("alpha\n");
@@ -694,12 +541,7 @@ struct bit_flags_t bit_flags;
  * PRINT_BIT_FLAGS_COMBO : 
  * IN struct bit_flags_combo_t bit_flags_combo 
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
-#else
-void print_bit_flags_combo ( bit_flags_combo )
-     struct bit_flags_combo_t bit_flags_combo;
-#endif
 {
 
      if (bit_flags_combo.alpha) printf("alpha\n");
@@ -715,12 +557,7 @@ void print_bit_flags_combo ( bit_flags_combo )
  * PRINT_ONE_DOUBLE : 
  * IN struct one_double_t one_double 
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_one_double (struct one_double_t one_double)
-#else
-void print_one_double ( one_double )
-struct one_double_t one_double;
-#endif
 {
 
      printf("Contents of one_double_t: \n\n");
@@ -731,12 +568,7 @@ struct one_double_t one_double;
  * PRINT_TWO_FLOATS : 
  * IN struct two_floats_t two_floats 
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_two_floats (struct two_floats_t two_floats)
-#else
-void print_two_floats ( two_floats )
-struct two_floats_t two_floats; 
-#endif
 {
 
      printf("Contents of two_floats_t: \n\n");
@@ -747,12 +579,7 @@ struct two_floats_t two_floats;
  * PRINT_TWO_CHARS : 
  * IN struct two_char_t two_char
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_two_chars (struct two_char_t two_char)
-#else
-void print_two_chars ( two_char )
-struct two_char_t two_char; 
-#endif
 {
 
      printf("Contents of two_char_t: \n\n");
@@ -763,12 +590,7 @@ struct two_char_t two_char;
  * PRINT_THREE_CHARS : 
  * IN struct three_char_t three_char
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_three_chars (struct three_char_t three_char)
-#else
-void print_three_chars ( three_char )
-struct three_char_t three_char;
-#endif
 {
 
      printf("Contents of three_char_t: \n\n");
@@ -779,12 +601,7 @@ struct three_char_t three_char;
  * PRINT_FIVE_CHARS : 
  * IN struct five_char_t five_char
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_five_chars (struct five_char_t five_char)
-#else
-void print_five_chars ( five_char ) 
-struct five_char_t five_char; 
-#endif
 {
 
      printf("Contents of five_char_t: \n\n");
@@ -797,12 +614,7 @@ struct five_char_t five_char;
  * PRINT_INT_CHAR_COMBO : 
  * IN struct int_char_combo_t int_char_combo
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_int_char_combo (struct int_char_combo_t int_char_combo)
-#else
-void print_int_char_combo ( int_char_combo )
-struct int_char_combo_t int_char_combo;
-#endif
 {
 
      printf("Contents of int_char_combo_t: \n\n");
@@ -817,17 +629,10 @@ struct int_char_combo_t int_char_combo;
  * IN struct small_rep_info_t  struct2
  * IN struct small_rep_info_t  struct3
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_struct_rep(
      struct small_rep_info_t struct1,
      struct small_rep_info_t struct2,
      struct small_rep_info_t struct3)
-#else
-void print_struct_rep( struct1, struct2, struct3)
-     struct small_rep_info_t struct1;
-     struct small_rep_info_t struct2;
-     struct small_rep_info_t struct3;
-#endif
 {
 
 
@@ -849,21 +654,12 @@ void print_struct_rep( struct1, struct2, struct3)
  * IN struct small_rep_info_t  struct3
  * IN struct small_rep_info_t  struct4
  ****************************************************************/
-#ifdef PROTOTYPES
 void sum_struct_print (
      int seed,
      struct small_rep_info_t struct1,
      struct small_rep_info_t struct2, 
      struct small_rep_info_t struct3,
      struct small_rep_info_t struct4)
-#else
-void sum_struct_print ( seed, struct1, struct2, struct3, struct4) 
-     int seed;
-     struct small_rep_info_t struct1;
-     struct small_rep_info_t struct2; 
-     struct small_rep_info_t struct3; 
-     struct small_rep_info_t struct4; 
-#endif
 {
      int sum;
 
@@ -878,7 +674,6 @@ void sum_struct_print ( seed, struct1, struct2, struct3, struct4)
  * All of the small structures of odd sizes (40 bits, 8bits, etc.)
  * are pushed onto the stack.
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_small_structs (
      struct small_rep_info_t  struct1,
      struct small_rep_info_t  struct2,
@@ -895,25 +690,6 @@ void print_small_structs (
      struct two_floats_t      f1,
      struct two_floats_t      f2,
      struct two_floats_t      f3)
-#else
-void print_small_structs ( struct1, struct2, struct3,  struct4, flags, 
-flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
-     struct small_rep_info_t  struct1;
-     struct small_rep_info_t  struct2;
-     struct small_rep_info_t  struct3;
-     struct small_rep_info_t  struct4;
-     struct bit_flags_t       flags;
-     struct bit_flags_combo_t flags_combo;
-     struct three_char_t      three_char;
-     struct five_char_t       five_char;
-     struct int_char_combo_t  int_char_combo;
-     struct one_double_t      d1;
-     struct one_double_t      d2;
-     struct one_double_t      d3;
-     struct two_floats_t      f1;
-     struct two_floats_t      f2;
-     struct two_floats_t      f3;
-#endif
 {
    print_bit_flags(flags);
    print_bit_flags_combo(flags_combo);
@@ -939,7 +715,6 @@ flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
  * may force more space to be pushed onto the stack as part of the callers
  * frame.
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_long_arg_list (
      double a,
      double b,
@@ -962,32 +737,6 @@ void print_long_arg_list (
      struct two_floats_t      f1,
      struct two_floats_t      f2,
      struct two_floats_t      f3)
-#else
-void print_long_arg_list ( a, b, c, d, e, f, struct1, struct2, struct3, 
-struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1,d2,d3,
-f1, f2, f3 )
-     double a;
-     double b;
-     int c;
-     int d;
-     int e;
-     int f;
-     struct small_rep_info_t  struct1;
-     struct small_rep_info_t  struct2;
-     struct small_rep_info_t  struct3;
-     struct small_rep_info_t  struct4;
-     struct bit_flags_t       flags;
-     struct bit_flags_combo_t flags_combo;
-     struct three_char_t      three_char;
-     struct five_char_t       five_char;
-     struct int_char_combo_t  int_char_combo;
-     struct one_double_t      d1;
-     struct one_double_t      d2;
-     struct one_double_t      d3;
-     struct two_floats_t      f1;
-     struct two_floats_t      f2;
-     struct two_floats_t      f3;
-#endif
 {
     printf("double : %f\n", a);	/* -step2- */
     printf("double : %f\n", b);
@@ -1001,12 +750,7 @@ f1, f2, f3 )
 }
 
 
-#ifdef PROTOTYPES
 void print_one_large_struct (struct array_rep_info_t linked_list1)
-#else
-void print_one_large_struct( linked_list1 )
-     struct array_rep_info_t linked_list1;
-#endif
 {
 
  /* printf("Contents of linked list1: \n\n");
@@ -1027,17 +771,10 @@ void print_one_large_struct( linked_list1 )
  * IN struct array_rep_info_t linked_list2
  * IN struct array_rep_info_t linked_list3
  ****************************************************************/
-#ifdef PROTOTYPES
 void print_array_rep(
      struct array_rep_info_t linked_list1,
      struct array_rep_info_t linked_list2,
      struct array_rep_info_t linked_list3)
-#else
-void print_array_rep( linked_list1, linked_list2, linked_list3 )
-     struct array_rep_info_t linked_list1;
-     struct array_rep_info_t linked_list2;
-     struct array_rep_info_t linked_list3;
-#endif
 {
 
   int index;
@@ -1083,21 +820,12 @@ void print_array_rep( linked_list1, linked_list2, linked_list3 )
  * IN struct array_rep_info_t linked_list3
  * IN struct array_rep_info_t linked_list4
  ****************************************************************/
-#ifdef PROTOTYPES
 void sum_array_print (
      int seed,
      struct array_rep_info_t linked_list1,
      struct array_rep_info_t linked_list2,
      struct array_rep_info_t linked_list3,
      struct array_rep_info_t linked_list4)
-#else
-void sum_array_print ( seed, linked_list1, linked_list2, linked_list3,linked_list4)
-     int seed;
-     struct array_rep_info_t linked_list1;
-     struct array_rep_info_t linked_list2;
-     struct array_rep_info_t linked_list3;
-     struct array_rep_info_t linked_list4;
-#endif
 {
      int index;
      int sum;
@@ -1121,15 +849,9 @@ void sum_array_print ( seed, linked_list1, linked_list2, linked_list3,linked_lis
  * IN struct array_rep_info_t *linked_list
  * IN int    seed
  ****************************************************************/
-#ifdef PROTOTYPES
 void init_array_rep(
      struct array_rep_info_t *linked_list,
      int    seed)
-#else
-void init_array_rep( linked_list, seed )
-     struct array_rep_info_t *linked_list;
-     int    seed;
-#endif
 {
 
   int index;
diff --git a/gdb/testsuite/gdb.base/call-rt-st.c b/gdb/testsuite/gdb.base/call-rt-st.c
index a583bab..944f1af 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.c
+++ b/gdb/testsuite/gdb.base/call-rt-st.c
@@ -141,7 +141,6 @@ void loop_count () {
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_bit_flags_char (
 struct bit_flags_char_t *bit_flags,
 unsigned a,
@@ -150,16 +149,6 @@ unsigned g,
 unsigned d,
 unsigned e,
 unsigned o)
-#else
-void init_bit_flags_char (bit_flags,a,b,g,d,e,o) 
-struct bit_flags_char_t *bit_flags;
-unsigned a;
-unsigned b;
-unsigned g;
-unsigned d;
-unsigned e;
-unsigned o; 
-#endif
 {
 
    bit_flags->alpha = a;
@@ -183,7 +172,6 @@ unsigned o;
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_bit_flags_short (
 struct bit_flags_short_t *bit_flags,
 unsigned a,
@@ -192,16 +180,6 @@ unsigned g,
 unsigned d,
 unsigned e,
 unsigned o)
-#else
-void init_bit_flags_short (bit_flags,a,b,g,d,e,o) 
-struct bit_flags_short_t *bit_flags;
-unsigned a;
-unsigned b;
-unsigned g;
-unsigned d;
-unsigned e;
-unsigned o; 
-#endif
 {
 
    bit_flags->alpha = a;
@@ -225,7 +203,6 @@ unsigned o;
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_bit_flags (
 struct bit_flags_t *bit_flags,
 unsigned a,
@@ -234,16 +211,6 @@ unsigned g,
 unsigned d,
 unsigned e,
 unsigned o)
-#else
-void init_bit_flags (bit_flags,a,b,g,d,e,o) 
-struct bit_flags_t *bit_flags;
-unsigned a;
-unsigned b;
-unsigned g;
-unsigned d;
-unsigned e;
-unsigned o; 
-#endif
 {
 
    bit_flags->alpha = a;
@@ -269,7 +236,6 @@ unsigned o;
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_bit_flags_combo (
 struct bit_flags_combo_t *bit_flags_combo,
 unsigned a,
@@ -280,18 +246,6 @@ unsigned d,
 char ch2,
 unsigned e,
 unsigned o)
-#else
-void init_bit_flags_combo (bit_flags_combo, a, b, ch1, g, d, ch2, e, o)
-struct bit_flags_combo_t *bit_flags_combo;
-unsigned a;
-unsigned b;
-char ch1;
-unsigned g;
-unsigned d;
-char ch2;
-unsigned e;
-unsigned o;
-#endif
 {
 
    bit_flags_combo->alpha = a;
@@ -310,13 +264,7 @@ unsigned o;
  * OUT  struct one_double_t *one_double  -- structure to fill 
  * IN   double init_val
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_one_double ( struct one_double_t *one_double, double init_val)
-#else
-void init_one_double (one_double, init_val)
-struct one_double_t *one_double; 
-double init_val;
-#endif
 {
 
      one_double->double1  = init_val;
@@ -328,17 +276,10 @@ double init_val;
  * IN  float init_val1 
  * IN  float init_val2 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_two_floats (
      struct two_floats_t *two_floats,
      float init_val1,
      float init_val2)
-#else
-void init_two_floats (two_floats, init_val1, init_val2)
-struct two_floats_t *two_floats;
-float init_val1;
-float init_val2;
-#endif
 {
 
      two_floats->float1 = init_val1;
@@ -352,19 +293,11 @@ float init_val2;
  * IN  char init_val2 
  * IN  char init_val3 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_three_chars (
 struct three_char_t *three_char,
 char init_val1,
 char init_val2,
 char init_val3)
-#else
-void init_three_chars ( three_char, init_val1, init_val2, init_val3)
-struct three_char_t *three_char;
-char init_val1;
-char init_val2;
-char init_val3;
-#endif
 {
 
      three_char->ch1 = init_val1;
@@ -381,7 +314,6 @@ char init_val3;
  * IN  char init_val4 
  * IN  char init_val5 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_five_chars (
 struct five_char_t *five_char,
 char init_val1,
@@ -389,15 +321,6 @@ char init_val2,
 char init_val3,
 char init_val4,
 char init_val5)
-#else
-void init_five_chars ( five_char, init_val1, init_val2, init_val3, init_val4, init_val5)
-struct five_char_t *five_char;
-char init_val1;
-char init_val2;
-char init_val3;
-char init_val4;
-char init_val5;
-#endif
 {
 
      five_char->ch1 = init_val1;
@@ -413,17 +336,10 @@ char init_val5;
  * IN  int  init_val1 
  * IN  char init_val2 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_int_char_combo (
 struct int_char_combo_t *combo,
 int init_val1,
 char init_val2)
-#else
-void init_int_char_combo ( combo, init_val1, init_val2)
-struct int_char_combo_t *combo;
-int init_val1;
-char init_val2;
-#endif
 {
 
      combo->int1 = init_val1;
@@ -435,15 +351,9 @@ char init_val2;
  * OUT struct small_rep_into_t *small_struct -- structure to be filled
  * IN  int  seed 
  *****************************************************************/
-#ifdef PROTOTYPES
 void init_struct_rep(
      struct small_rep_info_t *small_struct,
      int seed)
-#else
-void init_struct_rep( small_struct, seed)
-struct small_rep_info_t *small_struct;
-int    seed;
-#endif
 {
 
       small_struct->value = 2 + (seed*2); 
@@ -454,12 +364,7 @@ int    seed;
  * PRINT_BIT_FLAGS_CHAR : 
  * IN struct bit_flags_char_t bit_flags 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct bit_flags_char_t print_bit_flags_char (struct bit_flags_char_t bit_flags)
-#else
-struct bit_flags_char_t print_bit_flags_char ( bit_flags)
-struct bit_flags_char_t bit_flags;
-#endif
 {
 
      if (bit_flags.alpha) printf("alpha\n");
@@ -476,12 +381,7 @@ struct bit_flags_char_t bit_flags;
  * PRINT_BIT_FLAGS_SHORT : 
  * IN struct bit_flags_short_t bit_flags 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct bit_flags_short_t print_bit_flags_short (struct bit_flags_short_t bit_flags)
-#else
-struct bit_flags_short_t print_bit_flags_short ( bit_flags)
-struct bit_flags_short_t bit_flags;
-#endif
 {
 
      if (bit_flags.alpha) printf("alpha\n");
@@ -498,12 +398,7 @@ struct bit_flags_short_t bit_flags;
  * PRINT_BIT_FLAGS : 
  * IN struct bit_flags_t bit_flags 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags)
-#else
-struct bit_flags_t print_bit_flags ( bit_flags)
-struct bit_flags_t bit_flags;
-#endif
 {
 
      if (bit_flags.alpha) printf("alpha\n");
@@ -520,12 +415,7 @@ struct bit_flags_t bit_flags;
  * PRINT_BIT_FLAGS_COMBO : 
  * IN struct bit_flags_combo_t bit_flags_combo 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
-#else
-struct bit_flags_combo_t print_bit_flags_combo ( bit_flags_combo )
-struct bit_flags_combo_t bit_flags_combo;
-#endif
 {
 
      if (bit_flags_combo.alpha) printf("alpha\n");
@@ -543,12 +433,7 @@ struct bit_flags_combo_t bit_flags_combo;
  * PRINT_ONE_DOUBLE : 
  * IN struct one_double_t one_double 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct one_double_t print_one_double (struct one_double_t one_double)
-#else
-struct one_double_t print_one_double ( one_double )
-struct one_double_t one_double;
-#endif
 {
 
      printf("Contents of one_double_t: \n\n");
@@ -561,12 +446,7 @@ struct one_double_t one_double;
  * PRINT_TWO_FLOATS : 
  * IN struct two_floats_t two_floats 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct two_floats_t print_two_floats (struct two_floats_t two_floats)
-#else
-struct two_floats_t print_two_floats ( two_floats ) 
-struct two_floats_t two_floats;
-#endif
 {
 
      printf("Contents of two_floats_t: \n\n");
@@ -579,12 +459,7 @@ struct two_floats_t two_floats;
  * PRINT_THREE_CHARS : 
  * IN struct three_char_t three_char
  ****************************************************************/
-#ifdef PROTOTYPES
 struct three_char_t print_three_chars (struct three_char_t three_char)
-#else
-struct three_char_t print_three_chars ( three_char ) 
-struct three_char_t three_char;
-#endif
 {
 
      printf("Contents of three_char_t: \n\n");
@@ -597,12 +472,7 @@ struct three_char_t three_char;
  * PRINT_FIVE_CHARS : 
  * IN struct five_char_t five_char
  ****************************************************************/
-#ifdef PROTOTYPES
 struct five_char_t print_five_chars (struct five_char_t five_char)
-#else
-struct five_char_t print_five_chars ( five_char )
-struct five_char_t five_char;
-#endif
 {
 
      printf("Contents of five_char_t: \n\n");
@@ -617,12 +487,7 @@ struct five_char_t five_char;
  * PRINT_INT_CHAR_COMBO : 
  * IN struct int_char_combo_t int_char_combo
  ****************************************************************/
-#ifdef PROTOTYPES
 struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_combo)
-#else
-struct int_char_combo_t print_int_char_combo ( int_char_combo )
-struct int_char_combo_t int_char_combo;
-#endif
 {
 
      printf("Contents of int_char_combo_t: \n\n");
@@ -634,12 +499,7 @@ struct int_char_combo_t int_char_combo;
 /*****************************************************************
  * PRINT_STRUCT_REP : 
  ****************************************************************/
-#ifdef PROTOTYPES
 struct small_rep_info_t print_struct_rep(struct small_rep_info_t struct1)
-#else
-struct small_rep_info_t print_struct_rep( struct1 )
-struct small_rep_info_t struct1;
-#endif
 {
 
   printf("Contents of struct1: \n\n");
@@ -652,12 +512,7 @@ struct small_rep_info_t struct1;
 }
 
 
-#ifdef PROTOTYPES
 struct array_rep_info_t print_one_large_struct(struct array_rep_info_t linked_list1)
-#else
-struct array_rep_info_t print_one_large_struct( linked_list1 )
-struct array_rep_info_t linked_list1;
-#endif
 {
 
 
@@ -673,13 +528,7 @@ struct array_rep_info_t linked_list1;
  * IN struct array_rep_info_t *linked_list
  * IN int    seed
  ****************************************************************/
-#ifdef PROTOTYPES
 void init_array_rep(struct array_rep_info_t *linked_list, int seed)
-#else
-void init_array_rep( linked_list, seed )
-struct array_rep_info_t *linked_list;
-int    seed;
-#endif
 {
 
   int index;
diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c
index cec4b34..56c18da 100644
--- a/gdb/testsuite/gdb.base/call-sc.c
+++ b/gdb/testsuite/gdb.base/call-sc.c
@@ -41,12 +41,7 @@ T fun()
   return foo;  
 }
 
-#ifdef PROTOTYPES
 void Fun(T foo)
-#else
-void Fun(foo)
-     T foo;
-#endif
 {
   L = foo;
 }
diff --git a/gdb/testsuite/gdb.base/call-strs.c b/gdb/testsuite/gdb.base/call-strs.c
index f3bc8da..c0b1823 100644
--- a/gdb/testsuite/gdb.base/call-strs.c
+++ b/gdb/testsuite/gdb.base/call-strs.c
@@ -6,19 +6,13 @@ char buf[100];
 char bigbuf[1000];
 char * s;
 
-#ifdef PROTOTYPES
 char * str_func1(char *s1)
-#else
-char * str_func1(s1)
-char *s1;
-#endif
 {
   printf("first string arg is: %s\n", s1);
   strcpy(bigbuf, s1);
   return bigbuf;
 }
 
-#ifdef PROTOTYPES
 char * str_func(
 char * s1, 
 char * s2,
@@ -27,22 +21,6 @@ char * s4,
 char * s5,
 char * s6,
 char * s7)
-#else
-char * str_func(s1, 
-                s2,
-               s3,
-               s4,
-               s5,
-               s6,
-               s7)
-char * s1; 
-char * s2;
-char * s3;
-char * s4;
-char * s5;
-char * s6;
-char * s7;
-#endif
 {
   printf("first string arg is: %s\n", s1);
   printf("second string arg is: %s\n", s2);
diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c
index 8548757..379b713 100644
--- a/gdb/testsuite/gdb.base/callfuncs.c
+++ b/gdb/testsuite/gdb.base/callfuncs.c
@@ -123,20 +123,12 @@ struct struct1 {
 #endif /* TEST_COMPLEX */
 /* Some functions that can be passed as arguments to other test
    functions, or called directly. */
-#ifdef PROTOTYPES
 int add (int a, int b)
-#else
-int add (a, b) int a, b;
-#endif
 {
   return (a + b);
 }
 
-#ifdef PROTOTYPES
 int doubleit (int a)
-#else
-int doubleit (a) int a;
-#endif
 {
   return (a + a);
 }
@@ -151,29 +143,17 @@ enum enumtype enum_val1 = enumval1;
 enum enumtype enum_val2 = enumval2;
 enum enumtype enum_val3 = enumval3;
 
-#ifdef PROTOTYPES
 int t_enum_value1 (enum enumtype enum_arg)
-#else
-int t_enum_value1 (enum_arg) enum enumtype enum_arg;
-#endif
 {
   return (enum_arg == enum_val1);
 }
 
-#ifdef PROTOTYPES
 int t_enum_value2 (enum enumtype enum_arg)
-#else
-int t_enum_value2 (enum_arg) enum enumtype enum_arg;
-#endif
 {
   return (enum_arg == enum_val2);
 }
 
-#ifdef PROTOTYPES
 int t_enum_value3 (enum enumtype enum_arg)
-#else
-int t_enum_value3 (enum_arg) enum enumtype enum_arg;
-#endif
 {
   return (enum_arg == enum_val3);
 }
@@ -181,11 +161,7 @@ int t_enum_value3 (enum_arg) enum enumtype enum_arg;
 /* A function that takes a vector of integers (along with an explicit
    count) and returns their sum. */
 
-#ifdef PROTOTYPES
 int sum_args (int argc, int argv[])
-#else
-int sum_args (argc, argv) int argc; int argv[];
-#endif
 {
   int sumval = 0;
   int idx;
@@ -200,7 +176,6 @@ int sum_args (argc, argv) int argc; int argv[];
 /* Test that we can call functions that take structs and return
    members from that struct */
 
-#ifdef PROTOTYPES
 char   t_structs_c (struct struct1 tstruct) { return (tstruct.c); }
 short  t_structs_s (struct struct1 tstruct) { return (tstruct.s); }
 int    t_structs_i (struct struct1 tstruct) { return (tstruct.i); }
@@ -218,48 +193,17 @@ float _Complex t_structs_fc (struct struct1 tstruct) { return tstruct.fc;}
 double _Complex t_structs_dc (struct struct1 tstruct) { return tstruct.dc;}
 long double _Complex t_structs_ldc (struct struct1 tstruct) { return tstruct.ldc;}
 #endif
-#else
-char   t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
-short  t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
-int    t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
-long   t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
-float  t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
-double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
-char  *t_structs_a (tstruct) struct struct1 tstruct;
-{
-  static char buf[8];
-  strcpy (buf, tstruct.a);
-  return buf;
-}
-#ifdef TEST_COMPLEX
-float _Complex t_structs_fc (tstruct) struct struct1 tstruct; { return tstruct.fc;}
-double _Complex t_structs_dc (tstruct) struct struct1 tstruct; { return tstruct.dc;}
-long double _Complex t_structs_ldc (tstruct) struct struct1 tstruct; { return tstruct.ldc;}
-#endif
-#endif
 
 /* Test that calling functions works if there are a lot of arguments.  */
-#ifdef PROTOTYPES
 int
 sum10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
-#else
-int
-sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
-     int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
-#endif
 {
   return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
 }
 
 /* Test that args are passed in the right order. */
-#ifdef PROTOTYPES
 int
 cmp10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
-#else
-int
-cmp10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
-  int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
-#endif
 {
   return
     (i0 == 0) && (i1 == 1) && (i2 == 2) && (i3 == 3) && (i4 == 4) &&
@@ -270,63 +214,29 @@ cmp10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
    either 0 or 1, depending upon whether the values were
    passed incorrectly or correctly, respectively. */
 
-#ifdef PROTOTYPES
 int t_char_values (char char_arg1, char char_arg2)
-#else
-int t_char_values (char_arg1, char_arg2)
-char char_arg1, char_arg2;
-#endif
 {
   return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
 }
 
 int
-#ifdef PROTOTYPES
 t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
 		char arg6, short arg7, int arg8, short arg9, short arg10)
-#else
-t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
-     char arg1;
-     short arg2;
-     int arg3;
-     char arg4;
-     short arg5;
-     char arg6;
-     short arg7;
-     int arg8;
-     short arg9;
-     short arg10;
-#endif
 {
   return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
 }
 
-#ifdef PROTOTYPES
 int t_short_values (short short_arg1, short short_arg2)
-#else
-int t_short_values (short_arg1, short_arg2)
-     short short_arg1, short_arg2;
-#endif
 {
   return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
 }
 
-#ifdef PROTOTYPES
 int t_int_values (int int_arg1, int int_arg2)
-#else
-int t_int_values (int_arg1, int_arg2)
-int int_arg1, int_arg2;
-#endif
 {
   return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
 }
 
-#ifdef PROTOTYPES
 int t_long_values (long long_arg1, long long_arg2)
-#else
-int t_long_values (long_arg1, long_arg2)
-long long_arg1, long_arg2;
-#endif
 {
   return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
 }
@@ -394,12 +304,7 @@ t_float_many_args (float f1, float f2, float f3, float f4, float f5, float f6,
 	  && (sum_args - sum_values) > -DELTA);
 }
 
-#ifdef PROTOTYPES
 int t_double_values (double double_arg1, double double_arg2)
-#else
-int t_double_values (double_arg1, double_arg2)
-double double_arg1, double_arg2;
-#endif
 {
   return ((double_arg1 - double_val1) < DELTA
 	  && (double_arg1 - double_val1) > -DELTA
@@ -544,47 +449,25 @@ DEF_FUNC_VALUES_3(fc, long double, creall, cimagl)
 #endif /* TEST_COMPLEX */
 
 
-#ifdef PROTOTYPES
 int t_string_values (char *string_arg1, char *string_arg2)
-#else
-int t_string_values (string_arg1, string_arg2)
-char *string_arg1, *string_arg2;
-#endif
 {
   return (!strcmp (string_arg1, string_val1) &&
 	  !strcmp (string_arg2, string_val2));
 }
 
-#ifdef PROTOTYPES
 int t_char_array_values (char char_array_arg1[], char char_array_arg2[])
-#else
-int t_char_array_values (char_array_arg1, char_array_arg2)
-char char_array_arg1[], char_array_arg2[];
-#endif
 {
   return (!strcmp (char_array_arg1, char_array_val1) &&
 	  !strcmp (char_array_arg2, char_array_val2));
 }
 
-#ifdef PROTOTYPES
 int t_double_int (double double_arg1, int int_arg2)
-#else
-int t_double_int (double_arg1, int_arg2)
-double double_arg1;
-int int_arg2;
-#endif
 {
   return ((double_arg1 - int_arg2) < DELTA
 	  && (double_arg1 - int_arg2) > -DELTA);
 }
 
-#ifdef PROTOTYPES
 int t_int_double (int int_arg1, double double_arg2)
-#else
-int t_int_double (int_arg1, double_arg2)
-int int_arg1;
-double double_arg2;
-#endif
 {
   return ((int_arg1 - double_arg2) < DELTA
 	  && (int_arg1 - double_arg2) > -DELTA);
@@ -608,25 +491,13 @@ double double_arg2;
    that function indirectly through the function pointer.  This would fail
    on the HPPA.  */
 
-#ifdef PROTOTYPES
 int t_func_values (int (*func_arg1)(int, int), int (*func_arg2)(int))
-#else
-int t_func_values (func_arg1, func_arg2)
-int (*func_arg1) PARAMS ((int, int));
-int (*func_arg2) PARAMS ((int));
-#endif
 {
   return ((*func_arg1) (5,5)  == (*func_val1) (5,5)
           && (*func_arg2) (6) == (*func_val2) (6));
 }
 
-#ifdef PROTOTYPES
 int t_call_add (int (*func_arg1)(int, int), int a, int b)
-#else
-int t_call_add (func_arg1, a, b)
-int (*func_arg1) PARAMS ((int, int));
-int a, b;
-#endif
 {
   return ((*func_arg1)(a, b));
 }
diff --git a/gdb/testsuite/gdb.base/ending-run.c b/gdb/testsuite/gdb.base/ending-run.c
index d857cf8..42f12c0 100644
--- a/gdb/testsuite/gdb.base/ending-run.c
+++ b/gdb/testsuite/gdb.base/ending-run.c
@@ -4,12 +4,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 int callee (int x)
-#else
-int callee( x )
-int x;
-#endif
 {
     int y = x * x;		/* -break1- */
     return (y - 2);
diff --git a/gdb/testsuite/gdb.base/execd-prog.c b/gdb/testsuite/gdb.base/execd-prog.c
index 5435f7d..ac9928f 100644
--- a/gdb/testsuite/gdb.base/execd-prog.c
+++ b/gdb/testsuite/gdb.base/execd-prog.c
@@ -8,13 +8,7 @@
    */
 int  global_i = 0;
 
-#ifdef PROTOTYPES
 int main (int argc, char **argv)
-#else
-main (argc, argv)
-  int  argc;
-  char *  argv[];
-#endif
 {
   /* There is a local_j in foll-exec, which exec's us.  We
      should not be able to see that other definition of local_j
diff --git a/gdb/testsuite/gdb.base/exprs.c b/gdb/testsuite/gdb.base/exprs.c
index e1ad182..cd605f3 100644
--- a/gdb/testsuite/gdb.base/exprs.c
+++ b/gdb/testsuite/gdb.base/exprs.c
@@ -1,11 +1,4 @@
-#ifdef PROTOTYPES
 int main (int argc, char **argv, char **envp)
-#else
-main (argc, argv, envp)
-     int argc;
-     char **argv;
-     char **envp;
-#endif
 {
     extern void dummy();
     dummy();
diff --git a/gdb/testsuite/gdb.base/foll-exec.c b/gdb/testsuite/gdb.base/foll-exec.c
index 5b0d9c5..6e302bb 100644
--- a/gdb/testsuite/gdb.base/foll-exec.c
+++ b/gdb/testsuite/gdb.base/foll-exec.c
@@ -6,11 +6,7 @@
 
 int  global_i = 100;
 
-#ifdef PROTOTYPES
 int main (void)
-#else
-main ()
-#endif
 {
   int  local_j = global_i+1;
   int  local_k = local_j+1;
diff --git a/gdb/testsuite/gdb.base/foll-fork.c b/gdb/testsuite/gdb.base/foll-fork.c
index a640928..4d8c138 100644
--- a/gdb/testsuite/gdb.base/foll-fork.c
+++ b/gdb/testsuite/gdb.base/foll-fork.c
@@ -2,22 +2,13 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 void callee (int i)
-#else
-void callee (i)
-  int  i;
-#endif
 {
   /* Any output corrupts GDB CLI expect strings.
      printf("callee: %d\n", i);  */
 }
 
-#ifdef PROTOTYPES
 int main (void)
-#else
-main ()
-#endif
 {
   int  pid;
   int  v = 5;
diff --git a/gdb/testsuite/gdb.base/foll-vfork.c b/gdb/testsuite/gdb.base/foll-vfork.c
index 27c0dfc..933ce38 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.c
+++ b/gdb/testsuite/gdb.base/foll-vfork.c
@@ -18,11 +18,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#ifdef PROTOTYPES
 int main (void)
-#else
-main ()
-#endif
 {
   int  pid;
 
diff --git a/gdb/testsuite/gdb.base/funcargs.c b/gdb/testsuite/gdb.base/funcargs.c
index b34f3fb..600792f 100644
--- a/gdb/testsuite/gdb.base/funcargs.c
+++ b/gdb/testsuite/gdb.base/funcargs.c
@@ -77,12 +77,7 @@ char carray[] = {'a', 'n', ' ', 'a', 'r', 'r', 'a', 'y', '\0'};
 /* Test various permutations and interleaving of integral arguments */
 
 
-#ifdef PROTOTYPES
 void call0a (char c, short s, int i, long l)
-#else
-call0a (c, s, i, l)
-char c; short s; int i; long l;
-#endif
 {
   c = 'a';
   s = 5;
@@ -90,42 +85,22 @@ char c; short s; int i; long l;
   l = 7;
 }
 
-#ifdef PROTOTYPES
 void call0b (short s, int i, long l, char c)
-#else
-call0b (s, i, l, c)
-short s; int i; long l; char c;
-#endif
 {
   s = 6; i = 7; l = 8; c = 'j';
 }
 
-#ifdef PROTOTYPES
 void call0c (int i, long l, char c, short s)
-#else
-call0c (i, l, c, s)
-int i; long l; char c; short s;
-#endif
 {
   i = 3; l = 4; c = 'k'; s = 5;
 }
 
-#ifdef PROTOTYPES
 void call0d (long l, char c, short s, int i)
-#else
-call0d (l, c, s, i)
-long l; char c; short s; int i;
-#endif
 {
   l = 7; c = 'z'; s = 8; i = 9;
 }
 
-#ifdef PROTOTYPES
 void call0e (char c1, long l, char c2, int i, char c3, short s, char c4, char c5)
-#else
-call0e (c1, l, c2, i, c3, s, c4, c5)
-char c1; long l; char c2; int i; char c3; short s; char c4; char c5;
-#endif
 {
   c1 = 'a'; l = 5; c2 = 'b'; i = 7; c3 = 'c'; s = 7; c4 = 'f'; c5 = 'g';
 }
@@ -134,53 +109,27 @@ char c1; long l; char c2; int i; char c3; short s; char c4; char c5;
 /* Test various permutations and interleaving of unsigned integral arguments */
 
 
-#ifdef PROTOTYPES
 void call1a (unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call1a (uc, us, ui, ul)
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   uc = 5; us = 6; ui = 7; ul = 8;
 }
 
-#ifdef PROTOTYPES
 void call1b (unsigned short us, unsigned int ui, unsigned long ul, unsigned char uc)
-#else
-call1b (us, ui, ul, uc)
-unsigned short us; unsigned int ui; unsigned long ul; unsigned char uc;
-#endif
 {
   uc = 5; us = 6; ui = 7; ul = 8;
 }
 
-#ifdef PROTOTYPES
 void call1c (unsigned int ui, unsigned long ul, unsigned char uc, unsigned short us)
-#else
-call1c (ui, ul, uc, us)
-unsigned int ui; unsigned long ul; unsigned char uc; unsigned short us;
-#endif
 {
   uc = 5; us = 6; ui = 7; ul = 8;
 }
 
-#ifdef PROTOTYPES
 void call1d (unsigned long ul, unsigned char uc, unsigned short us, unsigned int ui)
-#else
-call1d (ul, uc, us, ui)
-unsigned long ul; unsigned char uc; unsigned short us; unsigned int ui;
-#endif
 {
   uc = 5; us = 6; ui = 7; ul = 8;
 }
 
-#ifdef PROTOTYPES
 void call1e (unsigned char uc1, unsigned long ul, unsigned char uc2, unsigned int ui, unsigned char uc3, unsigned short us, unsigned char uc4, unsigned char uc5)
-#else
-call1e (uc1, ul, uc2, ui, uc3, us, uc4, uc5)
-unsigned char uc1; unsigned long ul; unsigned char uc2; unsigned int ui;
-unsigned char uc3; unsigned short us; unsigned char uc4; unsigned char uc5;
-#endif
 {
   uc1 = 5; ul = 7; uc2 = 8; ui = 9; uc3 = 10; us = 11; uc4 = 12; uc5 = 55;
 }
@@ -189,93 +138,47 @@ unsigned char uc3; unsigned short us; unsigned char uc4; unsigned char uc5;
    floating point arguments. */
 
 
-#ifdef PROTOTYPES
 void call2a (char c, float f1, short s, double d1, int i, float f2, long l, double d2)
-#else
-call2a (c, f1, s, d1, i, f2, l, d2)
-char c; float f1; short s; double d1; int i; float f2; long l; double d2;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2b (float f1, short s, double d1, int i, float f2, long l, double d2, char c)
-#else
-call2b (f1, s, d1, i, f2, l, d2, c)
-float f1; short s; double d1; int i; float f2; long l; double d2; char c;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2c (short s, double d1, int i, float f2, long l, double d2, char c, float f1)
-#else
-call2c (s, d1, i, f2, l, d2, c, f1)
-short s; double d1; int i; float f2; long l; double d2; char c; float f1;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2d (double d1, int i, float f2, long l, double d2, char c, float f1, short s)
-#else
-call2d (d1, i, f2, l, d2, c, f1, s)
-double d1; int i; float f2; long l; double d2; char c; float f1; short s;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2e (int i, float f2, long l, double d2, char c, float f1, short s, double d1)
-#else
-call2e (i, f2, l, d2, c, f1, s, d1)
-int i; float f2; long l; double d2; char c; float f1; short s; double d1;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2f (float f2, long l, double d2, char c, float f1, short s, double d1, int i)
-#else
-call2f (f2, l, d2, c, f1, s, d1, i)
-float f2; long l; double d2; char c; float f1; short s; double d1; int i;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2g (long l, double d2, char c, float f1, short s, double d1, int i, float f2)
-#else
-call2g (l, d2, c, f1, s, d1, i, f2)
-long l; double d2; char c; float f1; short s; double d1; int i; float f2;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2h (double d2, char c, float f1, short s, double d1, int i, float f2, long l)
-#else
-call2h (d2, c, f1, s, d1, i, f2, l)
-double d2; char c; float f1; short s; double d1; int i; float f2; long l;
-#endif
 {
   c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
 }
 
-#ifdef PROTOTYPES
 void call2i (char c1, float f1, char c2, char c3, double d1, char c4, char c5, char c6, float f2, short s, char c7, double d2)
-#else
-call2i (c1, f1, c2, c3, d1, c4, c5, c6, f2, s, c7, d2)
-char c1; float f1; char c2; char c3; double d1; char c4; char c5; char c6;
-float f2; short s; char c7; double d2;
-#endif
 {
   c1 = 'a'; f1 = 0.0; c2 = 5; d1 = 0.0; c3 = 6; f2 = 0.1; c4 = 7; d2 = 0.2;
   c5 = 's'; c6 = 'f'; c7 = 'z'; s = 77;
@@ -285,33 +188,17 @@ float f2; short s; char c7; double d2;
 /* Test pointers to various integral and floating types. */
 
 
-#ifdef PROTOTYPES
 void call3a (char *cp, short *sp, int *ip, long *lp)
-#else
-call3a (cp, sp, ip, lp)
-char *cp; short *sp; int *ip; long *lp;
-#endif
 {
   cp = 0; sp = 0; ip = 0; lp = 0;
 }
 
-#ifdef PROTOTYPES
 void call3b (unsigned char *ucp, unsigned short *usp, unsigned int *uip, unsigned long *ulp)
-#else
-call3b (ucp, usp, uip, ulp)
-unsigned char *ucp; unsigned short *usp; unsigned int *uip;
-unsigned long *ulp;
-#endif
 {
   ucp = 0; usp = 0; uip = 0; ulp = 0;
 }
 
-#ifdef PROTOTYPES
 void call3c (float *fp, double *dp)
-#else
-call3c (fp, dp)
-float *fp; double *dp;
-#endif
 {
   fp = 0; dp = 0;
 }
@@ -322,107 +209,53 @@ float *fp; double *dp;
 
 /* Test various _Complex type args.  */
 
-#ifdef PROTOTYPES
 void callca (float _Complex f1, float _Complex f2, float _Complex f3)
-#else
-callca (f1, f2, f3)
-float _Complex f1; float _Complex f2; float _Complex f3;
-#endif
 {
 
 }
 
-#ifdef PROTOTYPES
 void callcb (double _Complex d1, double _Complex d2, double _Complex d3)
-#else
-callcb (d1, d2, d3)
-double _Complex d1; double _Complex d2; double _Complex d3;
-#endif
 {
 
 }
 
-#ifdef PROTOTYPES
 void callcc (long double _Complex ld1, long double _Complex ld2, long double _Complex ld3)
-#else
-callcc (ld1, ld2, ld3)
-long double _Complex ld1; long double _Complex ld2; long double _Complex ld3;
-#endif
 {
 
 }
 
-#ifdef PROTOTYPES
 void callcd (float _Complex fc1, double _Complex dc1, long double _Complex ldc1)
-#else
-callcd (fc1, dc1, ldc1)
-float _Complex fc1; double _Complex dc1; long double _Complex ldc1;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void callce (double _Complex dc1, long double _Complex ldc1, float _Complex fc1)
-#else
-callce (dc1, ldc1, fc1)
-double _Complex dc1; long double _Complex ldc1; float _Complex fc1;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void callcf (long double _Complex ldc1, float _Complex fc1, double _Complex dc1)
-#else
-callcf (ldc1, fc1, dc1)
-long double _Complex ldc1; float _Complex fc1; double _Complex dc1;
-#endif
 {
 }
 
 
 /* Test passing _Complex type and integral.  */
-#ifdef PROTOTYPES
 void callc1a (char c, short s, int i, unsigned int ui, long l,
 	      float _Complex fc1, double _Complex dc1,
 	      long double _Complex ldc1)
-#else
-callc1a (c, s, i, ui, l, fc1, dc1, ldc1)
-char c; short s; int i; unsigned int ui; long l; float _Complex fc1; double _Complex dc1; long double _Complex ldc1;
-#endif
 {}
 
-#ifdef PROTOTYPES
 void callc1b (long double _Complex ldc1, char c, short s, int i,
 	      float _Complex fc1, unsigned int ui, long l,  double _Complex dc1)
-#else
-callc1b (ldc1, c, s, i, fc1, ui, l, dc1)
-char c; short s; int i; unsigned int ui; long l; float _Complex fc1; double _Complex dc1; long double _Complex ldc1;
-#endif
 {}
 
 
-#ifdef PROTOTYPES
 void callc2a (char c, short s, int i, unsigned int ui, long l, float f,
 	      double d, float _Complex fc1, double _Complex dc1,
 	      long double _Complex ldc1)
-#else
-callc2a (c, s, i, ui, l, f, d, fc1, dc1, ldc1)
-     char c; short s; int i; unsigned int ui; long l; float f; double d;
-     float _Complex fc1; double _Complex dc1;
-     long double _Complex ldc1;
-#endif
 {}
 
-#ifdef PROTOTYPES
 void callc2b (float _Complex fc1, char c, short s, int i, unsigned int ui,
 	      long double _Complex ldc1, long l, float f, double d,
 	      double _Complex dc1)
-#else
-callc2b (fc1, c, s, i, ui, ldc1, l, f, d, dc1)
-     char c; short s; int i; unsigned int ui; long l; float f; double d;
-     float _Complex fc1; double _Complex dc1;
-     long double _Complex ldc1;
-#endif
 {}
 
 
@@ -431,20 +264,10 @@ callc2b (fc1, c, s, i, ui, ldc1, l, f, d, dc1)
 /* Test passing structures and unions by reference. */
 
 
-#ifdef PROTOTYPES
 void call4a (struct stag *stp)
-#else
-call4a (stp)
-struct stag *stp;
-#endif
 {stp = 0;}
 
-#ifdef PROTOTYPES
 void call4b (union utag *unp)
-#else
-call4b (unp)
-union utag *unp;
-#endif
 {
   unp = 0;
 }
@@ -453,20 +276,10 @@ union utag *unp;
 /* Test passing structures and unions by value. */
 
 
-#ifdef PROTOTYPES
 void call5a (struct stag st)
-#else
-call5a (st)
-struct stag st;
-#endif
 {st.s1 = 5;}
 
-#ifdef PROTOTYPES
 void call5b (union utag un)
-#else
-call5b (un)
-union utag un;
-#endif
 {un.u1 = 7;}
 
 
@@ -477,117 +290,61 @@ void call6k ()
 {
 }
 
-#ifdef PROTOTYPES
 void call6j (unsigned long ul)
-#else
-call6j (ul)
-unsigned long ul;
-#endif
 {
   ul = ul;
     call6k ();
 }
 
-#ifdef PROTOTYPES
 void call6i (unsigned int ui, unsigned long ul)
-#else
-call6i (ui, ul)
-unsigned int ui; unsigned long ul;
-#endif
 {
   ui = ui;
     call6j (ul);
 }
 
-#ifdef PROTOTYPES
 void call6h (unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6h (us, ui, ul)
-unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   us = us;
     call6i (ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6g (unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6g (uc, us, ui, ul)
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   uc = uc;
     call6h (us, ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6f (double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6f (d, uc, us, ui, ul)
-double d;
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   d = d;
     call6g (uc, us, ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6e (float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6e (f, d, uc, us, ui, ul)
-float f; double d;
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   f = f;
     call6f (d, uc, us, ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6d (long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6d (l, f, d, uc, us, ui, ul)
-long l; float f; double d;
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   l = l;
     call6e (f, d, uc, us, ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6c (int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6c (i, l, f, d, uc, us, ui, ul)
-int i; long l; float f; double d;
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   i = i;
     call6d (l, f, d, uc, us, ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6b (short s, int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6b (s, i, l, f, d, uc, us, ui, ul)
-short s; int i; long l; float f; double d;
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   s = s;
     call6c (i, l, f, d, uc, us, ui, ul);
 }
 
-#ifdef PROTOTYPES
 void call6a (char c, short s, int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-call6a (c, s, i, l, f, d, uc, us, ui, ul)
-char c; short s; int i; long l; float f; double d;
-unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
-#endif
 {
   c = c;
     call6b (s, i, l, f, d, uc, us, ui, ul);
@@ -596,113 +353,58 @@ unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
 /*  Test shuffling of args, round robin */
 
 
-#ifdef PROTOTYPES
 void call7k (char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui)
-#else
-call7k (c, i, s, l, f, uc, d, us, ul, ui)
-char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
-#endif
 {
   c = 'a'; i = 7; s = 8; l = 7; f = 0.3; uc = 44; d = 0.44; us = 77;
   ul = 43; ui = 33;
 }
 
-#ifdef PROTOTYPES
 void call7j (unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul)
-#else
-call7j (ui, c, i, s, l, f, uc, d, us, ul)
-unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul;
-#endif
 {
     call7k (c, i, s, l, f, uc, d, us, ul, ui);
 }
 
-#ifdef PROTOTYPES
 void call7i (unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us)
-#else
-call7i (ul, ui, c, i, s, l, f, uc, d, us)
-unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us;
-#endif
 {
     call7j (ui, c, i, s, l, f, uc, d, us, ul);
 }
 
-#ifdef PROTOTYPES
 void call7h (unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d)
-#else
-call7h (us, ul, ui, c, i, s, l, f, uc, d)
-unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d;
-#endif
 {
     call7i (ul, ui, c, i, s, l, f, uc, d, us);
 }
 
-#ifdef PROTOTYPES
 void call7g (double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc)
-#else
-call7g (d, us, ul, ui, c, i, s, l, f, uc)
-double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc;
-#endif
 {
     call7h (us, ul, ui, c, i, s, l, f, uc, d);
 }
 
-#ifdef PROTOTYPES
 void call7f (unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f)
-#else
-call7f (uc, d, us, ul, ui, c, i, s, l, f)
-unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f;
-#endif
 {
     call7g (d, us, ul, ui, c, i, s, l, f, uc);
 }
 
-#ifdef PROTOTYPES
 void call7e (float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l)
-#else
-call7e (f, uc, d, us, ul, ui, c, i, s, l)
-float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l;
-#endif
 {
     call7f (uc, d, us, ul, ui, c, i, s, l, f);
 }
 
-#ifdef PROTOTYPES
 void call7d (long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s)
-#else
-call7d (l, f, uc, d, us, ul, ui, c, i, s)
-long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s;
-#endif
 {
     call7e (f, uc, d, us, ul, ui, c, i, s, l);
 }
 
-#ifdef PROTOTYPES
 void call7c (short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i)
-#else
-call7c (s, l, f, uc, d, us, ul, ui, c, i)
-short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i;
-#endif
 {
     call7d (l, f, uc, d, us, ul, ui, c, i, s);
 }
 
-#ifdef PROTOTYPES
 void call7b (int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c)
-#else
-call7b (i, s, l, f, uc, d, us, ul, ui, c)
-int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c;
-#endif
 {
     call7c (s, l, f, uc, d, us, ul, ui, c, i);
 }
 
-#ifdef PROTOTYPES
 void call7a (char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui)
-#else
-call7a (c, i, s, l, f, uc, d, us, ul, ui)
-char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
-#endif
 {
     call7b (i, s, l, f, uc, d, us, ul, ui, c);
 }
@@ -722,13 +424,7 @@ void hitbottom ()
 {
 }
 
-#ifdef PROTOTYPES
 void recurse (SVAL a, int depth)
-#else
-void recurse (a, depth)
-SVAL a;
-int depth;
-#endif
 {
   a.s = a.i = a.l = --depth;
   if (depth == 0)
@@ -748,16 +444,7 @@ void test_struct_args ()
    calls alloca may do things differently with respect to frames.  So give
    it a try.  */
 
-#ifdef PROTOTYPES
 void localvars_after_alloca (char c, short s, int i, long l)
-#else
-void
-localvars_after_alloca (c, s, i, l)
-     char c;
-     short s;
-     int i;
-     long l;
-#endif
 {
 #ifdef HAVE_STACK_ALLOCA
   /* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
@@ -772,29 +459,14 @@ localvars_after_alloca (c, s, i, l)
   l = 7;
 }
 
-#ifdef PROTOTYPES
 void call_after_alloca_subr (char c, short s, int i, long l, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
-#else
-void
-call_after_alloca_subr (c, s, i, l, uc, us, ui, ul)
-char c; int i; short s; long l; unsigned char uc; unsigned short us; unsigned long ul; unsigned int ui;
-#endif
 {
   c = 'a';
   i = 7; s = 8; l = 7; uc = 44; us = 77;
   ul = 43; ui = 33;
 }
 
-#ifdef PROTOTYPES
 void call_after_alloca (char c, short s, int i, long l)
-#else
-void
-call_after_alloca (c, s, i, l)
-     char c;
-     short s;
-     int i;
-     long l;
-#endif
 {
 #ifdef HAVE_STACK_ALLOCA
   /* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
@@ -813,13 +485,7 @@ call_after_alloca (c, s, i, l)
    will require a trampoline between dyncall and this function on the
    call path, then another trampoline on between this function and main
    on the return path.  */
-#ifdef PROTOTYPES
 double call_with_trampolines (double d1)
-#else
-double
-call_with_trampolines (d1)
-double d1;
-#endif
 {
   return d1;
 } /* End of call_with_trampolines, this comment is needed by funcargs.exp */
diff --git a/gdb/testsuite/gdb.base/gcore.c b/gdb/testsuite/gdb.base/gcore.c
index 88418b3..ee826a5 100644
--- a/gdb/testsuite/gdb.base/gcore.c
+++ b/gdb/testsuite/gdb.base/gcore.c
@@ -49,12 +49,7 @@ array_func ()
   terminal_func ();
 }
 
-#ifdef PROTOTYPES
 int factorial_func (int value)
-#else
-int factorial_func (value)
-     int value;
-#endif
 {
   if (value > 1) {
     value *= factorial_func (value - 1);
diff --git a/gdb/testsuite/gdb.base/jump.c b/gdb/testsuite/gdb.base/jump.c
index 3c05244..376ea17 100644
--- a/gdb/testsuite/gdb.base/jump.c
+++ b/gdb/testsuite/gdb.base/jump.c
@@ -2,12 +2,7 @@
    particularly deep about the functionality nor names in here.
    */
 
-#ifdef PROTOTYPES
 static int square (int x)
-#else
-static int square (x)
-  int  x;
-#endif
 {
   return x*x;			/* out-of-func */
 }
diff --git a/gdb/testsuite/gdb.base/langs0.c b/gdb/testsuite/gdb.base/langs0.c
index cc6efdd..41e5d38 100644
--- a/gdb/testsuite/gdb.base/langs0.c
+++ b/gdb/testsuite/gdb.base/langs0.c
@@ -1,14 +1,8 @@
 /* This file is actually in C, it is not supposed to simulate something
    translated from another language or anything like that.  */
-#ifdef PROTOTYPES
 extern  int fsub_();
 
 int csub (int x)
-#else
-int
-csub (x)
-     int x;
-#endif
 {
   return x + 1;
 }
diff --git a/gdb/testsuite/gdb.base/langs1.c b/gdb/testsuite/gdb.base/langs1.c
index 8ffd13f..7b6b229 100644
--- a/gdb/testsuite/gdb.base/langs1.c
+++ b/gdb/testsuite/gdb.base/langs1.c
@@ -16,22 +16,14 @@ static integer c__10000 = 10000;
 
 /* I am not sure whether there is a way to have a fortran program without */
 /* a MAIN, but it does not really harm us to have one. */
-#ifdef PROTOTYPES
 /* Main program */ void MAIN__()
-#else
-/* Main program */ MAIN__()
-#endif
 {
 } /* MAIN__ */
 
 #line 4 "langs1.f"
 /* Subroutine */ int fsub_()
 {
-#ifdef PROTOTYPES
     extern integer cppsub_(int*);
-#else
-    extern integer cppsub_();
-#endif
 
 #line 5 "langs1.f"
 #line 6 "langs1.f"
diff --git a/gdb/testsuite/gdb.base/langs2.c b/gdb/testsuite/gdb.base/langs2.c
index 502b800..a06fb30 100644
--- a/gdb/testsuite/gdb.base/langs2.c
+++ b/gdb/testsuite/gdb.base/langs2.c
@@ -1,5 +1,4 @@
 /* This is intended to be a vague simulation of cfront output.  */
-#ifdef PROTOTYPES
 #line 1 "langs2.cxx"
 extern int csub (int);
 int
@@ -14,19 +13,3 @@ cppsub_ (int * y)
 {
   return foo__Fi (*y);
 }
-#else 
-#line 1 "langs2.cxx"
-extern int csub ();
-int
-foo__Fi (x) int x;
-{
-  return csub (x / 2);
-}
-
-extern int cppsub_ ();
-int
-cppsub_ (y) int *y;
-{
-  return foo__Fi (*y);
-}
-#endif
diff --git a/gdb/testsuite/gdb.base/mips_pro.c b/gdb/testsuite/gdb.base/mips_pro.c
index c28f99e..2c258a8 100644
--- a/gdb/testsuite/gdb.base/mips_pro.c
+++ b/gdb/testsuite/gdb.base/mips_pro.c
@@ -1,25 +1,13 @@
 /* Tests regarding examination of prologues.  */
 
-#ifdef PROTOTYPES
 int
 inner (int z)
-#else
-int
-inner (z)
-     int z;
-#endif
 {
   return 2 * z;
 }
 
-#ifdef PROTOTYPES
 int
 middle (int x)
-#else
-int
-middle (x)
-     int x;
-#endif
 {
   if (x == 0)
     return inner (5);
@@ -27,27 +15,14 @@ middle (x)
     return inner (6);
 }
 
-#ifdef PROTOTYPES
 int
 top (int y)
-#else
-int
-top (y)
-     int y;
-#endif
 {
   return middle (y + 1);
 }
 
-#ifdef PROTOTYPES
 int
 main (int argc, char **argv)
-#else
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-#endif
 {
   return top (-1) + top (1);
 }
diff --git a/gdb/testsuite/gdb.base/nodebug.c b/gdb/testsuite/gdb.base/nodebug.c
index 4857882..eb5d661 100644
--- a/gdb/testsuite/gdb.base/nodebug.c
+++ b/gdb/testsuite/gdb.base/nodebug.c
@@ -6,65 +6,33 @@ static int datalocal = 4;		/* Should go in local data */
 int bssglobal;				/* Should go in global bss */
 static int bsslocal;			/* Should go in local bss */
 
-#ifdef PROTOTYPES
 int
 inner (int x)
-#else
-int
-inner (x)
-     int x;
-#endif
 {
   return x + dataglobal + datalocal + bssglobal + bsslocal;
 }
 
-#ifdef PROTOTYPES
 static short
 middle (int x)
-#else
-static short
-middle (x)
-     int x;
-#endif
 {
   return 2 * inner (x);
 }
 
-#ifdef PROTOTYPES
 short
 top (int x)
-#else
-short
-top (x)
-     int x;
-#endif
 {
   return 2 * middle (x);
 }
 
-#ifdef PROTOTYPES
 int
 main (int argc, char **argv)
-#else
-int 
-main (argc, argv)
-     int argc;
-     char **argv;
-#endif
 {
   return top (argc);
 }
 
 int *x;
 
-#ifdef PROTOTYPES
 int array_index (char *arr, int i)
-#else
-int
-array_index (arr, i)
-     char *arr;
-     int i;
-#endif
 {
   /* The basic concept is just "return arr[i];".  But call malloc so that gdb
      will be able to call functions.  */
diff --git a/gdb/testsuite/gdb.base/opaque0.c b/gdb/testsuite/gdb.base/opaque0.c
index bf90eca..330560e 100644
--- a/gdb/testsuite/gdb.base/opaque0.c
+++ b/gdb/testsuite/gdb.base/opaque0.c
@@ -7,9 +7,7 @@
 
 struct foo *foop;
 extern struct foo *getfoo ();
-#ifdef PROTOTYPES
 extern void putfoo (struct foo *foop);
-#endif
 
 int main ()
 {
diff --git a/gdb/testsuite/gdb.base/opaque1.c b/gdb/testsuite/gdb.base/opaque1.c
index c34f7aa..ccb5fce 100644
--- a/gdb/testsuite/gdb.base/opaque1.c
+++ b/gdb/testsuite/gdb.base/opaque1.c
@@ -8,11 +8,6 @@ struct foo *getfoo ()
     return (&afoo);
 }
 
-#ifdef PROTOTYPES
 void putfoo (struct foo *foop)
-#else
-void putfoo (foop)
-     struct foo *foop;
-#endif
 {
 }
diff --git a/gdb/testsuite/gdb.base/recurse.c b/gdb/testsuite/gdb.base/recurse.c
index cb7b022..821c2de 100644
--- a/gdb/testsuite/gdb.base/recurse.c
+++ b/gdb/testsuite/gdb.base/recurse.c
@@ -1,14 +1,8 @@
 /* Trivial code used to test watchpoints in recursive code and 
    auto-deletion of watchpoints as they go out of scope.  */
 
-#ifdef PROTOTYPES
 static int
 recurse (int a)
-#else
-static int 
-recurse (a)
-     int a;
-#endif
 {
   int b = 0;
 
diff --git a/gdb/testsuite/gdb.base/run.c b/gdb/testsuite/gdb.base/run.c
index df54056..0c62002 100644
--- a/gdb/testsuite/gdb.base/run.c
+++ b/gdb/testsuite/gdb.base/run.c
@@ -6,17 +6,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 int factorial (int);
 
 int
 main (int argc, char **argv, char **envp)
-#else
-int
-main (argc, argv, envp)
-int argc;
-char *argv[], **envp;
-#endif
 {
 #ifdef FAKEARGV
     printf ("%d\n", factorial (1)); /* commands.exp: hw local_var out of scope */
@@ -31,11 +24,7 @@ char *argv[], **envp;
     return 0;
 }
 
-#ifdef PROTOTYPES
 int factorial (int value)
-#else
-int factorial (value) int value;
-#endif
 {
     int  local_var;
 
diff --git a/gdb/testsuite/gdb.base/scope0.c b/gdb/testsuite/gdb.base/scope0.c
index 775f8dc..e7f4724 100644
--- a/gdb/testsuite/gdb.base/scope0.c
+++ b/gdb/testsuite/gdb.base/scope0.c
@@ -44,14 +44,8 @@ void init0 ()
 
 /* This is to derail optimizer in localscopes.
    Return 1 + 2 + . . . + N.  */
-#ifdef PROTOTYPES
 int
 sum_upto (int n)
-#else
-int
-sum_upto (n)
-     int n;
-#endif
 {
   int i;
   int retval = 0;
@@ -61,13 +55,8 @@ sum_upto (n)
   return retval;
 }
 
-#ifdef PROTOTYPES
 int
 useit (int val)
-#else
-int
-useit (val) int val;
-#endif
 {
     static int usedval;
 
@@ -75,13 +64,8 @@ useit (val) int val;
     return val + sum_upto (0);
 }
 
-#ifdef PROTOTYPES
 int
 useitp (const int *val)
-#else
-int
-useitp (val) const int *val;
-#endif
 {
     static int usedval;
 
@@ -89,15 +73,8 @@ useitp (val) const int *val;
     return *val + sum_upto (0);
 }
 
-#ifdef PROTOTYPES
 int
 autovars (int bcd, int abc)
-#else
-int
-autovars (bcd, abc)
-     int bcd;
-     int abc;
-#endif
 {
     int  i0 =  useit (0),  i1 =  useit (1),  i2 =  useit (2);
     int  i3 =  useit (3),  i4 =  useit (4),  i5 =  useit (5);
@@ -172,14 +149,8 @@ autovars (bcd, abc)
       + i91 + i92 + i93 + i94 + i95 + i96 + i97 + i98 + i99 + abc + bcd;
 }
 
-#ifdef PROTOTYPES
 int
 localscopes (int x)
-#else
-int
-localscopes (x)
-     int x;
-#endif
 {
     int localval;
     int retval;
diff --git a/gdb/testsuite/gdb.base/scope1.c b/gdb/testsuite/gdb.base/scope1.c
index 2631ead..e4a7ed2 100644
--- a/gdb/testsuite/gdb.base/scope1.c
+++ b/gdb/testsuite/gdb.base/scope1.c
@@ -43,11 +43,7 @@ void usestatics1 ()
   useit1 (&filelocal_ro);
 }
 
-#ifdef PROTOTYPES
 void useit1 (const int *val)
-#else
-void useit1 (val) const int *val;
-#endif
 {
     static int usedval;
 
diff --git a/gdb/testsuite/gdb.base/setshow.c b/gdb/testsuite/gdb.base/setshow.c
index a30ef82..c8e843c 100644
--- a/gdb/testsuite/gdb.base/setshow.c
+++ b/gdb/testsuite/gdb.base/setshow.c
@@ -3,15 +3,8 @@
 
 #include <stdio.h>
 
-#ifdef PROTOTYPES
 int
 main(int argc, char **argv)
-#else
-int 
-main(argc, argv)
-     int argc;
-     char **argv;
-#endif
 {
   int i = 1;
 
diff --git a/gdb/testsuite/gdb.base/setvar.c b/gdb/testsuite/gdb.base/setvar.c
index 5d08602..1b8d808 100644
--- a/gdb/testsuite/gdb.base/setvar.c
+++ b/gdb/testsuite/gdb.base/setvar.c
@@ -1,13 +1,6 @@
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 int main (int argc, char **argv, char **envp)
-#else
-main (argc, argv, envp)
-     int argc;
-     char **argv;
-     char **envp;
-#endif
 {
     extern void dummy();
     dummy();
diff --git a/gdb/testsuite/gdb.base/shmain.c b/gdb/testsuite/gdb.base/shmain.c
index d2dc2f3..e36f84f 100644
--- a/gdb/testsuite/gdb.base/shmain.c
+++ b/gdb/testsuite/gdb.base/shmain.c
@@ -18,22 +18,12 @@ struct {
 
 int g;
 
-#ifdef PROTOTYPES
 int local_structarg(struct s x)
-#else
-int local_structarg(x)
-struct s x;
-#endif
 {
   return x.b;
 }
 
-#ifdef PROTOTYPES
 int mainshr1(int g)
-#else
-int mainshr1(g)
-int g;
-#endif
 {
   return 2*g;
 }
diff --git a/gdb/testsuite/gdb.base/shr1.c b/gdb/testsuite/gdb.base/shr1.c
index 117119a..da7bffa 100644
--- a/gdb/testsuite/gdb.base/shr1.c
+++ b/gdb/testsuite/gdb.base/shr1.c
@@ -7,12 +7,7 @@ float sg = 5.5;
 int sgi = 2;
 static int sgs = 7;
 
-#ifdef PROTOTYPES
 int shr1(int x)
-#else
-int shr1(x)
-int x;
-#endif
 {
   f mumble;
   int l;
@@ -29,32 +24,17 @@ int x;
   return 2*x;
 }
 
-#ifdef PROTOTYPES
 static int shr1_local(int x)
-#else
-static int shr1_local(x)
-int x;
-#endif
 {
   return 2*x;
 }
 
-#ifdef PROTOTYPES
 int structarg(struct s x)
-#else
-int structarg(x)
-struct s x;
-#endif
 {
   return x.a;
 }
 
-#ifdef PROTOTYPES
 int pstructarg(struct s *x)
-#else
-int pstructarg(x)
-struct s *x;
-#endif
 {
   return x->a;
 }
diff --git a/gdb/testsuite/gdb.base/shr2.c b/gdb/testsuite/gdb.base/shr2.c
index 36a71b3..1007b61 100644
--- a/gdb/testsuite/gdb.base/shr2.c
+++ b/gdb/testsuite/gdb.base/shr2.c
@@ -1,17 +1,9 @@
-#ifdef PROTOTYPES
 int shr2(int x)
-#else
-int shr2(x) int x;
-#endif
 {
   return 2*x;			/* shr2-return */
 }
 
-#ifdef PROTOTYPES
 int shr2_local(int x)
-#else
-int shr2_local(x) int x;
-#endif
 {
   return 2*x;
 }
diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
index 283cef3..81f3b08 100644
--- a/gdb/testsuite/gdb.base/sigall.c
+++ b/gdb/testsuite/gdb.base/sigall.c
@@ -5,784 +5,358 @@
 /* Signal handlers, we set breakpoints in them to make sure that the
    signals really get delivered.  */
 
-#ifdef PROTOTYPES
 void
 handle_ABRT (int sig)
-#else
-void
-handle_ABRT (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_HUP (int sig)
-#else
-void
-handle_HUP (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_QUIT (int sig)
-#else
-void
-handle_QUIT (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_ILL (int sig)
-#else
-void
-handle_ILL (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_EMT (int sig)
-#else
-void
-handle_EMT (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_FPE (int sig)
-#else
-void
-handle_FPE (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_BUS (int sig)
-#else
-void
-handle_BUS (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_SEGV (int sig)
-#else
-void
-handle_SEGV (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_SYS (int sig)
-#else
-void
-handle_SYS (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_PIPE (int sig)
-#else
-void
-handle_PIPE (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_ALRM (int sig)
-#else
-void
-handle_ALRM (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_URG (int sig)
-#else
-void
-handle_URG (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_TSTP (int sig)
-#else
-void
-handle_TSTP (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_CONT (int sig)
-#else
-void
-handle_CONT (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_CHLD (int sig)
-#else
-void
-handle_CHLD (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_TTIN (int sig)
-#else
-void
-handle_TTIN (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_TTOU (int sig)
-#else
-void
-handle_TTOU (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_IO (int sig)
-#else
-void
-handle_IO (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_XCPU (int sig)
-#else
-void
-handle_XCPU (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_XFSZ (int sig)
-#else
-void
-handle_XFSZ (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_VTALRM (int sig)
-#else
-void
-handle_VTALRM (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_PROF (int sig)
-#else
-void
-handle_PROF (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_WINCH (int sig)
-#else
-void
-handle_WINCH (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_LOST (int sig)
-#else
-void
-handle_LOST (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_USR1 (int sig)
-#else
-void
-handle_USR1 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_USR2 (int sig)
-#else
-void
-handle_USR2 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_PWR (int sig)
-#else
-void
-handle_PWR (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_POLL (int sig)
-#else
-void
-handle_POLL (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_WIND (int sig)
-#else
-void
-handle_WIND (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_PHONE (int sig)
-#else
-void
-handle_PHONE (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_WAITING (int sig)
-#else
-void
-handle_WAITING (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_LWP (int sig)
-#else
-void
-handle_LWP (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_DANGER (int sig)
-#else
-void
-handle_DANGER (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_GRANT (int sig)
-#else
-void
-handle_GRANT (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_RETRACT (int sig)
-#else
-void
-handle_RETRACT (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_MSG (int sig)
-#else
-void
-handle_MSG (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_SOUND (int sig)
-#else
-void
-handle_SOUND (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_SAK (int sig)
-#else
-void
-handle_SAK (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_PRIO (int sig)
-#else
-void
-handle_PRIO (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_33 (int sig)
-#else
-void
-handle_33 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_34 (int sig)
-#else
-void
-handle_34 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_35 (int sig)
-#else
-void
-handle_35 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_36 (int sig)
-#else
-void
-handle_36 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_37 (int sig)
-#else
-void
-handle_37 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_38 (int sig)
-#else
-void
-handle_38 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_39 (int sig)
-#else
-void
-handle_39 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_40 (int sig)
-#else
-void
-handle_40 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_41 (int sig)
-#else
-void
-handle_41 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_42 (int sig)
-#else
-void
-handle_42 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_43 (int sig)
-#else
-void
-handle_43 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_44 (int sig)
-#else
-void
-handle_44 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_45 (int sig)
-#else
-void
-handle_45 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_46 (int sig)
-#else
-void
-handle_46 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_47 (int sig)
-#else
-void
-handle_47 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_48 (int sig)
-#else
-void
-handle_48 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_49 (int sig)
-#else
-void
-handle_49 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_50 (int sig)
-#else
-void
-handle_50 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_51 (int sig)
-#else
-void
-handle_51 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_52 (int sig)
-#else
-void
-handle_52 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_53 (int sig)
-#else
-void
-handle_53 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_54 (int sig)
-#else
-void
-handle_54 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_55 (int sig)
-#else
-void
-handle_55 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_56 (int sig)
-#else
-void
-handle_56 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_57 (int sig)
-#else
-void
-handle_57 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_58 (int sig)
-#else
-void
-handle_58 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_59 (int sig)
-#else
-void
-handle_59 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_60 (int sig)
-#else
-void
-handle_60 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_61 (int sig)
-#else
-void
-handle_61 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_62 (int sig)
-#else
-void
-handle_62 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_63 (int sig)
-#else
-void
-handle_63 (sig)
-     int sig;
-#endif
 {
 }
 
-#ifdef PROTOTYPES
 void
 handle_TERM (int sig)
-#else
-void
-handle_TERM (sig)
-     int sig;
-#endif
 {
 }
 \f
diff --git a/gdb/testsuite/gdb.base/signals.c b/gdb/testsuite/gdb.base/signals.c
index 51e97c4..7566068 100644
--- a/gdb/testsuite/gdb.base/signals.c
+++ b/gdb/testsuite/gdb.base/signals.c
@@ -6,14 +6,8 @@
 
 static int count = 0;
 
-#ifdef PROTOTYPES
 static void
 handler (int sig)
-#else
-static void
-handler (sig)
-     int sig;
-#endif
 {
   signal (sig, handler);
   ++count;
diff --git a/gdb/testsuite/gdb.base/so-indr-cl.c b/gdb/testsuite/gdb.base/so-indr-cl.c
index f31800d..9b5e5a9 100644
--- a/gdb/testsuite/gdb.base/so-indr-cl.c
+++ b/gdb/testsuite/gdb.base/so-indr-cl.c
@@ -3,18 +3,10 @@
    */
 
 #include <stdio.h>
-#ifdef PROTOTYPES
 extern "C" int solib_main (int);
 
 static int
 solib_wrapper (int (*function)(int))
-#else
-extern int solib_main (int);
-
-static int
-solib_wrapper (function)
-  int (*function)(int);
-#endif
 {
   return (*function)(100);
 }
diff --git a/gdb/testsuite/gdb.base/solib2.c b/gdb/testsuite/gdb.base/solib2.c
index 8c69d8b..131c337 100644
--- a/gdb/testsuite/gdb.base/solib2.c
+++ b/gdb/testsuite/gdb.base/solib2.c
@@ -5,12 +5,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-#ifdef PROTOTYPES
 int  solib_main (int  arg)
-#else
-int  solib_main (arg)
-  int  arg;
-#endif
 {
   return arg*arg*arg;
 }
diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c
index d0b69a8..1fb4250 100644
--- a/gdb/testsuite/gdb.base/structs.c
+++ b/gdb/testsuite/gdb.base/structs.c
@@ -193,165 +193,75 @@ struct struct18 fun18()
   return foo18; 
 }
 
-#ifdef PROTOTYPES
 void Fun1(struct struct1 foo1)
-#else
-void Fun1(foo1)
-     struct struct1 foo1;
-#endif
 {
   L1 = foo1;
 }
-#ifdef PROTOTYPES
 void Fun2(struct struct2 foo2)
-#else
-void Fun2(foo2)
-     struct struct2 foo2;
-#endif
 {
   L2 = foo2;
 }
-#ifdef PROTOTYPES
 void Fun3(struct struct3 foo3)
-#else
-void Fun3(foo3)
-     struct struct3 foo3;
-#endif
 {
   L3 = foo3;
 }
-#ifdef PROTOTYPES
 void Fun4(struct struct4 foo4)
-#else
-void Fun4(foo4)
-     struct struct4 foo4;
-#endif
 {
   L4 = foo4;
 }
-#ifdef PROTOTYPES
 void Fun5(struct struct5 foo5)
-#else
-void Fun5(foo5)
-     struct struct5 foo5;
-#endif
 {
   L5 = foo5;
 }
-#ifdef PROTOTYPES
 void Fun6(struct struct6 foo6)
-#else
-void Fun6(foo6)
-     struct struct6 foo6;
-#endif
 {
   L6 = foo6;
 }
-#ifdef PROTOTYPES
 void Fun7(struct struct7 foo7)
-#else
-void Fun7(foo7)
-     struct struct7 foo7;
-#endif
 {
   L7 = foo7;
 }
-#ifdef PROTOTYPES
 void Fun8(struct struct8 foo8)
-#else
-void Fun8(foo8)
-     struct struct8 foo8;
-#endif
 {
   L8 = foo8;
 }
-#ifdef PROTOTYPES
 void Fun9(struct struct9 foo9)
-#else
-void Fun9(foo9)
-     struct struct9 foo9;
-#endif
 {
   L9 = foo9;
 }
-#ifdef PROTOTYPES
 void Fun10(struct struct10 foo10)
-#else
-void Fun10(foo10)
-     struct struct10 foo10;
-#endif
 {
   L10 = foo10; 
 }
-#ifdef PROTOTYPES
 void Fun11(struct struct11 foo11)
-#else
-void Fun11(foo11)
-     struct struct11 foo11;
-#endif
 {
   L11 = foo11; 
 }
-#ifdef PROTOTYPES
 void Fun12(struct struct12 foo12)
-#else
-void Fun12(foo12)
-     struct struct12 foo12;
-#endif
 {
   L12 = foo12; 
 }
-#ifdef PROTOTYPES
 void Fun13(struct struct13 foo13)
-#else
-void Fun13(foo13)
-     struct struct13 foo13;
-#endif
 {
   L13 = foo13; 
 }
-#ifdef PROTOTYPES
 void Fun14(struct struct14 foo14)
-#else
-void Fun14(foo14)
-     struct struct14 foo14;
-#endif
 {
   L14 = foo14; 
 }
-#ifdef PROTOTYPES
 void Fun15(struct struct15 foo15)
-#else
-void Fun15(foo15)
-     struct struct15 foo15;
-#endif
 {
   L15 = foo15; 
 }
-#ifdef PROTOTYPES
 void Fun16(struct struct16 foo16)
-#else
-void Fun16(foo16)
-     struct struct16 foo16;
-#endif
 {
   L16 = foo16; 
 }
-#ifdef PROTOTYPES
 void Fun17(struct struct17 foo17)
-#else
-void Fun17(foo17)
-     struct struct17 foo17;
-#endif
 {
   L17 = foo17; 
 }
-#ifdef PROTOTYPES
 void Fun18(struct struct18 foo18)
-#else
-void Fun18(foo18)
-     struct struct18 foo18;
-#endif
 {
   L18 = foo18; 
 }
diff --git a/gdb/testsuite/gdb.base/sum.c b/gdb/testsuite/gdb.base/sum.c
index 6dd7a75..3e27fa1 100644
--- a/gdb/testsuite/gdb.base/sum.c
+++ b/gdb/testsuite/gdb.base/sum.c
@@ -1,12 +1,7 @@
 /* This is a sample program for the HP/DDE debugger. */
 #include <stdio.h>
 
-#ifdef PROTOTYPES
 int sum(int *list, int low, int high)
-#else
-int sum(list, low, high)
-int *list, low, high;
-#endif
     {
         int i = 0, s = 0;	/* stop-in-sum */
         for (i = low; i <= high; i++)
diff --git a/gdb/testsuite/gdb.base/vforked-prog.c b/gdb/testsuite/gdb.base/vforked-prog.c
index 763e5d9..818ad98 100644
--- a/gdb/testsuite/gdb.base/vforked-prog.c
+++ b/gdb/testsuite/gdb.base/vforked-prog.c
@@ -17,11 +17,7 @@
 
 #include <stdio.h>
 
-#ifdef PROTOTYPES
 int main (void)
-#else
-main()
-#endif
 {
   printf("Hello from vforked-prog...\n");
   return 0;
diff --git a/gdb/testsuite/gdb.base/watchpoint.c b/gdb/testsuite/gdb.base/watchpoint.c
index 92fb3b1..60f60d6 100644
--- a/gdb/testsuite/gdb.base/watchpoint.c
+++ b/gdb/testsuite/gdb.base/watchpoint.c
@@ -81,11 +81,7 @@ void marker6 ()
 {
 }
 
-#ifdef PROTOTYPES
 void recurser (int  x)
-#else
-void recurser (x) int  x;
-#endif
 {
   int  local_x = 0;
 
diff --git a/gdb/testsuite/gdb.reverse/shr2.c b/gdb/testsuite/gdb.reverse/shr2.c
index 52ed6b2..1329df1 100644
--- a/gdb/testsuite/gdb.reverse/shr2.c
+++ b/gdb/testsuite/gdb.reverse/shr2.c
@@ -17,20 +17,12 @@
 
 #include "shr.h"
 
-#ifdef PROTOTYPES
 int shr2(int x)
-#else
-int shr2(x) int x;
-#endif
 {
   return 2*x;
 }
 
-#ifdef PROTOTYPES
 int shr2_local(int x)
-#else
-int shr2_local(x) int x;
-#endif
 {
   return 2*x;
 }
diff --git a/gdb/testsuite/gdb.reverse/until-reverse.c b/gdb/testsuite/gdb.reverse/until-reverse.c
index 28c71b2..80581b4 100644
--- a/gdb/testsuite/gdb.reverse/until-reverse.c
+++ b/gdb/testsuite/gdb.reverse/until-reverse.c
@@ -18,34 +18,20 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 extern int marker1 (void);
 extern int marker2 (int a);
 extern void marker3 (char *a, char *b);
 extern void marker4 (long d);
-#else
-extern int marker1 ();
-extern int marker2 ();
-extern void marker3 ();
-extern void marker4 ();
-#endif
 
 /*
  *	This simple classical example of recursion is useful for
  *	testing stack backtraces and such.
  */
 
-#ifdef PROTOTYPES
 int factorial(int);
 
 int
 main (int argc, char **argv, char **envp)
-#else
-int
-main (argc, argv, envp)
-int argc;
-char *argv[], **envp;
-#endif
 {
     if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
 	fprintf (stderr, "usage:  factorial <number>\n");
@@ -65,12 +51,7 @@ char *argv[], **envp;
     return argc;  /* set breakpoint 10 here */
 } /* set breakpoint 10a here */
 
-#ifdef PROTOTYPES
 int factorial (int value)
-#else
-int factorial (value)
-int value;
-#endif
 {
   if (value > 1) {  /* set breakpoint 7 here */
 	value *= factorial (value - 1);
@@ -78,12 +59,7 @@ int value;
     return (value); /* set breakpoint 19 here */
 }
 
-#ifdef PROTOTYPES
 int multi_line_if_conditional (int a, int b, int c)
-#else
-int multi_line_if_conditional (a, b, c)
-  int a, b, c;
-#endif
 {
   if (a    /* set breakpoint 3 here */
       && b
@@ -93,12 +69,7 @@ int multi_line_if_conditional (a, b, c)
     return 1;
 }
 
-#ifdef PROTOTYPES
 int multi_line_while_conditional (int a, int b, int c)
-#else
-int multi_line_while_conditional (a, b, c)
-  int a, b, c;
-#endif
 {
   while (a /* set breakpoint 4 here */
       && b
diff --git a/gdb/testsuite/gdb.reverse/ur1.c b/gdb/testsuite/gdb.reverse/ur1.c
index b07e211..3147646 100644
--- a/gdb/testsuite/gdb.reverse/ur1.c
+++ b/gdb/testsuite/gdb.reverse/ur1.c
@@ -26,17 +26,10 @@
    These functions are in a separate source file to prevent an
    optimizing compiler from inlining them and optimizing them away. */
 
-#ifdef PROTOTYPES
 int marker1 (void) { return (0); }	/* set breakpoint 15 here */
 int marker2 (int a) { return (1); }	/* set breakpoint 8 here */
 void marker3 (char *a, char *b) {}	/* set breakpoint 17 here */
 void marker4 (long d) {}		/* set breakpoint 14 here */
-#else
-int marker1 () { return (0); }		/* set breakpoint 16 here */
-int marker2 (a) int a; { return (1); }	/* set breakpoint 9 here */
-void marker3 (a, b) char *a, *b; {}	/* set breakpoint 18 here */
-void marker4 (d) long d; {}		/* set breakpoint 13 here */
-#endif
 
 /* A structure we use for field name completion tests.  */
 struct some_struct
diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.c b/gdb/testsuite/gdb.reverse/watch-reverse.c
index 7244793..2f7b180 100644
--- a/gdb/testsuite/gdb.reverse/watch-reverse.c
+++ b/gdb/testsuite/gdb.reverse/watch-reverse.c
@@ -78,11 +78,7 @@ void marker6 ()
 {
 }
 
-#ifdef PROTOTYPES
 void recurser (int  x)
-#else
-void recurser (x) int  x;
-#endif
 {
   int  local_x;
 
-- 
1.8.4.2

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

* [PATCH 16/16] GDB testsuite: Fix warnings with -std=gnu11
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (12 preceding siblings ...)
  2014-10-29 16:04 ` [PATCH 14/16] Drop non-prototype C function header variants: 'sepdebug' " Andreas Arnez
@ 2014-10-29 16:04 ` Andreas Arnez
  2014-10-29 16:04 ` [PATCH 15/16] GDB testsuite: drop non-prototype C function header variants Andreas Arnez
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 16:04 UTC (permalink / raw)
  To: gdb-patches

Since upstream GCC has changed the default C language dialect to
'gnu11', it yields multiple warnings in the GDB testsuite for missing
function return types and implicit function declarations.  This patch
attempts to fix these.

gdb/testsuite/ChangeLog:

	* gdb.ada/cond_lang/foo.c (callme): Add return type.
	* gdb.base/call-sc.c (zed): Likewise.
	* gdb.base/checkpoint.c (main): Likewise.
	* gdb.base/dump.c (main): Likewise.
	* gdb.base/gcore.c (main): Likewise.
	* gdb.base/huge.c (main): Likewise.
	* gdb.base/multi-forks.c (main): Likewise.
	* gdb.base/pr10179-a.c (main): Likewise.
	* gdb.base/savedregs.c (main): Likewise.
	* gdb.base/sigaltstack.c (main): Likewise.
	* gdb.base/siginfo.c (main): Likewise.
	* gdb.base/structs.c (zed): Likewise.
	* gdb.mi/mi-stack.c (callee3, callee2, callee1, main): Likewise.
	* gdb.mi/mi-syn-frame.c (main): Likewise.
	* gdb.mi/until.c (foo, main): Likewise.
	* gdb.base/global-var-nested-by-dso.c (b_main, c_main): Declare.
	* gdb.base/solib-weak.c (foo): Declare.
	* gdb.base/attach-twice.c: Include stdio.h.
	* gdb.base/weaklib1.c: Likewise.
	* gdb.base/weaklib2.c: Likewise.
	* gdb.base/catch-signal-fork.c: Include stdio.h and sys/wait.h.
	* gdb.mi/mi-condbreak-call-thr-state-mt.c: Include stdio.h and
	unistd.h.
	* gdb.base/attach-pie-misread.c: Include stdlib.h.
	* gdb.mi/mi-exit-code.c: Likewise.
	* gdb.base/break-interp-lib.c: Include string.h.
	* gdb.base/coremaker.c: Likewise.
	* gdb.base/testenv.c: Likewise.
	* gdb.python/py-finish-breakpoint.c: Likewise.
	* gdb.base/inferior-died.c: Include sys/wait.h.
	* gdb.base/fileio.c: Include time.h.
	* gdb.base/async-shell.c: Include unistd.h.
	* gdb.base/dprintf-non-stop.c: Likewise.
	* gdb.base/info-os.c: Likewise.
	* gdb.mi/mi-console.c: Likewise.
	* gdb.mi/watch-nonstop.c: Likewise.
	* gdb.python/py-events.c: Likewise.
	* gdb.base/async.c (baz): Move up before its invocation.
	* gdb.base/code_elim2.c (my_global_func): Likewise.
	* gdb.base/skip-solib-lib.c (multiply): Likewise.
	* gdb.base/advance.c (func2): Likewise.
---
 gdb/testsuite/gdb.ada/cond_lang/foo.c                 |  2 +-
 gdb/testsuite/gdb.base/advance.c                      | 10 +++++-----
 gdb/testsuite/gdb.base/async-shell.c                  |  2 ++
 gdb/testsuite/gdb.base/async.c                        | 13 ++++++-------
 gdb/testsuite/gdb.base/attach-pie-misread.c           |  1 +
 gdb/testsuite/gdb.base/attach-twice.c                 |  1 +
 gdb/testsuite/gdb.base/break-interp-lib.c             |  1 +
 gdb/testsuite/gdb.base/call-sc.c                      |  2 +-
 gdb/testsuite/gdb.base/catch-signal-fork.c            |  2 ++
 gdb/testsuite/gdb.base/checkpoint.c                   |  7 ++++---
 gdb/testsuite/gdb.base/code_elim2.c                   | 12 ++++++------
 gdb/testsuite/gdb.base/coremaker.c                    |  1 +
 gdb/testsuite/gdb.base/dprintf-non-stop.c             |  2 ++
 gdb/testsuite/gdb.base/dump.c                         |  2 ++
 gdb/testsuite/gdb.base/fileio.c                       |  1 +
 gdb/testsuite/gdb.base/gcore.c                        |  1 +
 gdb/testsuite/gdb.base/global-var-nested-by-dso.c     |  3 +++
 gdb/testsuite/gdb.base/huge.c                         |  1 +
 gdb/testsuite/gdb.base/inferior-died.c                |  1 +
 gdb/testsuite/gdb.base/info-os.c                      |  1 +
 gdb/testsuite/gdb.base/multi-forks.c                  |  3 ++-
 gdb/testsuite/gdb.base/pr10179-a.c                    |  1 +
 gdb/testsuite/gdb.base/savedregs.c                    |  2 ++
 gdb/testsuite/gdb.base/sigaltstack.c                  |  2 ++
 gdb/testsuite/gdb.base/siginfo.c                      |  1 +
 gdb/testsuite/gdb.base/skip-solib-lib.c               |  8 ++++----
 gdb/testsuite/gdb.base/solib-weak.c                   |  2 ++
 gdb/testsuite/gdb.base/structs.c                      |  1 +
 gdb/testsuite/gdb.base/testenv.c                      |  1 +
 gdb/testsuite/gdb.base/weaklib1.c                     |  2 ++
 gdb/testsuite/gdb.base/weaklib2.c                     |  2 ++
 gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c |  2 ++
 gdb/testsuite/gdb.mi/mi-console.c                     |  2 ++
 gdb/testsuite/gdb.mi/mi-exit-code.c                   |  2 ++
 gdb/testsuite/gdb.mi/mi-stack.c                       |  9 +++++----
 gdb/testsuite/gdb.mi/mi-syn-frame.c                   |  2 ++
 gdb/testsuite/gdb.mi/until.c                          |  2 ++
 gdb/testsuite/gdb.mi/watch-nonstop.c                  |  2 ++
 gdb/testsuite/gdb.python/py-events.c                  |  2 ++
 gdb/testsuite/gdb.python/py-finish-breakpoint.c       |  1 +
 40 files changed, 83 insertions(+), 32 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/cond_lang/foo.c b/gdb/testsuite/gdb.ada/cond_lang/foo.c
index 3861da7..d701f62 100644
--- a/gdb/testsuite/gdb.ada/cond_lang/foo.c
+++ b/gdb/testsuite/gdb.ada/cond_lang/foo.c
@@ -15,7 +15,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-extern callme (void);
+extern void callme (void);
 
 void
 c_function (void)
diff --git a/gdb/testsuite/gdb.base/advance.c b/gdb/testsuite/gdb.base/advance.c
index 8066dee..ab86b0e 100644
--- a/gdb/testsuite/gdb.base/advance.c
+++ b/gdb/testsuite/gdb.base/advance.c
@@ -13,15 +13,15 @@ int bar (int y)
   return z;
 }
 
-void func()
+int func2 ()
 {
-  x = x + 5;
-  func2 ();
+  x = 6;
 }
 
-int func2 ()
+void func()
 {
-  x = 6;
+  x = x + 5;
+  func2 ();
 }
 
 int func3 ()
diff --git a/gdb/testsuite/gdb.base/async-shell.c b/gdb/testsuite/gdb.base/async-shell.c
index 3629d77..1b63be1 100644
--- a/gdb/testsuite/gdb.base/async-shell.c
+++ b/gdb/testsuite/gdb.base/async-shell.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <unistd.h>
+
 int
 main (void)
 {
diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c
index 32779d9..9148b19 100644
--- a/gdb/testsuite/gdb.base/async.c
+++ b/gdb/testsuite/gdb.base/async.c
@@ -13,6 +13,12 @@ foo (void)
 }
 
 int
+baz (void)
+{
+  return 5;
+}
+
+int
 main (void)
 {
  int y, z;
@@ -25,10 +31,3 @@ main (void)
  y = baz ();
  return 0; /* until here */
 }
-
-
-int
-baz (void)
-{ 
-  return 5;
-}
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.c b/gdb/testsuite/gdb.base/attach-pie-misread.c
index 7de2ad3..08789d0 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.c
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.c
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 const char stub[] = {
diff --git a/gdb/testsuite/gdb.base/attach-twice.c b/gdb/testsuite/gdb.base/attach-twice.c
index 74ee332..efe14f0 100644
--- a/gdb/testsuite/gdb.base/attach-twice.c
+++ b/gdb/testsuite/gdb.base/attach-twice.c
@@ -15,6 +15,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/ptrace.h>
diff --git a/gdb/testsuite/gdb.base/break-interp-lib.c b/gdb/testsuite/gdb.base/break-interp-lib.c
index 314dc66..0df2934 100644
--- a/gdb/testsuite/gdb.base/break-interp-lib.c
+++ b/gdb/testsuite/gdb.base/break-interp-lib.c
@@ -19,6 +19,7 @@
 #include <unistd.h>
 #include <assert.h>
 #include <stdio.h>
+#include <string.h>
 
 /* Force REL->RELA conversion on i386, see "Prelink", March 4, 2004.  */
 volatile int v[2];
diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c
index 56c18da..98c0229 100644
--- a/gdb/testsuite/gdb.base/call-sc.c
+++ b/gdb/testsuite/gdb.base/call-sc.c
@@ -46,7 +46,7 @@ void Fun(T foo)
   L = foo;
 }
 
-zed ()
+void zed ()
 {
   L = 'Z';
 }
diff --git a/gdb/testsuite/gdb.base/catch-signal-fork.c b/gdb/testsuite/gdb.base/catch-signal-fork.c
index 87fe417..5ae83d6 100644
--- a/gdb/testsuite/gdb.base/catch-signal-fork.c
+++ b/gdb/testsuite/gdb.base/catch-signal-fork.c
@@ -14,8 +14,10 @@
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+#include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 void
diff --git a/gdb/testsuite/gdb.base/checkpoint.c b/gdb/testsuite/gdb.base/checkpoint.c
index b6f7ecd..8f9d6da 100644
--- a/gdb/testsuite/gdb.base/checkpoint.c
+++ b/gdb/testsuite/gdb.base/checkpoint.c
@@ -17,10 +17,11 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <unistd.h>
 
 long lines = 0;
 
-main()
+int main()
 {
   char linebuf[128];
   FILE *in, *out;
@@ -34,7 +35,7 @@ main()
   if (!in || !out)
     {
       fprintf (stderr, "File open failed\n");
-      exit (1);
+      return 1;
     }
 
   for (i = 0; ; i++)
@@ -55,5 +56,5 @@ main()
   fclose (out);
   printf ("Deleting copy.\n");	/* breakpoint 3 */
   unlink (COPY1_TXT);
-  exit (0);			/* breakpoint 4 */
+  return 0;			/* breakpoint 4 */
 }
diff --git a/gdb/testsuite/gdb.base/code_elim2.c b/gdb/testsuite/gdb.base/code_elim2.c
index 64ecc04..875228a 100644
--- a/gdb/testsuite/gdb.base/code_elim2.c
+++ b/gdb/testsuite/gdb.base/code_elim2.c
@@ -20,15 +20,15 @@ int my_global_symbol = 42;
 static int my_static_symbol;
 
 int
-main ()
-{
-  return my_global_func ();
-}
-
-int
 my_global_func ()
 {
   my_static_symbol = my_global_symbol;
   my_global_symbol = my_static_symbol + my_global_symbol;
   return my_global_symbol;
 }
+
+int
+main ()
+{
+  return my_global_func ();
+}
diff --git a/gdb/testsuite/gdb.base/coremaker.c b/gdb/testsuite/gdb.base/coremaker.c
index f05a111..22c1442 100644
--- a/gdb/testsuite/gdb.base/coremaker.c
+++ b/gdb/testsuite/gdb.base/coremaker.c
@@ -25,6 +25,7 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
 
 #ifndef __STDC__
 #define	const	/**/
diff --git a/gdb/testsuite/gdb.base/dprintf-non-stop.c b/gdb/testsuite/gdb.base/dprintf-non-stop.c
index 23c55fa..c7eeca9 100644
--- a/gdb/testsuite/gdb.base/dprintf-non-stop.c
+++ b/gdb/testsuite/gdb.base/dprintf-non-stop.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <unistd.h>
+
 void
 foo ()
 {
diff --git a/gdb/testsuite/gdb.base/dump.c b/gdb/testsuite/gdb.base/dump.c
index bc68778..bdcafbf 100644
--- a/gdb/testsuite/gdb.base/dump.c
+++ b/gdb/testsuite/gdb.base/dump.c
@@ -27,6 +27,7 @@ zero_all ()
   memset ((char *) &intstruct2, 0, sizeof (intstruct2));
 }
 
+int
 main()
 {
   int i;
@@ -43,4 +44,5 @@ main()
   intstruct.g = 12 * 7;
 
   checkpoint1 ();
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
index b8c2698..12a268b 100644
--- a/gdb/testsuite/gdb.base/fileio.c
+++ b/gdb/testsuite/gdb.base/fileio.c
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <sys/wait.h>
 #include <unistd.h>
+#include <time.h>
 /* TESTS :
  * - open(const char *pathname, int flags, mode_t mode);
 1) Attempt to create file that already exists - EEXIST
diff --git a/gdb/testsuite/gdb.base/gcore.c b/gdb/testsuite/gdb.base/gcore.c
index ee826a5..f74516d 100644
--- a/gdb/testsuite/gdb.base/gcore.c
+++ b/gdb/testsuite/gdb.base/gcore.c
@@ -58,6 +58,7 @@ int factorial_func (int value)
   return (value);
 }
 
+int
 main()
 {
   factorial_func (6);
diff --git a/gdb/testsuite/gdb.base/global-var-nested-by-dso.c b/gdb/testsuite/gdb.base/global-var-nested-by-dso.c
index 3b63096..a77b8c2 100644
--- a/gdb/testsuite/gdb.base/global-var-nested-by-dso.c
+++ b/gdb/testsuite/gdb.base/global-var-nested-by-dso.c
@@ -15,6 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+extern void b_main (void);
+extern void c_main (void);
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gdb/testsuite/gdb.base/huge.c b/gdb/testsuite/gdb.base/huge.c
index 27ba04e..57727e9 100644
--- a/gdb/testsuite/gdb.base/huge.c
+++ b/gdb/testsuite/gdb.base/huge.c
@@ -12,6 +12,7 @@
 #endif
 static int a[CRASH_GDB], b[CRASH_GDB];
 
+int
 main()
 {
   memcpy (a, b, sizeof (a));
diff --git a/gdb/testsuite/gdb.base/inferior-died.c b/gdb/testsuite/gdb.base/inferior-died.c
index 5c4c5b2..bb635c0 100644
--- a/gdb/testsuite/gdb.base/inferior-died.c
+++ b/gdb/testsuite/gdb.base/inferior-died.c
@@ -17,6 +17,7 @@
 
 #include <stdlib.h>
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 void function(void)
diff --git a/gdb/testsuite/gdb.base/info-os.c b/gdb/testsuite/gdb.base/info-os.c
index 1a52348..23257d4 100644
--- a/gdb/testsuite/gdb.base/info-os.c
+++ b/gdb/testsuite/gdb.base/info-os.c
@@ -22,6 +22,7 @@
 #include <pthread.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>
+#include <unistd.h>
 
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
diff --git a/gdb/testsuite/gdb.base/multi-forks.c b/gdb/testsuite/gdb.base/multi-forks.c
index c090c57..bbe06c3 100644
--- a/gdb/testsuite/gdb.base/multi-forks.c
+++ b/gdb/testsuite/gdb.base/multi-forks.c
@@ -22,6 +22,7 @@
 
 pid_t pids[4];
 
+int
 main()
 {
   int i;
@@ -32,5 +33,5 @@ main()
   printf ("%d ready\n", getpid ());
   sleep (2);
   printf ("%d done\n", getpid ());
-  exit (0);	/* Set exit breakpoint here.  */
+  return 0;	/* Set exit breakpoint here.  */
 }
diff --git a/gdb/testsuite/gdb.base/pr10179-a.c b/gdb/testsuite/gdb.base/pr10179-a.c
index de5dcde..56bce9d 100644
--- a/gdb/testsuite/gdb.base/pr10179-a.c
+++ b/gdb/testsuite/gdb.base/pr10179-a.c
@@ -12,6 +12,7 @@ bar1()
 {
 }
 
+int
 main()
 {
 }
diff --git a/gdb/testsuite/gdb.base/savedregs.c b/gdb/testsuite/gdb.base/savedregs.c
index b886787..7b93b9b 100644
--- a/gdb/testsuite/gdb.base/savedregs.c
+++ b/gdb/testsuite/gdb.base/savedregs.c
@@ -61,9 +61,11 @@ thrower (void)
 
 }
 
+int
 main ()
 {
   signal (SIGILL, catcher);
   signal (SIGSEGV, catcher);
   thrower ();
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.base/sigaltstack.c b/gdb/testsuite/gdb.base/sigaltstack.c
index 338501b..2ee1b1d 100644
--- a/gdb/testsuite/gdb.base/sigaltstack.c
+++ b/gdb/testsuite/gdb.base/sigaltstack.c
@@ -72,6 +72,7 @@ catcher (int signal)
 }
 
 
+int
 main ()
 {
   /* Set up the altstack.  */
@@ -90,4 +91,5 @@ main ()
   }
   level = MAIN;
   catcher (0);
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.base/siginfo.c b/gdb/testsuite/gdb.base/siginfo.c
index 518083c..041102f 100644
--- a/gdb/testsuite/gdb.base/siginfo.c
+++ b/gdb/testsuite/gdb.base/siginfo.c
@@ -38,6 +38,7 @@ handler (int sig)
 } /* handler */
 #endif
 
+int
 main ()
 {
   /* Set up the signal handler.  */
diff --git a/gdb/testsuite/gdb.base/skip-solib-lib.c b/gdb/testsuite/gdb.base/skip-solib-lib.c
index 792cd01..b2c4d86 100644
--- a/gdb/testsuite/gdb.base/skip-solib-lib.c
+++ b/gdb/testsuite/gdb.base/skip-solib-lib.c
@@ -1,11 +1,11 @@
 /* Simple shared library */
 
-int square(int num)
+int multiply(int a, int b)
 {
-  return multiply(num, num);
+  return a * b;
 }
 
-int multiply(int a, int b)
+int square(int num)
 {
-  return a * b;
+  return multiply(num, num);
 }
diff --git a/gdb/testsuite/gdb.base/solib-weak.c b/gdb/testsuite/gdb.base/solib-weak.c
index f54ea3d..c1ee8d4 100644
--- a/gdb/testsuite/gdb.base/solib-weak.c
+++ b/gdb/testsuite/gdb.base/solib-weak.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+extern void foo (void);
+
 int
 main()
 {
diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c
index 1fb4250..1f45239 100644
--- a/gdb/testsuite/gdb.base/structs.c
+++ b/gdb/testsuite/gdb.base/structs.c
@@ -266,6 +266,7 @@ void Fun18(struct struct18 foo18)
   L18 = foo18; 
 }
 
+void
 zed ()
 {
 
diff --git a/gdb/testsuite/gdb.base/testenv.c b/gdb/testsuite/gdb.base/testenv.c
index ef8035a..3eb9dd4 100644
--- a/gdb/testsuite/gdb.base/testenv.c
+++ b/gdb/testsuite/gdb.base/testenv.c
@@ -22,6 +22,7 @@
     inferior environment list.  */
 
 #include <stdio.h>
+#include <string.h>
 
 int main (int argc, char **argv, char **envp)
 
diff --git a/gdb/testsuite/gdb.base/weaklib1.c b/gdb/testsuite/gdb.base/weaklib1.c
index 95360ac..8782be1 100644
--- a/gdb/testsuite/gdb.base/weaklib1.c
+++ b/gdb/testsuite/gdb.base/weaklib1.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <stdio.h>
+
 void __attribute__((weak))
 bar (void)
 {
diff --git a/gdb/testsuite/gdb.base/weaklib2.c b/gdb/testsuite/gdb.base/weaklib2.c
index ecd8321..b6458c0 100644
--- a/gdb/testsuite/gdb.base/weaklib2.c
+++ b/gdb/testsuite/gdb.base/weaklib2.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <stdio.h>
+
 void bar (void);
 void
 foo (void)
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c
index e9ca92d..a466c54 100644
--- a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c
@@ -19,6 +19,8 @@
 
 #include <stdlib.h>
 #include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
 
 extern int test (void);
 
diff --git a/gdb/testsuite/gdb.mi/mi-console.c b/gdb/testsuite/gdb.mi/mi-console.c
index 0cd2243..5ca046f 100644
--- a/gdb/testsuite/gdb.mi/mi-console.c
+++ b/gdb/testsuite/gdb.mi/mi-console.c
@@ -1,3 +1,5 @@
+#include <unistd.h>
+
 void
 hello ()
 {
diff --git a/gdb/testsuite/gdb.mi/mi-exit-code.c b/gdb/testsuite/gdb.mi/mi-exit-code.c
index df711a6..47bf15c 100644
--- a/gdb/testsuite/gdb.mi/mi-exit-code.c
+++ b/gdb/testsuite/gdb.mi/mi-exit-code.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/>.  */
 
+#include <stdlib.h>
+
 int exit_code = 0;
 
 int
diff --git a/gdb/testsuite/gdb.mi/mi-stack.c b/gdb/testsuite/gdb.mi/mi-stack.c
index 5f2452c..d41f9a0 100644
--- a/gdb/testsuite/gdb.mi/mi-stack.c
+++ b/gdb/testsuite/gdb.mi/mi-stack.c
@@ -32,22 +32,23 @@ int callee4 (void)
   C = A + B;
   return 0;
 }
-callee3 (char *strarg)
+
+void callee3 (char *strarg)
 {
   callee4 ();
 }
 
-callee2 (int intarg, char *strarg)
+void callee2 (int intarg, char *strarg)
 {
   callee3 (strarg);
 }
 
-callee1 (int intarg, char *strarg, double fltarg)
+void callee1 (int intarg, char *strarg, double fltarg)
 {
   callee2 (intarg, strarg);
 }
 
-main ()
+int main ()
 {
   callee1 (2, "A string argument.", 3.5);
   callee1 (2, "A string argument.", 3.5);
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c
index 332f246..c260112 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.c
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c
@@ -9,12 +9,14 @@ void subroutine (int);
 void handler (int);
 void have_a_very_merry_interrupt (void);
 
+int
 main ()
 {
   foo ();   /* Put a breakpoint on foo() and call it to see a dummy frame */
 
 
   have_a_very_merry_interrupt ();
+  return 0;
 }
 
 void
diff --git a/gdb/testsuite/gdb.mi/until.c b/gdb/testsuite/gdb.mi/until.c
index df4a68d..21bdeda 100644
--- a/gdb/testsuite/gdb.mi/until.c
+++ b/gdb/testsuite/gdb.mi/until.c
@@ -1,3 +1,4 @@
+void
 foo (void)
 {
  int i, x, y, z;
@@ -17,6 +18,7 @@ foo (void)
  y = 10;
 }
 
+int
 main ()
 {
   int a = 1;
diff --git a/gdb/testsuite/gdb.mi/watch-nonstop.c b/gdb/testsuite/gdb.mi/watch-nonstop.c
index 3f8a18c..ea4406b 100644
--- a/gdb/testsuite/gdb.mi/watch-nonstop.c
+++ b/gdb/testsuite/gdb.mi/watch-nonstop.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <unistd.h>
+
 int global;
 
 int main ()
diff --git a/gdb/testsuite/gdb.python/py-events.c b/gdb/testsuite/gdb.python/py-events.c
index 17e9f21..2dabdbd 100644
--- a/gdb/testsuite/gdb.python/py-events.c
+++ b/gdb/testsuite/gdb.python/py-events.c
@@ -15,6 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see  <http://www.gnu.org/licenses/>.  */
 
+#include <unistd.h>
+
 extern void do_nothing (void);
 
 int second(){
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.c b/gdb/testsuite/gdb.python/py-finish-breakpoint.c
index 0eda8b9..5c8663a 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.c
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.c
@@ -17,6 +17,7 @@
 
 #include <setjmp.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 /* Defined in py-events-shlib.h.  */
-- 
1.8.4.2

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

* Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
  2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
@ 2014-10-29 16:22   ` Sergio Durigan Junior
  2014-10-29 18:26     ` Andreas Arnez
  2014-11-13 13:15   ` Yao Qi
  1 sibling, 1 reply; 32+ messages in thread
From: Sergio Durigan Junior @ 2014-10-29 16:22 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On Wednesday, October 29 2014, Andreas Arnez wrote:

> Remove literal line numbers from the regexps in so-impl-ld.exp.  Add
> appropriate eye-catchers to solib1.c and refer to those instead.

Hey Andreas,

Thanks a lot for doing this, much appreciated.

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/solib1.c: Add eye-catchers.
> 	* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
> 	literal line numbers.
> ---
>  gdb/testsuite/gdb.base/so-impl-ld.exp | 4 ++--
>  gdb/testsuite/gdb.base/solib1.c       | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
> index 073c3df..03d10a5 100644
> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp
> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
> @@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
>  
>  # Verify that we can step into the second shlib call.
>  #
> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
>      "step into solib call"

Can't you use ${decimal} here, instead of expecting anything?

>  # Verify that we can step within the shlib call.
>  #
> -gdb_test "next" "18\[ \t\]*\}" "step in solib call"
> +gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"

Same here: ${decimal} is made to replace this \[0-9\]+.

>  
>  # Verify that we can step out of the shlib call, and back out into
>  # the caller.
> diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c
> index 2e51750..224a93d 100644
> --- a/gdb/testsuite/gdb.base/solib1.c
> +++ b/gdb/testsuite/gdb.base/solib1.c
> @@ -14,5 +14,5 @@ int  solib_main (arg)
>  #endif
>  #endif
>  {
> -  return arg*arg;
> -}
> +  return arg*arg;		/* HERE */
> +}				/* STEP */
> -- 
> 1.8.4.2

Otherwise, it looks good to me (not an approval).

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

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

* Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
  2014-10-29 16:22   ` Sergio Durigan Junior
@ 2014-10-29 18:26     ` Andreas Arnez
  2014-10-29 22:11       ` Sergio Durigan Junior
  0 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-10-29 18:26 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: gdb-patches

Hi Sergio,

Thanks for reviewing!

On Wed, Oct 29 2014, Sergio Durigan Junior wrote:

> On Wednesday, October 29 2014, Andreas Arnez wrote:
>
> [...]
>> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
>> index 073c3df..03d10a5 100644
>> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp
>> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
>> @@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
>>  
>>  # Verify that we can step into the second shlib call.
>>  #
>> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
>> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
>>      "step into solib call"
>
> Can't you use ${decimal} here, instead of expecting anything?

Certainly.

>
>>  # Verify that we can step within the shlib call.
>>  #
>> -gdb_test "next" "18\[ \t\]*\}" "step in solib call"
>> +gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
>
> Same here: ${decimal} is made to replace this \[0-9\]+.

Good point.  Changed both as suggested.  Also replaced \[0-9\]+ by
${decimal} in the patches for dbx.exp, call-ar-st.exp, call-rt-st.exp,
jump.exp, and shlib-call.exp.  While reviewing again I also noticed that
I introduced an excess ".*" in front of a regexp in foll-exec.exp and
removed it.

Note that some regexps are currently enclosed in a brace-quoted group,
where variables are not substituted -- particularly in the various uses
of gdb_test_sequence in call-ar-st.exp.  There I still use \[0-9\]+, to
avoid larger modifications to the existing regexps.

Here are the changes I performed based on your suggestion:


--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -62,7 +62,7 @@
 
 set stop_line [gdb_get_line_number "-tbreak1-"]
 gdb_test "tbreak $stop_line" \
-    "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line $stop_line.*" \
+    "Temporary breakpoint ${decimal}.*file.*$srcfile, line $stop_line.*" \
     "tbreakpoint at tbreak1"
 
 gdb_test continue \

--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -74,10 +74,10 @@
     "continue to loop_count"
 
 gdb_test_multiple "finish" "finish out from loop count" {
-    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
+    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
 	pass "finish out from loop_count (finish1)"
     }
-    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
+    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
 	pass "finish out from loop_count (line 775)"
     }
 }

--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -289,6 +289,7 @@
 #test_func
 #
 proc test_func { } {
+    global decimal
     global srcfile2
     gdb_test "cont" ".*" "cont 1"
     gdb_test "step" ".*"
@@ -300,7 +301,7 @@
     gdb_test "cont" ".*" "cont 2"
     # This always fails, but it's not clear why. -sts 1999-08-17
     setup_xfail "*-*-*"
-    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:\[0-9\]+\r\n\[0-9\]+\[ \t\]+total = sum\\(list, low, high\\);"
+    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:${decimal}\r\n\${decimal}\[ \t\]+total = sum\\(list, low, high\\);"
 }
 
 # Start with a fresh gdb.

--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -119,7 +119,7 @@
    #
    send_gdb "next 3\n"
    gdb_expect {
-     -re ".*execlp \\(.*$gdb_prompt $"\
+     -re "execlp \\(.*$gdb_prompt $"\
                      {pass "step to exec call"}
      -re "$gdb_prompt $" {fail "step to exec call"}
      timeout         {fail "(timeout) step to exec call"}

--- a/gdb/testsuite/gdb.base/jump.exp
+++ b/gdb/testsuite/gdb.base/jump.exp
@@ -40,7 +40,7 @@
 set bp_on_non_call 0
 set non_call_line [gdb_get_line_number "bp-on-non-call"]
 gdb_test_multiple "break $non_call_line" "break before jump to non-call" {
-    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
+    -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
 	set bp_on_non_call $expect_out(1,string)
 	pass "break before jump to non-call"
     }
@@ -48,7 +48,7 @@
 
 # Can we jump to the statement?  Do we stop there?
 #
-gdb_test "jump $non_call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
+gdb_test "jump $non_call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \
     "jump to non-call"
 
 # Set a breakpoint on the statement that we're about to jump to.
@@ -57,7 +57,7 @@
 set bp_on_call 0
 set call_line [gdb_get_line_number "bp-on-call"]
 gdb_test_multiple "break $call_line" "break before jump to call" {
-    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
+    -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
 	set bp_on_call $expect_out(1,string)
 	pass "break before jump to call"
     }
@@ -66,7 +66,7 @@
 # Can we jump to the statement?  Do we stop there?
 #
 gdb_test "jump $call_line" \
-    "Breakpoint \[0-9\]*, .*${srcfile}:$call_line.*" \
+    "Breakpoint ${decimal}, .*${srcfile}:$call_line.*" \
     "jump to call"
 
 # If we disable the breakpoint at the function call, and then
@@ -75,7 +75,7 @@
 #
 gdb_test_no_output "disable $bp_on_call" "disable breakpoint on call"
 
-gdb_test "jump $call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
+gdb_test "jump $call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \
     "jump to call with disabled breakpoint"
 
 # Verify that GDB responds gracefully to the "jump" command without

--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -111,7 +111,7 @@
     "breakpoint function shr2"
 
 gdb_test "continue" \
-	"Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:.*shr2-return \\*\\/" \
+	"Continuing\\..*Breakpoint ${decimal}, shr2 \\(.*\\) at.*shr2\\.c:${decimal}.*shr2-return \\*\\/" \
 	"run until breakpoint set at a function"
 
 
--- a/gdb/testsuite/gdb.base/so-impl-ld.exp
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -61,12 +61,12 @@
 
 # Verify that we can step into the second shlib call.
 #
-gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
+gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:${decimal}.* HERE .*" \
     "step into solib call"
 
 # Verify that we can step within the shlib call.
 #
-gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
+gdb_test "next" "${decimal}\[ \t\]*\}.* STEP .*" "step in solib call"
 
 # Verify that we can step out of the shlib call, and back out into
 # the caller.

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

* Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
  2014-10-29 18:26     ` Andreas Arnez
@ 2014-10-29 22:11       ` Sergio Durigan Junior
  2014-10-31 20:59         ` Sergio Durigan Junior
  0 siblings, 1 reply; 32+ messages in thread
From: Sergio Durigan Junior @ 2014-10-29 22:11 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On Wednesday, October 29 2014, Andreas Arnez wrote:

> Hi Sergio,
>
> Thanks for reviewing!

Thank you, Andreas!

> On Wed, Oct 29 2014, Sergio Durigan Junior wrote:
>
>> On Wednesday, October 29 2014, Andreas Arnez wrote:
>>
>> [...]
>>> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
>>> index 073c3df..03d10a5 100644
>>> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp
>>> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
>>> @@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
>>>  
>>>  # Verify that we can step into the second shlib call.
>>>  #
>>> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
>>> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
>>>      "step into solib call"
>>
>> Can't you use ${decimal} here, instead of expecting anything?
>
> Certainly.
>
>>
>>>  # Verify that we can step within the shlib call.
>>>  #
>>> -gdb_test "next" "18\[ \t\]*\}" "step in solib call"
>>> +gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
>>
>> Same here: ${decimal} is made to replace this \[0-9\]+.
>
> Good point.  Changed both as suggested.  Also replaced \[0-9\]+ by
> ${decimal} in the patches for dbx.exp, call-ar-st.exp, call-rt-st.exp,
> jump.exp, and shlib-call.exp.  While reviewing again I also noticed that
> I introduced an excess ".*" in front of a regexp in foll-exec.exp and
> removed it.
>
> Note that some regexps are currently enclosed in a brace-quoted group,
> where variables are not substituted -- particularly in the various uses
> of gdb_test_sequence in call-ar-st.exp.  There I still use \[0-9\]+, to
> avoid larger modifications to the existing regexps.

Yeah, that's good.  You patch is a fix needed to run the testcase using
a new GCC, so it's better to leave general cleanups for other patches.

> Here are the changes I performed based on your suggestion:

They seem great now, thanks a lot.

I will review the other patches in the series later.

>
> --- a/gdb/testsuite/gdb.base/call-ar-st.exp
> +++ b/gdb/testsuite/gdb.base/call-ar-st.exp
> @@ -62,7 +62,7 @@
>  
>  set stop_line [gdb_get_line_number "-tbreak1-"]
>  gdb_test "tbreak $stop_line" \
> -    "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line $stop_line.*" \
> +    "Temporary breakpoint ${decimal}.*file.*$srcfile, line $stop_line.*" \
>      "tbreakpoint at tbreak1"
>  
>  gdb_test continue \
>
> --- a/gdb/testsuite/gdb.base/call-rt-st.exp
> +++ b/gdb/testsuite/gdb.base/call-rt-st.exp
> @@ -74,10 +74,10 @@
>      "continue to loop_count"
>  
>  gdb_test_multiple "finish" "finish out from loop count" {
> -    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
> +    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
>  	pass "finish out from loop_count (finish1)"
>      }
> -    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
> +    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
>  	pass "finish out from loop_count (line 775)"
>      }
>  }
>
> --- a/gdb/testsuite/gdb.base/dbx.exp
> +++ b/gdb/testsuite/gdb.base/dbx.exp
> @@ -289,6 +289,7 @@
>  #test_func
>  #
>  proc test_func { } {
> +    global decimal
>      global srcfile2
>      gdb_test "cont" ".*" "cont 1"
>      gdb_test "step" ".*"
> @@ -300,7 +301,7 @@
>      gdb_test "cont" ".*" "cont 2"
>      # This always fails, but it's not clear why. -sts 1999-08-17
>      setup_xfail "*-*-*"
> -    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:\[0-9\]+\r\n\[0-9\]+\[ \t\]+total = sum\\(list, low, high\\);"
> +    gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:${decimal}\r\n\${decimal}\[ \t\]+total = sum\\(list, low, high\\);"
>  }
>  
>  # Start with a fresh gdb.
>
> --- a/gdb/testsuite/gdb.base/foll-exec.exp
> +++ b/gdb/testsuite/gdb.base/foll-exec.exp
> @@ -119,7 +119,7 @@
>     #
>     send_gdb "next 3\n"
>     gdb_expect {
> -     -re ".*execlp \\(.*$gdb_prompt $"\
> +     -re "execlp \\(.*$gdb_prompt $"\
>                       {pass "step to exec call"}
>       -re "$gdb_prompt $" {fail "step to exec call"}
>       timeout         {fail "(timeout) step to exec call"}
>
> --- a/gdb/testsuite/gdb.base/jump.exp
> +++ b/gdb/testsuite/gdb.base/jump.exp
> @@ -40,7 +40,7 @@
>  set bp_on_non_call 0
>  set non_call_line [gdb_get_line_number "bp-on-non-call"]
>  gdb_test_multiple "break $non_call_line" "break before jump to non-call" {
> -    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
> +    -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
>  	set bp_on_non_call $expect_out(1,string)
>  	pass "break before jump to non-call"
>      }
> @@ -48,7 +48,7 @@
>  
>  # Can we jump to the statement?  Do we stop there?
>  #
> -gdb_test "jump $non_call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
> +gdb_test "jump $non_call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \
>      "jump to non-call"
>  
>  # Set a breakpoint on the statement that we're about to jump to.
> @@ -57,7 +57,7 @@
>  set bp_on_call 0
>  set call_line [gdb_get_line_number "bp-on-call"]
>  gdb_test_multiple "break $call_line" "break before jump to call" {
> -    -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
> +    -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
>  	set bp_on_call $expect_out(1,string)
>  	pass "break before jump to call"
>      }
> @@ -66,7 +66,7 @@
>  # Can we jump to the statement?  Do we stop there?
>  #
>  gdb_test "jump $call_line" \
> -    "Breakpoint \[0-9\]*, .*${srcfile}:$call_line.*" \
> +    "Breakpoint ${decimal}, .*${srcfile}:$call_line.*" \
>      "jump to call"
>  
>  # If we disable the breakpoint at the function call, and then
> @@ -75,7 +75,7 @@
>  #
>  gdb_test_no_output "disable $bp_on_call" "disable breakpoint on call"
>  
> -gdb_test "jump $call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
> +gdb_test "jump $call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \
>      "jump to call with disabled breakpoint"
>  
>  # Verify that GDB responds gracefully to the "jump" command without
>
> --- a/gdb/testsuite/gdb.base/shlib-call.exp
> +++ b/gdb/testsuite/gdb.base/shlib-call.exp
> @@ -111,7 +111,7 @@
>      "breakpoint function shr2"
>  
>  gdb_test "continue" \
> -	"Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:.*shr2-return \\*\\/" \
> +	"Continuing\\..*Breakpoint ${decimal}, shr2 \\(.*\\) at.*shr2\\.c:${decimal}.*shr2-return \\*\\/" \
>  	"run until breakpoint set at a function"
>  
>  
> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp
> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
> @@ -61,12 +61,12 @@
>  
>  # Verify that we can step into the second shlib call.
>  #
> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:${decimal}.* HERE .*" \
>      "step into solib call"
>  
>  # Verify that we can step within the shlib call.
>  #
> -gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
> +gdb_test "next" "${decimal}\[ \t\]*\}.* STEP .*" "step in solib call"
>  
>  # Verify that we can step out of the shlib call, and back out into
>  # the caller.

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

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

* Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
  2014-10-29 22:11       ` Sergio Durigan Junior
@ 2014-10-31 20:59         ` Sergio Durigan Junior
  0 siblings, 0 replies; 32+ messages in thread
From: Sergio Durigan Junior @ 2014-10-31 20:59 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On Wednesday, October 29 2014, I wrote:

>> Here are the changes I performed based on your suggestion:
>
> They seem great now, thanks a lot.
>
> I will review the other patches in the series later.

FWIW, I have skimmed through the other patches, and have not seen
anything wrong.  IMO this patch series should go in.

Thanks,

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

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

* Re: [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case
  2014-10-29 16:04 ` [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case Andreas Arnez
@ 2014-11-12 12:33   ` Pedro Alves
  2014-11-12 15:05     ` Andreas Arnez
  0 siblings, 1 reply; 32+ messages in thread
From: Pedro Alves @ 2014-11-12 12:33 UTC (permalink / raw)
  To: Andreas Arnez, gdb-patches

On 10/29/2014 04:00 PM, Andreas Arnez wrote:
> Remove old-style function header variants from list0.h and list1.c.
> Fill the removed lines with comments or empty lines, such that the
> line numbering is undisturbed.

Why is it important that the line numbering is undisturbed?

Thanks,
Pedro Alves

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

* Re: [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case
  2014-11-12 12:33   ` Pedro Alves
@ 2014-11-12 15:05     ` Andreas Arnez
  2014-11-12 15:18       ` Pedro Alves
  0 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-11-12 15:05 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Wed, Nov 12 2014, Pedro Alves wrote:

> On 10/29/2014 04:00 PM, Andreas Arnez wrote:
>> Remove old-style function header variants from list0.h and list1.c.
>> Fill the removed lines with comments or empty lines, such that the
>> line numbering is undisturbed.
>
> Why is it important that the line numbering is undisturbed?

Changes to the line numbering would require heavy adjustments to
list.exp.  Many line numbers are hard-coded, as well as a fair amount of
knowledge about the source code in and around certain lines.  Thus the
dependency on the line numbering can not be eliminated so easily here,
and it may not even be a useful goal for a "list" test case.  Another
option might be to adjust the literal line numbers in list.exp, but even
that is not as straightforward as it may seem, since the test case
expects certain source lines to be exactly n lines apart.

I'll add the above explanation to the commit message, OK?

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

* Re: [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case
  2014-11-12 15:05     ` Andreas Arnez
@ 2014-11-12 15:18       ` Pedro Alves
  0 siblings, 0 replies; 32+ messages in thread
From: Pedro Alves @ 2014-11-12 15:18 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On 11/12/2014 03:05 PM, Andreas Arnez wrote:
> On Wed, Nov 12 2014, Pedro Alves wrote:
> 
>> On 10/29/2014 04:00 PM, Andreas Arnez wrote:
>>> Remove old-style function header variants from list0.h and list1.c.
>>> Fill the removed lines with comments or empty lines, such that the
>>> line numbering is undisturbed.
>>
>> Why is it important that the line numbering is undisturbed?
> 
> Changes to the line numbering would require heavy adjustments to
> list.exp.  Many line numbers are hard-coded, as well as a fair amount of
> knowledge about the source code in and around certain lines.  Thus the
> dependency on the line numbering can not be eliminated so easily here,
> and it may not even be a useful goal for a "list" test case.  Another
> option might be to adjust the literal line numbers in list.exp, but even
> that is not as straightforward as it may seem, since the test case
> expects certain source lines to be exactly n lines apart.
> 
> I'll add the above explanation to the commit message, OK?

OK.

Thanks,
Pedro Alves

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

* Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
  2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
  2014-10-29 16:22   ` Sergio Durigan Junior
@ 2014-11-13 13:15   ` Yao Qi
  1 sibling, 0 replies; 32+ messages in thread
From: Yao Qi @ 2014-11-13 13:15 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/solib1.c: Add eye-catchers.
> 	* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
> 	literal line numbers.

It looks good to me.

-- 
Yao (齐尧)

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

* Re: [PATCH 02/16] Eliminate literal line numbers in dbx.exp
  2014-10-29 16:01 ` [PATCH 02/16] Eliminate literal line numbers in dbx.exp Andreas Arnez
@ 2014-11-13 13:18   ` Yao Qi
  2014-11-13 14:16     ` Andreas Arnez
  0 siblings, 1 reply; 32+ messages in thread
From: Yao Qi @ 2014-11-13 13:18 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/average.c: Add eye-catchers.
> 	* gdb.base/sum.c: Likewise.
> 	* gdb.base/dbx.exp: Use eye-catchers to determine line numbers for
> 	regexps dynamically.

Please mention the affected functions and procedures in the changelog
entry.  It is OK with this fixed.

-- 
Yao (齐尧)

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

* Re: [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp
  2014-10-29 16:01 ` [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp Andreas Arnez
@ 2014-11-13 13:33   ` Yao Qi
  0 siblings, 0 replies; 32+ messages in thread
From: Yao Qi @ 2014-11-13 13:33 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/call-ar-st.c: Add eye-catchers.
> 	* gdb.base/call-ar-st.exp: Refer to eye-catchers instead of
> 	literal line numbers.

The comments to patch 02/16 still applies here.

> -#go -until 1216
> -gdb_test "tbreak 1216" \
> -"Temporary breakpoint.*file.*$srcfile, line 1216.*" \
> -"tbreakpoint line 1216"
> +set stop_line [gdb_get_line_number "-tbreak2-"]
> +gdb_test "tbreak $stop_line" \
> +"Temporary breakpoint.*file.*$srcfile, line $stop_line.*" \
> +"tbreakpoint at tbreak2"
>  
> -if ![gdb_skip_stdio_test "continue to 1216"] {
> -    gdb_test_sequence "continue" "continue to 1216" {
> +if ![gdb_skip_stdio_test "continue to tbreak2"] {
> +    gdb_test_sequence "continue" "continue to tbreak2" {
>  	"\[ \t\r\n\]+array_c :"
>  	"\[ \t\r\n\]+========="
>  	"\[ \t\r\n\]+\[ \t\r\n\]+Z"
>  	"\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
>  	"\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
>  	"\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa"
> -	"\[ \t\r\n\]+main.*at.*:1216"
> -	"\[ \t\r\n\]+1216.*print_double_array\\(double_array\\)"
> +	"\[ \t\r\n\]+main.*at.*:\[0-9\]+"
> +	"\[ \t\r\n\]+\[0-9\]+.*print_double_array\\(double_array\\)"
>      }

How about using $stop_line instead of [0-9] here?

>  } else {
>      gdb_test "continue" ".*" ""
> @@ -128,14 +128,14 @@ if ![gdb_skip_stdio_test "continue to 1216"] {
>  #  }
>  
>  #set timeout $oldtimeout
> -#go -until 1220
> -gdb_test "tbreak 1220" \
> -	"Temporary breakpoint.* file .*$srcfile, line 1220.*" \
> -	"tbreakpoint line 1220"
> -
> -if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
> -    ![gdb_skip_stdio_test "continuing to breakpoint 1220"] } {
> -    gdb_test_sequence "continue" "continuing to breakpoint 1220" {
> +set stop_line [gdb_get_line_number "-tbreak3-"]
> +gdb_test "tbreak $stop_line" \
> +	"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
> +	"tbreakpoint at tbreak3"
> +
> +if {![gdb_skip_float_test "continuing to tbreak3"] && \
> +    ![gdb_skip_stdio_test "continuing to tbreak3"] } {
> +    gdb_test_sequence "continue" "continuing to tbreak3" {
>  	"Continuing\\."
>  	"\[ \t\r\n\]+array_d :"
>  	"\[ \t\r\n\]+========="
> @@ -145,21 +145,23 @@ if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
>  	"array_f :"
>  	"student id :\[\t \]+.*YELLOW"
>  	"array_i :"
> -	"main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
> +	"main \\(\\) at .*call-ar-st.c:\[0-9\]+\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."

Likewise.

> @@ -177,21 +179,21 @@ if {![gdb_skip_float_test "print print_double_array(array_d)"] && \
>      }
>  }
>  
> -#go -until 1236
> -gdb_test "tbreak 1236" \
> -"Temporary breakpoint.* file .*$srcfile, line 1236.*" \
> -"tbreakpoint line 1236"
> +set stop_line [gdb_get_line_number "-tbreak4-"]
> +gdb_test "tbreak $stop_line" \
> +"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
> +"tbreakpoint at tbreak4"
>  
> -if {![gdb_skip_float_test "continuing to 1236"] && \
> -    ![gdb_skip_stdio_test "continuing to 1236"] } {
> -    gdb_test_sequence "continue" "continuing to 1236" {
> +if {![gdb_skip_float_test "continuing to tbreak4"] && \
> +    ![gdb_skip_stdio_test "continuing to tbreak4"] } {
> +    gdb_test_sequence "continue" "continuing to tbreak4" {
>  	"Continuing\\..*array_c"
>  	"array_f"
>  	"\[ \t\r\n\]+array_d :"
>  	"\[ \t\r\n\]+========="
>  	"\[ \t\r\n\]+0.000000"
>  	"\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"
> -	"\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
> +	"\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:\[0-9\]+.*printf\\(.BYE BYE FOR NOW.n.\\)."

Likewise.

>      }
>  } else {
>      gdb_test "continue" ".*" ""
> @@ -207,10 +209,11 @@ if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
>  }
>  
>  #step over
> -if ![gdb_skip_stdio_test "next to 1237"] {
> +set stop_line [gdb_get_line_number "-next2-"]
> +if ![gdb_skip_stdio_test "next to next2"] {
>      gdb_test "next" \
> -	"BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*" \
> -	"next to 1237"
> +	"BYE BYE FOR NOW.*$stop_line.*printf\\(.VERY GREEN GRASS.n.\\);.*" \
> +	"next to next2"
>  } else {
>      gdb_test "next" ".*" ""
>  }
> @@ -223,14 +226,14 @@ if ![gdb_skip_stdio_test "print print_array_rep(...)"] {
>  	"print print_array_rep(*list1, *list2, *list3)"
>  }
>  
> -#go -until 1241
> -gdb_test "tbreak 1241" \
> -    "Temporary breakpoint..* file .*$srcfile, line 1241.*" \
> -    "tbreakpoint line 1241"
> +set stop_line [gdb_get_line_number "-tbreak5-"]
> +gdb_test "tbreak $stop_line" \
> +    "Temporary breakpoint..* file .*$srcfile, line $stop_line.*" \
> +    "tbreakpoint at tbreak5"
>  
>  gdb_test "continue" \
> -    "main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \
> -    "continue to 1241"
> +    "main \\(\\) at .*$srcfile:$stop_line\r\n$stop_line\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \
> +    "continue to tbreak5"
>  
>  
>  # Run into sum_array_print, and verify that the arguments were passed
> @@ -242,11 +245,11 @@ gdb_test "continue" \
>  # may itself be a bug, but it's not the one we're trying to catch
>  # here.  I've added something to step-test.exp for this.
>  gdb_test "break sum_array_print" \
> -	".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
> +	".*Breakpoint ${decimal}: file .*$srcfile, line.*" \
>  	"set breakpoint in sum_array_print"

The change like this is good, but is not related to your patch.

>  gdb_test_no_output "set print frame-arguments all"
>  gdb_test "continue" \
> -	".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
> +    ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*$srcfile:${decimal}\[ \t\n\r\]+${decimal}.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
>  	"check args of sum_array_print"
>  

Use $stop_line instead of ${decimal}.

> @@ -359,24 +363,24 @@ if { [istarget "hppa*-*-hpux*"] } {
>      # guo 990621
>      #
>      gdb_test "step" \
> -	"print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);" \
> +	"print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);" \
>  	"step into print_long_arg_list"
>  } else {
>  
>      # We can't just assume that a "step" will get us into
>      # print_long_arg_list here,either.
>      gdb_test "tbreak print_long_arg_list" \
> -	"Temporary breakpoint .* file .*call-ar-st.c, line .*" \
> +	"Temporary breakpoint .* file .*$srcfile, line .*" \

Again, the change is good, but isn't related to your patch.  It should
be moved to a separate patch.

-- 
Yao (齐尧)

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

* Re: [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp
  2014-10-29 16:01 ` [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp Andreas Arnez
@ 2014-11-13 13:36   ` Yao Qi
  0 siblings, 0 replies; 32+ messages in thread
From: Yao Qi @ 2014-11-13 13:36 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/call-rt-st.c: Add eye-catchers.
> 	* gdb.base/call-rt-st.exp: Refer to eye-catchers instead of
> 	literal line numbers.

Please mention the changed functions in call-rt-st.c file.  Otherwise,
it is OK.

-- 
Yao (齐尧)

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

* Re: [PATCH 05/16] Eliminate literal line numbers in ending-run.exp
  2014-10-29 16:01 ` [PATCH 05/16] Eliminate literal line numbers in ending-run.exp Andreas Arnez
@ 2014-11-13 13:44   ` Yao Qi
  0 siblings, 0 replies; 32+ messages in thread
From: Yao Qi @ 2014-11-13 13:44 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> @@ -21,7 +21,9 @@
>  
>  # ending-run.exp -- Expect script to test ending a test run in gdb
>  
> -if { [prepare_for_testing ending-run.exp ending-run] } {
> +standard_testfile
> +
> +if { [prepare_for_testing ${testfile}.exp $testfile] } {
>      return -1
>  }
>  remote_exec build "rm -f core"

This change should be moved out of this patch because it isn't related.
The rest of the patch is good to me.

-- 
Yao (齐尧)

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

* Re: [PATCH 00/16]  GDB testsuite cleanup, fix warnings with -std=gnu11
  2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
                   ` (15 preceding siblings ...)
  2014-10-29 16:04 ` [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case Andreas Arnez
@ 2014-11-13 14:06 ` Yao Qi
  16 siblings, 0 replies; 32+ messages in thread
From: Yao Qi @ 2014-11-13 14:06 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> But while fixing these, I noticed that many test cases still rely on
> literal line numbers and thus would fail after fixing the warnings.
> Thus the first part of the patch set deals with eliminating literal
> line numbers from various test cases.

Ur, looks these patches were approved and pushed in.  I withdraw my
review comments.

-- 
Yao (齐尧)

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

* Re: [PATCH 02/16] Eliminate literal line numbers in dbx.exp
  2014-11-13 13:18   ` Yao Qi
@ 2014-11-13 14:16     ` Andreas Arnez
  2014-11-14  0:26       ` Yao Qi
  0 siblings, 1 reply; 32+ messages in thread
From: Andreas Arnez @ 2014-11-13 14:16 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches, Andreas Krebbel

On Thu, Nov 13 2014, Yao Qi wrote:

> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
>> gdb/testsuite/ChangeLog:
>>
>> 	* gdb.base/average.c: Add eye-catchers.
>> 	* gdb.base/sum.c: Likewise.
>> 	* gdb.base/dbx.exp: Use eye-catchers to determine line numbers for
>> 	regexps dynamically.
>
> Please mention the affected functions and procedures in the changelog
> entry.  It is OK with this fixed.

Hm, after yesterday's OK from Pedro I asked Andreas Krebbel to push the
series, and he did so earlier today.  I can provide a patch for the
ChangeLog if needed, but this will not help with the existing commit
messages of course.

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

* Re: [PATCH 02/16] Eliminate literal line numbers in dbx.exp
  2014-11-13 14:16     ` Andreas Arnez
@ 2014-11-14  0:26       ` Yao Qi
  0 siblings, 0 replies; 32+ messages in thread
From: Yao Qi @ 2014-11-14  0:26 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches, Andreas Krebbel

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> Hm, after yesterday's OK from Pedro I asked Andreas Krebbel to push the
> series, and he did so earlier today.  I can provide a patch for the
> ChangeLog if needed, but this will not help with the existing commit
> messages of course.

The changelog entries are incomplete but correct, so let us leave them there.

-- 
Yao (齐尧)

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

end of thread, other threads:[~2014-11-14  0:26 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
2014-10-29 16:22   ` Sergio Durigan Junior
2014-10-29 18:26     ` Andreas Arnez
2014-10-29 22:11       ` Sergio Durigan Junior
2014-10-31 20:59         ` Sergio Durigan Junior
2014-11-13 13:15   ` Yao Qi
2014-10-29 16:01 ` [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp Andreas Arnez
2014-11-13 13:33   ` Yao Qi
2014-10-29 16:01 ` [PATCH 05/16] Eliminate literal line numbers in ending-run.exp Andreas Arnez
2014-11-13 13:44   ` Yao Qi
2014-10-29 16:01 ` [PATCH 02/16] Eliminate literal line numbers in dbx.exp Andreas Arnez
2014-11-13 13:18   ` Yao Qi
2014-11-13 14:16     ` Andreas Arnez
2014-11-14  0:26       ` Yao Qi
2014-10-29 16:01 ` [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp Andreas Arnez
2014-11-13 13:36   ` Yao Qi
2014-10-29 16:02 ` [PATCH 09/16] Eliminate literal line numbers in mi-console.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 08/16] Eliminate literal line numbers in shlib-call.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 07/16] Eliminate literal line numbers in jump.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 06/16] Eliminate literal line numbers in foll-exec.exp Andreas Arnez
2014-10-29 16:03 ` [PATCH 11/16] Drop non-prototype C function header variants: solib1.c Andreas Arnez
2014-10-29 16:03 ` [PATCH 10/16] 'callfuncs' test case: Fix typo in prototyped version Andreas Arnez
2014-10-29 16:03 ` [PATCH 12/16] Drop non-prototype C function header variants: 'break' test case Andreas Arnez
2014-10-29 16:04 ` [PATCH 14/16] Drop non-prototype C function header variants: 'sepdebug' " Andreas Arnez
2014-10-29 16:04 ` [PATCH 16/16] GDB testsuite: Fix warnings with -std=gnu11 Andreas Arnez
2014-10-29 16:04 ` [PATCH 15/16] GDB testsuite: drop non-prototype C function header variants Andreas Arnez
2014-10-29 16:04 ` [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case Andreas Arnez
2014-11-12 12:33   ` Pedro Alves
2014-11-12 15:05     ` Andreas Arnez
2014-11-12 15:18       ` Pedro Alves
2014-11-13 14:06 ` [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Yao Qi

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).