public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 14/16] Drop non-prototype C function header variants: 'sepdebug' test case
Date: Wed, 29 Oct 2014 16:04:00 -0000	[thread overview]
Message-ID: <1414598446-13831-14-git-send-email-arnez@linux.vnet.ibm.com> (raw)
In-Reply-To: <1414597859-12523-1-git-send-email-arnez@linux.vnet.ibm.com>

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

  parent reply	other threads:[~2014-10-29 16:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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 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 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 07/16] Eliminate literal line numbers in jump.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 09/16] Eliminate literal line numbers in mi-console.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:02 ` [PATCH 08/16] Eliminate literal line numbers in shlib-call.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 12/16] Drop non-prototype C function header variants: 'break' test case Andreas Arnez
2014-10-29 16:03 ` [PATCH 10/16] 'callfuncs' test case: Fix typo in prototyped version Andreas Arnez
2014-10-29 16:04 ` [PATCH 16/16] GDB testsuite: Fix warnings with -std=gnu11 Andreas Arnez
2014-10-29 16:04 ` Andreas Arnez [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414598446-13831-14-git-send-email-arnez@linux.vnet.ibm.com \
    --to=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).