aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-11-06 15:21:24 +0000
committerTom Tromey <tromey@redhat.com>2012-11-06 15:21:24 +0000
commit2d338fa948bca672c696ce23da905bddbbc374b4 (patch)
tree4c68d87ba638c046c890a6557c436f051f995edc /gdb/testsuite/gdb.base
parent234fa27ce099ad5ef763209f8818fc2bf499f26c (diff)
downloadbinutils-2d338fa948bca672c696ce23da905bddbbc374b4.zip
binutils-2d338fa948bca672c696ce23da905bddbbc374b4.tar.gz
binutils-2d338fa948bca672c696ce23da905bddbbc374b4.tar.bz2
* gdb.threads/gcore-thread.exp: Use gdb_gcore_cmd.
* gdb.python/py-strfns.exp (test_strfns_core_file): Use gdb_gcore_cmd. * gdb.cell/gcore.exp: Use gdb_gcore_cmd. * gdb.base/gcore.exp: Use gdb_gcore_cmd. * gdb.base/gcore-relro.exp: Use gdb_gcore_cmd. * gdb.base/gcore-buffer-overflow.exp: Use gdb_gcore_cmd. * gdb.base/auxv.exp: Use gdb_gcore_cmd. * gdb.arch/vsx-regs.exp: Use gdb_gcore_cmd. * gdb.arch/system-gcore.exp: Use gdb_gcore_cmd. * gdb.arch/pa-nullify.exp (test_core_bt): Use gdb_gcore_cmd. * lib/gdb.exp (gdb_gcore_cmd): New proc.
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
}