Remove (dead-code) native core file sniffers on Linux targets

Since Andreas Arnez' recent patch series, all Linux targets install
gdbarch_iterate_over_regset_sections routines.  This means that on
Linux native targets, old-style core sniffers are never used.

Most Linux targets haven't been using such sniffers for a long time
anyway, but a couple remain: ia64 and sparc use core-regset.o, and
m68k installs its own core_fns.  All this is now dead code, which
this commit removes.

gdb/
2014-11-28  Ulrich Weigand  <uweigand@de.ibm.com>

	* config/ia64/linux.mh (NATDEPFILES): Remove core-regset.o.
	* config/sparc/linux.mh (NATDEPFILES): Likewise.
	* config/sparc/linux64.mh (NATDEPFILES): Likewise.
	* m68klinux-nat.c (fetch_core_registers): Remove.
	(linux_elf_core_fns): Remove.
	(_initialize_m68k_linux_nat): Do not call deprecated_add_core_fns.
This commit is contained in:
Ulrich Weigand 2014-11-28 15:53:05 +01:00
parent 0fa9473ff0
commit b2859a9a54
5 changed files with 11 additions and 73 deletions

View File

@ -1,3 +1,12 @@
2014-11-28 Ulrich Weigand  <uweigand@de.ibm.com>
* config/ia64/linux.mh (NATDEPFILES): Remove core-regset.o.
* config/sparc/linux.mh (NATDEPFILES): Likewise.
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
* m68klinux-nat.c (fetch_core_registers): Remove.
(linux_elf_core_fns): Remove.
(_initialize_m68k_linux_nat): Do not call deprecated_add_core_fns.
2014-11-28 Joel Brobecker <brobecker@adacore.com>
* utils.c (gdb_realpath): Rework comment about handling on

View File

@ -2,7 +2,7 @@
NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
core-regset.o ia64-linux-nat.o \
ia64-linux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
linux-procfs.o linux-ptrace.o linux-waitpid.o

View File

@ -1,7 +1,7 @@
# Host: GNU/Linux SPARC
NAT_FILE= config/nm-linux.h
NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
core-regset.o fork-child.o inf-ptrace.o \
fork-child.o inf-ptrace.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
linux-procfs.o linux-ptrace.o linux-waitpid.o

View File

@ -1,7 +1,6 @@
# Host: GNU/Linux UltraSPARC
NAT_FILE= config/nm-linux.h
NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
core-regset.o \
fork-child.o inf-ptrace.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \

View File

@ -504,62 +504,6 @@ m68k_linux_store_inferior_registers (struct target_ops *ops,
_("Got request to store bad register number %d."), regno);
}
/* Interpreting register set info found in core files. */
/* Provide registers to GDB from a core file.
(We can't use the generic version of this function in
core-regset.c, because we need to use elf_gregset_t instead of
gregset_t.)
CORE_REG_SECT points to an array of bytes, which are the contents
of a `note' from a core file which BFD thinks might contain
register contents. CORE_REG_SIZE is its size.
WHICH says which register set corelow suspects this is:
0 --- the general-purpose register set, in elf_gregset_t format
2 --- the floating-point register set, in elf_fpregset_t format
REG_ADDR isn't used on GNU/Linux. */
static void
fetch_core_registers (struct regcache *regcache,
char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
elf_gregset_t gregset;
elf_fpregset_t fpregset;
switch (which)
{
case 0:
if (core_reg_size != sizeof (gregset))
warning (_("Wrong size gregset in core file."));
else
{
memcpy (&gregset, core_reg_sect, sizeof (gregset));
supply_gregset (regcache, (const elf_gregset_t *) &gregset);
}
break;
case 2:
if (core_reg_size != sizeof (fpregset))
warning (_("Wrong size fpregset in core file."));
else
{
memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
supply_fpregset (regcache, (const elf_fpregset_t *) &fpregset);
}
break;
default:
/* We've covered all the kinds of registers we know about here,
so this must be something we wouldn't know what to do with
anyway. Just ignore it. */
break;
}
}
/* Fetch the thread-local storage pointer for libthread_db. */
@ -579,18 +523,6 @@ ps_get_thread_area (const struct ps_prochandle *ph,
}
/* Register that we are able to handle GNU/Linux ELF core file
formats. */
static struct core_fns linux_elf_core_fns =
{
bfd_target_elf_flavour, /* core_flavour */
default_check_format, /* check_format */
default_core_sniffer, /* core_sniffer */
fetch_core_registers, /* core_read_registers */
NULL /* next */
};
void _initialize_m68k_linux_nat (void);
void
@ -607,6 +539,4 @@ _initialize_m68k_linux_nat (void)
/* Register the target. */
linux_nat_add_target (t);
deprecated_add_core_fns (&linux_elf_core_fns);
}