This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Move foreach_with_prefix to lib/gdb.exp


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

commit f1da4b11eef6dba04a1cfa579c6ba313718105b8
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Jan 25 12:00:18 2016 +0000

    Move foreach_with_prefix to lib/gdb.exp
    
    gdb/testsuite/ChangeLog:
    2016-01-25  Pedro Alves  <palves@redhat.com>
    
    	* gdb.base/step-sw-breakpoint-adjust-pc.exp (foreach_with_prefix):
    	Delete, moved to lib/gdb.exp.
    	* gdb.threads/forking-threads-plus-breakpoint.exp
    	(foreach_with_prefix): Likewise.
    	* gdb.threads/process-dies-while-handling-bp.exp
    	(foreach_with_prefix): Likewise.
    	* lib/gdb.exp (foreach_with_prefix): New procedure.

Diff:
---
 gdb/testsuite/ChangeLog                                      | 10 ++++++++++
 gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp      | 12 ------------
 .../gdb.threads/forking-threads-plus-breakpoint.exp          | 12 ------------
 gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp | 12 ------------
 gdb/testsuite/lib/gdb.exp                                    | 12 ++++++++++++
 5 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8fe983e..aea573d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2016-01-25  Pedro Alves  <palves@redhat.com>
+
+	* gdb.base/step-sw-breakpoint-adjust-pc.exp (foreach_with_prefix):
+	Delete, moved to lib/gdb.exp.
+	* gdb.threads/forking-threads-plus-breakpoint.exp
+	(foreach_with_prefix): Likewise.
+	* gdb.threads/process-dies-while-handling-bp.exp
+	(foreach_with_prefix): Likewise.
+	* lib/gdb.exp (foreach_with_prefix): New procedure.
+
 2016-01-25  Marcin KoÅ?cielnicki  <koriakin@0x04.net>
 
 	* gdb.trace/backtrace.exp: Bump stack collection fudge factor.
diff --git a/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp b/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp
index 378d71c..28ffbe7 100644
--- a/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp
+++ b/gdb/testsuite/gdb.base/step-sw-breakpoint-adjust-pc.exp
@@ -73,18 +73,6 @@ proc test {non_stop displaced always_inserted} {
     }
 }
 
-# Wrapper for foreach that calls with_test_prefix on each iteration,
-# including the iterator's current value in the prefix.
-
-proc foreach_with_prefix {var list body} {
-    upvar 1 $var myvar
-    foreach myvar $list {
-	with_test_prefix "$var=$myvar" {
-	    uplevel 1 $body
-	}
-    }
-}
-
 foreach_with_prefix non_stop { "off" "on" } {
     foreach_with_prefix displaced_step { "off" "on" } {
 	foreach_with_prefix always_inserted { "off" "on" } {
diff --git a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
index d204125..b5f7c21 100644
--- a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
+++ b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
@@ -92,18 +92,6 @@ proc do_test { cond_bp_target detach_on_fork } {
 	"only inferior 1 left"
 }
 
-# Wrapper for foreach that calls with_test_prefix on each iteration,
-# including the iterator's current value in the prefix.
-
-proc foreach_with_prefix {var list body} {
-    upvar 1 $var myvar
-    foreach myvar $list {
-	with_test_prefix "$var=$myvar" {
-	    uplevel 1 $body
-	}
-    }
-}
-
 foreach_with_prefix cond_bp_target {1 0} {
     foreach_with_prefix detach_on_fork {"on" "off"} {
 	do_test $cond_bp_target $detach_on_fork
diff --git a/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp b/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
index 8605a38..2db31af 100644
--- a/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
+++ b/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
@@ -128,18 +128,6 @@ proc do_test { non_stop cond_bp_target } {
 	"no threads left"
 }
 
-# Wrapper for foreach that calls with_test_prefix on each iteration,
-# including the iterator's current value in the prefix.
-
-proc foreach_with_prefix {var list body} {
-    upvar 1 $var myvar
-    foreach myvar $list {
-	with_test_prefix "$var=$myvar" {
-	    uplevel 1 $body
-	}
-    }
-}
-
 foreach_with_prefix non_stop {"on" "off"} {
     foreach_with_prefix cond_bp_target {1 0} {
 	do_test $non_stop $cond_bp_target
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index e6fe62c..66821eb 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1906,6 +1906,18 @@ proc with_test_prefix { prefix body } {
   }
 }
 
+# Wrapper for foreach that calls with_test_prefix on each iteration,
+# including the iterator's name and current value in the prefix.
+
+proc foreach_with_prefix {var list body} {
+    upvar 1 $var myvar
+    foreach myvar $list {
+	with_test_prefix "$var=$myvar" {
+	    uplevel 1 $body
+	}
+    }
+}
+
 # Run BODY in the context of the caller.  After BODY is run, the variables
 # listed in VARS will be reset to the values they had before BODY was run.
 #


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