From patchwork Fri Sep 12 16:18:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 2812 Received: (qmail 19847 invoked by alias); 12 Sep 2014 16:18:26 -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 19837 invoked by uid 89); 12 Sep 2014 16:18:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from e06smtp15.uk.ibm.com (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 16:18:24 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 17:18:21 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 17:18:20 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A9FDD17D8045 for ; Fri, 12 Sep 2014 17:20:21 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CGIJoT41484518 for ; Fri, 12 Sep 2014 16:18:19 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8CGIJMT003179 for ; Fri, 12 Sep 2014 10:18:19 -0600 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8CGIJMx003173 for ; Fri, 12 Sep 2014 10:18:19 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 24/26] Drop target method 'fbsd_make_corefile_notes' Date: Fri, 12 Sep 2014 18:18:19 +0200 Message-Id: <1410538699-30461-1-git-send-email-arnez@linux.vnet.ibm.com> In-Reply-To: <1410536396-25524-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1410536396-25524-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14091216-0342-0000-0000-00000109D156 X-IsSubscribed: yes Now that all users of the target method 'fbsd_make_corefile_notes' have been converted to the version in fbsd-tdep.c, the old method is removed. gdb/ChangeLog: * fbsd-nat.c (find_signalled_thread, find_stop_signal) (fbsd_collect_regset_section_cb, fbsd_make_corefile_notes): Remove. * fbsd-nat.h (fbsd_make_corefile_notes): Remove prototype. --- gdb/fbsd-nat.c | 76 ---------------------------------------------------------- gdb/fbsd-nat.h | 6 ----- 2 files changed, 82 deletions(-) diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index e9db30e..3bccc77 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -137,79 +137,3 @@ fbsd_find_memory_regions (struct target_ops *self, do_cleanups (cleanup); return 0; } - -static int -find_signalled_thread (struct thread_info *info, void *data) -{ - if (info->suspend.stop_signal != GDB_SIGNAL_0 - && ptid_get_pid (info->ptid) == ptid_get_pid (inferior_ptid)) - return 1; - - return 0; -} - -static enum gdb_signal -find_stop_signal (void) -{ - struct thread_info *info = - iterate_over_threads (find_signalled_thread, NULL); - - if (info) - return info->suspend.stop_signal; - else - return GDB_SIGNAL_0; -} - -/* Create appropriate note sections for a corefile, returning them in - allocated memory. */ - -char * -fbsd_make_corefile_notes (struct target_ops *self, bfd *obfd, int *note_size) -{ - const struct regcache *regcache = get_current_regcache (); - struct gdbarch *gdbarch = get_regcache_arch (regcache); - gregset_t gregs; - fpregset_t fpregs; - char *note_data = NULL; - Elf_Internal_Ehdr *i_ehdrp; - const struct regset *regset; - size_t size; - - /* Put a "FreeBSD" label in the ELF header. */ - i_ehdrp = elf_elfheader (obfd); - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - - gdb_assert (gdbarch_regset_from_core_section_p (gdbarch)); - - size = sizeof gregs; - regset = gdbarch_regset_from_core_section (gdbarch, ".reg", size); - gdb_assert (regset && regset->collect_regset); - regset->collect_regset (regset, regcache, -1, &gregs, size); - - note_data = elfcore_write_prstatus (obfd, note_data, note_size, - ptid_get_pid (inferior_ptid), - find_stop_signal (), &gregs); - - size = sizeof fpregs; - regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", size); - gdb_assert (regset && regset->collect_regset); - regset->collect_regset (regset, regcache, -1, &fpregs, size); - - note_data = elfcore_write_prfpreg (obfd, note_data, note_size, - &fpregs, sizeof (fpregs)); - - if (get_exec_file (0)) - { - const char *fname = lbasename (get_exec_file (0)); - char *psargs = xstrdup (fname); - - if (get_inferior_args ()) - psargs = reconcat (psargs, psargs, " ", get_inferior_args (), - (char *) NULL); - - note_data = elfcore_write_prpsinfo (obfd, note_data, note_size, - fname, psargs); - } - - return note_data; -} diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h index a3f51d6..531fe4f 100644 --- a/gdb/fbsd-nat.h +++ b/gdb/fbsd-nat.h @@ -32,10 +32,4 @@ extern char *fbsd_pid_to_exec_file (struct target_ops *self, int pid); extern int fbsd_find_memory_regions (struct target_ops *self, find_memory_region_ftype func, void *obfd); -/* Create appropriate note sections for a corefile, returning them in - allocated memory. */ - -extern char *fbsd_make_corefile_notes (struct target_ops *self, - bfd *obfd, int *note_size); - #endif /* fbsd-nat.h */