From a8454a7c5a2254b249b1bac34e7cef1438bca9f2 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 21 Aug 2014 11:36:59 +0100 Subject: [PATCH] Remove useless gcore command detection Checking whether the gcore command is included in the GDB build as proxy for checking whether core dumping is supported by the target is useless, as gcore.o has been in COMMON_OBS since git 9b4eba8e: 2009-10-26 Michael Snyder Hui Zhu * Makefile.in (SFILES): Add gcore.c. (COMMON_OBS): Add gcore.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Delete gcore.o. * config/alpha/fbsd.mh (NATDEPFILES): Ditto. ... IOW, the command is always included in the build. Instead, nowadays, tests bail out if actually trying to generate a core fails with an indication the target doesn't support it. See gdb_gcore_cmd and callers. Tested on x86_64 Fedora 20. gdb/testsuite/ChangeLog: * gdb.base/gcore-buffer-overflow.exp: Remove "help gcore" test. * gdb.base/gcore-relro-pie.exp: Likewise. * gdb.base/gcore-relro.exp: Likewise. * gdb.base/gcore.exp: Likewise. * gdb.base/print-symbol-loading.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. * lib/gdb.exp (gdb_gcore_cmd): Don't expect "Undefined command". --- gdb/testsuite/ChangeLog | 10 ++++++++++ gdb/testsuite/gdb.base/gcore-buffer-overflow.exp | 12 ------------ gdb/testsuite/gdb.base/gcore-relro-pie.exp | 13 ------------- gdb/testsuite/gdb.base/gcore-relro.exp | 13 ------------- gdb/testsuite/gdb.base/gcore.exp | 12 ------------ gdb/testsuite/gdb.base/print-symbol-loading.exp | 13 ------------- gdb/testsuite/gdb.threads/gcore-thread.exp | 11 ----------- gdb/testsuite/lib/gdb.exp | 6 ------ 8 files changed, 10 insertions(+), 80 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a9205d1e9b..31c64ff473 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2014-08-21 Pedro Alves + + * gdb.base/gcore-buffer-overflow.exp: Remove "help gcore" test. + * gdb.base/gcore-relro-pie.exp: Likewise. + * gdb.base/gcore-relro.exp: Likewise. + * gdb.base/gcore.exp: Likewise. + * gdb.base/print-symbol-loading.exp: Likewise. + * gdb.threads/gcore-thread.exp: Likewise. + * lib/gdb.exp (gdb_gcore_cmd): Don't expect "Undefined command". + 2014-08-20 Pedro Alves Jan Kratochvil diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp index 1951301f2d..f7a69ba974 100644 --- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp +++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp @@ -31,18 +31,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb clean_restart ${binfile} -# Does this gdb support gcore? -gdb_test_multiple "help gcore" "help gcore" { - -re "Undefined command: .gcore.*$gdb_prompt $" { - # gcore command not supported -- nothing to test here. - unsupported "gdb does not support gcore on this target" - return -1 - } - -re "Save a core file .*$gdb_prompt $" { - pass "help gcore" - } -} - gdb_test_no_output "set args ${pattern}" \ "Set buffer exceeding arguments" diff --git a/gdb/testsuite/gdb.base/gcore-relro-pie.exp b/gdb/testsuite/gdb.base/gcore-relro-pie.exp index e0c0de026e..468e84621c 100644 --- a/gdb/testsuite/gdb.base/gcore-relro-pie.exp +++ b/gdb/testsuite/gdb.base/gcore-relro-pie.exp @@ -39,19 +39,6 @@ file attributes ${stripped_binfile} -permissions $perm clean_restart ${stripped_binfile} -# Does this gdb support gcore? -set test "help gcore" -gdb_test_multiple $test $test { - -re "Undefined command: .gcore.*\r\n$gdb_prompt $" { - # gcore command not supported -- nothing to test here. - unsupported "gdb does not support gcore on this target" - return -1 - } - -re "Save a core file .*\r\n$gdb_prompt $" { - pass $test - } -} - # The binary is stripped of debug info, but not minsyms. if ![runto break_here] { fail "Can't run to break_here" diff --git a/gdb/testsuite/gdb.base/gcore-relro.exp b/gdb/testsuite/gdb.base/gcore-relro.exp index 8278de2a0d..d5f4b695ef 100644 --- a/gdb/testsuite/gdb.base/gcore-relro.exp +++ b/gdb/testsuite/gdb.base/gcore-relro.exp @@ -38,19 +38,6 @@ set objfile [standard_output_file ${testfile}.o] clean_restart ${binfile} gdb_load_shlibs ${binfile_lib} -# Does this gdb support gcore? -set test "help gcore" -gdb_test_multiple $test $test { - -re "Undefined command: .gcore.*\r\n$gdb_prompt $" { - # gcore command not supported -- nothing to test here. - unsupported "gdb does not support gcore on this target" - return -1 - } - -re "Save a core file .*\r\n$gdb_prompt $" { - pass $test - } -} - if ![runto lib] { return -1 } diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp index c28a9b3f41..15de624e21 100644 --- a/gdb/testsuite/gdb.base/gcore.exp +++ b/gdb/testsuite/gdb.base/gcore.exp @@ -24,18 +24,6 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { return -1 } -# Does this gdb support gcore? -gdb_test_multiple "help gcore" "help gcore" { - -re "Undefined command: .gcore.*$gdb_prompt $" { - # gcore command not supported -- nothing to test here. - unsupported "gdb does not support gcore on this target" - return -1 - } - -re "Save a core file .*$gdb_prompt $" { - pass "help gcore" - } -} - if { ! [ runto_main ] } then { untested gcore.exp return -1 diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp index 1abfa2aef9..0686d0e864 100644 --- a/gdb/testsuite/gdb.base/print-symbol-loading.exp +++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp @@ -40,19 +40,6 @@ if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } { clean_restart ${binfile} gdb_load_shlibs ${binfile_lib} -# Does this gdb support gcore? -set test "help gcore" -gdb_test_multiple $test $test { - -re "Undefined command: .gcore.*\r\n$gdb_prompt $" { - # gcore command not supported -- nothing to test here. - unsupported "gdb does not support gcore on this target" - return -1 - } - -re "Save a core file .*\r\n$gdb_prompt $" { - pass $test - } -} - if ![runto lib] { return -1 } diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index 6e0e81e7b1..3014de95b2 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -55,17 +55,6 @@ set nl "\[\r\n\]+" set timeout 30 -gdb_test_multiple "help gcore" "help gcore" { - -re "Undefined command: .gcore.*$gdb_prompt $" { - # gcore command not supported -- nothing to test here. - unsupported "gdb does not support gcore on this target" - return -1 - } - -re "Save a core file .*$gdb_prompt $" { - pass "help gcore" - } -} - if { ! [ runto_main ] } then { untested gcore-thread.exp return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 92069c9a6c..61e1614bdd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3401,12 +3401,6 @@ proc gdb_gcore_cmd {core test} { pass $test set result 1 } - - -re "Undefined command.*$gdb_prompt $" { - unsupported $test - verbose -log "'gcore' command undefined in gdb_gcore_cmd" - } - -re "(?:Can't create a corefile|Target does not support core file generation\\.)\[\r\n\]+$gdb_prompt $" { unsupported $test }