aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2014-05-20 09:48:43 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2014-05-23 09:09:40 +0200
commite9089e05b6a1a89ba6b8f3123f9d76bf066e3db7 (patch)
tree233be60dffc1419a54ca76d4bf87e5fc18962508
parent67b5c0c1a4336318f23f65b8fa98a08b569c5c39 (diff)
downloadgdb-e9089e05b6a1a89ba6b8f3123f9d76bf066e3db7.zip
gdb-e9089e05b6a1a89ba6b8f3123f9d76bf066e3db7.tar.gz
gdb-e9089e05b6a1a89ba6b8f3123f9d76bf066e3db7.tar.bz2
test, gcore: move capture_command_output into lib/gdb.exp
Allow gcore's capture_command_output function to be used by other tests. testsuite/ * gdb.base/gcore.exp (capture_command_output): Move ... * lib/gdb.exp (capture_command_output): ... here.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp13
-rw-r--r--gdb/testsuite/lib/gdb.exp14
3 files changed, 19 insertions, 13 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fdbae25..4c74ed1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
+ * gdb.base/gcore.exp (capture_command_output): Move ...
+ * lib/gdb.exp (capture_command_output): ... here.
+
+2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
+
* gdb.btrace/data.exp: Test memory access during btrace replay.
2014-05-22 Simon Marchi <simon.marchi@ericsson.com>
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index 99743a0..c28a9b3 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -41,19 +41,6 @@ if { ! [ runto_main ] } then {
return -1
}
-proc capture_command_output { command prefix } {
- global gdb_prompt
- global expect_out
-
- set output_string ""
- gdb_test_multiple "$command" "capture_command_output for $command" {
- -re "${command}\[\r\n\]+${prefix}(.*)\[\r\n\]+$gdb_prompt $" {
- set output_string $expect_out(1,string)
- }
- }
- return $output_string
-}
-
gdb_test "break terminal_func" "Breakpoint .* at .*${srcfile}, line .*" \
"set breakpoint at terminal_func"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index c22162d..30463a9 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4773,5 +4773,19 @@ proc parse_args { argset } {
# number of items expected to be passed into the procedure...
}
+# Capture the output of COMMAND in a string ignoring PREFIX; return that string.
+proc capture_command_output { command prefix } {
+ global gdb_prompt
+ global expect_out
+
+ set output_string ""
+ gdb_test_multiple "$command" "capture_command_output for $command" {
+ -re "${command}\[\r\n\]+${prefix}(.*)\[\r\n\]+$gdb_prompt $" {
+ set output_string $expect_out(1,string)
+ }
+ }
+ return $output_string
+}
+
# Always load compatibility stuff.
load_lib future.exp