From patchwork Fri Nov 28 15:01:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 3987 Received: (qmail 23100 invoked by alias); 28 Nov 2014 15:03:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23089 invoked by uid 89); 28 Nov 2014 15:03:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, MSGID_FROM_MTA_HEADER, SPF_SOFTFAIL, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e34.co.us.ibm.com Received: from e34.co.us.ibm.com (HELO e34.co.us.ibm.com) (32.97.110.152) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 28 Nov 2014 15:03:35 +0000 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Nov 2014 08:03:33 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 28 Nov 2014 08:03:31 -0700 Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 70FC53E4003B for ; Fri, 28 Nov 2014 08:00:41 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sASF4Ffw28049542 for ; Fri, 28 Nov 2014 08:04:15 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sASF3U0v012373 for ; Fri, 28 Nov 2014 08:03:30 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id sASF3REm012109 for ; Fri, 28 Nov 2014 08:03:28 -0700 Message-Id: <201411281503.sASF3REm012109@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 28 Nov 2014 16:01:54 +0100 Subject: [commit] Remove (dead-code) native core file sniffers on Linux targets To: gdb-patches@sourceware.org Date: Fri, 28 Nov 2014 16:01:54 +0100 (CET) From: "Ulrich Weigand" MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14112815-0017-0000-0000-000006A5E35A Hello, 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/ * 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. diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh index a2aff44..baa8709 100644 --- a/gdb/config/ia64/linux.mh +++ b/gdb/config/ia64/linux.mh @@ -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 diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh index d802591..009ea95 100644 --- a/gdb/config/sparc/linux.mh +++ b/gdb/config/sparc/linux.mh @@ -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 diff --git a/gdb/config/sparc/linux64.mh b/gdb/config/sparc/linux64.mh index c83097e..aad77c7 100644 --- a/gdb/config/sparc/linux64.mh +++ b/gdb/config/sparc/linux64.mh @@ -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 \ diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index 0c122af..ebfe847 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -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); }