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 <msnyder@vmware.com>
Hui Zhu <teawater@gmail.com>
* 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".
+2014-08-21 Pedro Alves <palves@redhat.com>
+
+ * 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 <palves@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
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"
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"
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
}
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
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
}
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
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
}