From fac51dd9e59b66e8427ed00c417cb1bf5b0679ac Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 6 May 2013 22:11:16 +0000 Subject: * 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. --- gdb/testsuite/gdb.arch/system-gcore.exp | 32 ++++++-------------------------- gdb/testsuite/gdb.arch/vsx-regs.exp | 33 ++++++--------------------------- 2 files changed, 12 insertions(+), 53 deletions(-) (limited to 'gdb/testsuite/gdb.arch') 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} { -- cgit v1.1