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.
+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.
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"
# 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