aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-05-06 22:11:16 +0000
committerDoug Evans <dje@google.com>2013-05-06 22:11:16 +0000
commitfac51dd9e59b66e8427ed00c417cb1bf5b0679ac (patch)
tree6b85447df16ad28da7855e5337c2ed765e9de8dd /gdb/testsuite/gdb.arch
parentc2a96e8cafeeda6132399e9ea94dafad6366ccc5 (diff)
downloadgdb-fac51dd9e59b66e8427ed00c417cb1bf5b0679ac.zip
gdb-fac51dd9e59b66e8427ed00c417cb1bf5b0679ac.tar.gz
gdb-fac51dd9e59b66e8427ed00c417cb1bf5b0679ac.tar.bz2
* lib/gdb.exp (gdb_core_cmd): New function.
* gdb.arch/system-gcore.exp: Use it. * gdb.arch/vsx-regs.exp: Ditto. * gdb.base/gcore.exp: Ditto. * gdb.threads/gcore-thread.exp: Ditto.
Diffstat (limited to 'gdb/testsuite/gdb.arch')
-rw-r--r--gdb/testsuite/gdb.arch/system-gcore.exp32
-rw-r--r--gdb/testsuite/gdb.arch/vsx-regs.exp33
2 files changed, 12 insertions, 53 deletions
diff --git a/gdb/testsuite/gdb.arch/system-gcore.exp b/gdb/testsuite/gdb.arch/system-gcore.exp
index 08551e0..e7586da 100644
--- a/gdb/testsuite/gdb.arch/system-gcore.exp
+++ b/gdb/testsuite/gdb.arch/system-gcore.exp
@@ -95,8 +95,8 @@ set pre_corefile_local_array \
set pre_corefile_extern_array \
[capture_command_output "print extern_array" "$print_prefix"]
-set core_supported [gdb_gcore_cmd "${objdir}/${subdir}/gcore.test" \
- "save a corefile"]
+set corefile "${objdir}/${subdir}/gcore.test"
+set core_supported [gdb_gcore_cmd $corefile "save a corefile"]
if {!$core_supported} {
return -1
@@ -108,30 +108,10 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-send_gdb "core ${objdir}/${subdir}/gcore.test\n"
-gdb_expect {
- -re ".* is not a core dump:.*$gdb_prompt $" {
- fail "re-load generated corefile (bad file format)"
- # No use proceeding from here.
- return;
- }
- -re ".*: No such file or directory.*$gdb_prompt $" {
- fail "re-load generated corefile (file not found)"
- # No use proceeding from here.
- return;
- }
- -re ".*Couldn't find .* registers in core file.*$gdb_prompt $" {
- fail "re-load generated corefile (incomplete note section)"
- }
- -re "Core was generated by .*$gdb_prompt $" {
- pass "re-load generated corefile"
- }
- -re ".*$gdb_prompt $" {
- fail "re-load generated corefile"
- }
- timeout {
- fail "re-load generated corefile (timeout)"
- }
+set core_reloaded [gdb_core_cmd $corefile "re-load generated corefile"]
+if { $core_reloaded == -1 } {
+ # No use proceeding from here.
+ return
}
gdb_test_sequence "where" "where in corefile" {
diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp
index 7b27ac7..0ab111c 100644
--- a/gdb/testsuite/gdb.arch/vsx-regs.exp
+++ b/gdb/testsuite/gdb.arch/vsx-regs.exp
@@ -128,8 +128,8 @@ for {set i 0} {$i < 32} {incr i 1} {
# later when loading the core file (i.e., different register values for different
# vector register banks).
-set core_supported [gdb_gcore_cmd "${objdir}/${subdir}/vsx-core.test" \
- "Save a VSX-enabled corefile"]
+set corefile "${objdir}/${subdir}/vsx-core.test"
+set core_supported [gdb_gcore_cmd "$corefile" "Save a VSX-enabled corefile"]
# Now run the F32~F63/VR0~VR31 tests.
@@ -168,31 +168,10 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-gdb_test_multiple "core ${objdir}/${subdir}/vsx-core.test" \
- "re-load generated corefile" \
-{
- -re ".* is not a core dump:.*$gdb_prompt $" {
- fail "re-load generated corefile (bad file format)"
- # No use proceeding from here.
- return;
- }
- -re ".*: No such file or directory.*$gdb_prompt $" {
- fail "re-load generated corefile (file not found)"
- # No use proceeding from here.
- return;
- }
- -re ".*Couldn't find .* registers in core file.*$gdb_prompt $" {
- fail "re-load generated corefile (incomplete note section)"
- }
- -re "Core was generated by .*$gdb_prompt $" {
- pass "re-load generated corefile"
- }
- -re ".*$gdb_prompt $" {
- fail "re-load generated corefile"
- }
- timeout {
- fail "re-load generated corefile (timeout)"
- }
+set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"]
+if { $core_loaded == -1 } {
+ # No use proceeding from here.
+ return
}
for {set i 0} {$i < 32} {incr i 1} {