aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/auxv.exp15
-rw-r--r--gdb/testsuite/gdb.base/gcore-buffer-overflow.exp15
-rw-r--r--gdb/testsuite/gdb.base/gcore-relro.exp13
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp20
4 files changed, 6 insertions, 57 deletions
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index 16f12c7..0c7bac4 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -127,20 +127,7 @@ proc fetch_auxv {test} {
set live_data [fetch_auxv "info auxv on live process"]
# Now try gcore.
-set gcore_works 0
-set escapedfilename [string_to_regexp $gcorefile]
-gdb_test_multiple "gcore $gcorefile" "gcore" {
- -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
- pass "gcore"
- set gcore_works 1
- }
- -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
- unsupported "gcore"
- }
- -re "Undefined command: .*\[\r\n\]+$gdb_prompt $" {
- unsupported "gcore"
- }
-}
+set gcore_works [gdb_gcore_cmd "$gcorefile" "gcore"]
# Let the program continue and die.
gdb_test continue ".*Program received signal.*"
diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
index 7736bb8..13c3e75 100644
--- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
+++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
@@ -55,17 +55,4 @@ if { ! [ runto_main ] } then {
return -1
}
-set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore-buffer-overflow.test]
-
-set test "save a corefile"
-gdb_test_multiple "gcore ${objdir}/${subdir}/gcore-buffer-overflow.test" $test {
- -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
- pass $test
- }
- -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
- unsupported $test
- }
- eof {
- fail $test
- }
-}
+gdb_gcore_cmd "${objdir}/${subdir}/gcore-buffer-overflow.test" "save a corefile"
diff --git a/gdb/testsuite/gdb.base/gcore-relro.exp b/gdb/testsuite/gdb.base/gcore-relro.exp
index 5b8d6c7..b35126d 100644
--- a/gdb/testsuite/gdb.base/gcore-relro.exp
+++ b/gdb/testsuite/gdb.base/gcore-relro.exp
@@ -55,17 +55,8 @@ if ![runto lib] {
return -1
}
-set escapedfilename [string_to_regexp ${gcorefile}]
-
-set test "save a corefile"
-gdb_test_multiple "gcore ${gcorefile}" $test {
- -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
- pass $test
- }
- -re "Can't create a corefile\r\n$gdb_prompt $" {
- unsupported $test
- return -1
- }
+if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
+ return -1
}
# Now restart gdb and load the corefile.
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index faa8fa7..a6db867 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -85,24 +85,8 @@ set pre_corefile_local_array \
set pre_corefile_extern_array \
[capture_command_output "print extern_array" "$print_prefix"]
-set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test]
-
-set core_supported 0
-gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \
- "save a corefile" \
-{
- -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
- pass "save a corefile"
- global core_supported
- set core_supported 1
- }
- -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
- unsupported "save a corefile"
- global core_supported
- set core_supported 0
- }
-}
-
+set core_supported [gdb_gcore_cmd "${objdir}/${subdir}/gcore.test" \
+ "save a corefile"]
if {!$core_supported} {
return -1
}