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".
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
* 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.
PR 11804
* defs.h (find_memory_region_ftype): New comment. New arg modified.
* fbsd-nat.c (fbsd_find_memory_regions): Add the passed modified value.
* gcore.c (gcore_create_callback): New function comment. Add modified
parameter. Only write modified regions. Set SEC_READONLY exactly
according to MODIFIED.
(objfile_find_memory_regions): Ignore separate debug info files. Ass
the passed modified value to FUNC.
* gnu-nat.c (gnu_find_memory_regions): Add the passed modified value.
* linux-tdep.c (linux_find_memory_regions): Try to reads smaps file
first. New variables modified and has_anonymous. Parse the lines of
smaps file. Add the passed MODIFIED value to FUNC.
* procfs.c (find_memory_regions_callback): Add the passed modified
value.
gdb/testsuite/
PR 11804
* gdb.base/gcore-relro.exp: New file.
* gdb.base/gcore-relro-main.c: New file.
* gdb.base/gcore-relro-lib.c: New file.