From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30554 invoked by alias); 12 Sep 2014 15:40:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30541 invoked by uid 89); 12 Sep 2014 15:40:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 15:40:01 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 16:39:58 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 16:39:57 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3132F17D8045 for ; Fri, 12 Sep 2014 16:41:59 +0100 (BST) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CFdvGH35782832 for ; Fri, 12 Sep 2014 15:39:57 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8CAcMDs014769 for ; Fri, 12 Sep 2014 06:38:22 -0400 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8CAcL6c014757 for ; Fri, 12 Sep 2014 06:38:21 -0400 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 00/26] Regset rework Date: Fri, 12 Sep 2014 15:40:00 -0000 Message-Id: <1410536396-25524-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14091215-5024-0000-0000-00000145DC02 X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00408.txt.bz2 Earlier this year I've posted a two-part patch series with "regset rework preparations": * https://sourceware.org/ml/gdb-patches/2014-05/msg00239.html * https://sourceware.org/ml/gdb-patches/2014-07/msg00808.html Now this patch series attempts the next major refactoring step in this area. It has two main goals: * Unify GDB's capabilities with respect to core files across the various architectures. In particular enable more targets for multi-arch capable core file generation support. * Streamline the regset support: reduce the gdbarch interface and reduce overall complexity. One important means to achieve these goals is by merging two existing gdbarch interfaces into one. Currently, the gdbarch variable 'core_regset_sections' enumerates the core file register notes to be handled by GDB; it specifies each note section's BFD name, size, and human-friendly name. In addition, the gdbarch method 'regset_from_core_section' translates a BFD name to a register set definition. Both of these interfaces are merged into a single gdbarch method 'iterate_over_regset_sections', which enumerates the core file notes *and* provides the register set definition for each. For illustration, a typical implementation of the gdbarch method 'regset_from_core_section' may look like this: static const struct regset * foo_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) { if (strcmp (sect_name, ".reg") == 0 && sect_size >= FOO_SIZEOF_GREGSET) return &foo_gregset; if (strcmp (sect_name, ".reg2") == 0 && sect_size >= FOO_SIZEOF_FPREGSET) return &foo_fpregset; return NULL; } The new iterator would then look like this: static void foo_iterate_over_regset_sections (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache) { cb (".reg", FOO_SIZEOF_GREGSET, &foo_gregset, NULL, cb_data); cb (".reg2", FOO_SIZEOF_FPREGSET, &foo_fpregset, NULL, cb_data); } Two kinds of targets particularly benefit from this change: * Those which currently define the 'core_regset_sections' variable; they now have one less gdbarch interface to deal with. In some cases this reduces the regset handling code quite substantially. * Those which define collect_regset functions for all register sets, but do not define the 'core_regset_sections' variable. They gain multi-arch capable core file generation support. Since the regset rework preparations, all Linux targets fall into one of these categories, except for CRIS -- which still uses the ancient deprecated_add_core_fns. Also, currently there is some fall-back handling for the case that 'regset_from_core_section' is defined and 'core_regset_sections' is not. This handling is removed. The series has been compiled with --enable-targets=all on a 64-bit platform. It has been tested on GNU/Linux for s390x, i386, and amd64. Any comments welcome. Andreas Arnez (26): Replace 'core_regset_sections' by iterator method Add 'regset' parameter to 'iterate_over_regset_sections_cb' Add multi-arch capable 'fbsd_make_corefile_notes' variant AARCH64: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' ALPHA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' ARM: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' FRV: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' HPPA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' X86: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' M32R: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' M68K: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' IA64: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' M88K: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' MIPS: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' MN10300: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'. NIOS2: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' PPC: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' SCORE: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' SH: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' SPARC: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' TILEGX: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' VAX: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' XTENSA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Drop target method 'fbsd_make_corefile_notes' Linux targets: drop fall back to target method for 'make_corefile_notes' Drop 'regset_from_core_section' gdbarch method gdb/Makefile.in | 4 +- gdb/aarch64-linux-tdep.c | 26 +++---- gdb/alpha-linux-tdep.c | 24 +++--- gdb/alphabsd-tdep.h | 10 +-- gdb/alphafbsd-tdep.c | 5 ++ gdb/alphanbsd-tdep.c | 87 ++++++++++----------- gdb/alphaobsd-tdep.c | 4 +- gdb/amd64-linux-tdep.c | 57 +++++++++++--- gdb/amd64-tdep.c | 51 +------------ gdb/amd64-tdep.h | 2 + gdb/amd64fbsd-nat.c | 1 - gdb/amd64fbsd-tdep.c | 4 + gdb/amd64obsd-tdep.c | 19 +++-- gdb/arm-linux-tdep.c | 55 ++++---------- gdb/arm-tdep.h | 8 +- gdb/armbsd-tdep.c | 20 ++--- gdb/armobsd-tdep.c | 4 +- gdb/configure.tgt | 8 +- gdb/corelow.c | 86 ++++++++++++--------- gdb/fbsd-nat.c | 76 ------------------- gdb/fbsd-nat.h | 6 -- gdb/fbsd-tdep.c | 137 +++++++++++++++++++++++++++++++++ gdb/fbsd-tdep.h | 25 ++++++ gdb/frv-linux-tdep.c | 25 +++--- gdb/gdbarch.c | 54 +++++-------- gdb/gdbarch.h | 25 +++--- gdb/gdbarch.sh | 17 +++-- gdb/hppa-hpux-tdep.c | 19 +++-- gdb/hppa-linux-tdep.c | 22 +++--- gdb/hppanbsd-tdep.c | 20 +++-- gdb/hppaobsd-tdep.c | 24 +++--- gdb/i386-cygwin-tdep.c | 18 +---- gdb/i386-linux-tdep.c | 86 +++++++++++++-------- gdb/i386-tdep.c | 60 ++++----------- gdb/i386-tdep.h | 16 ++-- gdb/i386fbsd-nat.c | 1 - gdb/i386fbsd-tdep.c | 4 + gdb/i386obsd-tdep.c | 20 +++-- gdb/ia64-linux-tdep.c | 24 +++--- gdb/linux-nat.c | 57 -------------- gdb/linux-tdep.c | 140 ++++++++++++++++++---------------- gdb/linux-tdep.h | 3 - gdb/m32r-linux-tdep.c | 19 ++--- gdb/m68kbsd-tdep.c | 24 +++--- gdb/m68klinux-tdep.c | 27 +++---- gdb/m88k-tdep.c | 20 +++-- gdb/mips-linux-tdep.c | 47 +++++------- gdb/mips64obsd-tdep.c | 20 +++-- gdb/mipsnbsd-tdep.c | 28 +++---- gdb/mn10300-linux-tdep.c | 23 +++--- gdb/nios2-linux-tdep.c | 24 +++--- gdb/ppc-linux-tdep.c | 119 ++++++----------------------- gdb/ppcfbsd-nat.c | 1 - gdb/ppcfbsd-tdep.c | 35 ++++----- gdb/ppcnbsd-tdep.c | 24 +++--- gdb/ppcobsd-tdep.c | 20 +++-- gdb/procfs.c | 2 +- gdb/regset.h | 8 -- gdb/rs6000-aix-tdep.c | 27 +++---- gdb/s390-linux-tdep.c | 192 ++++++++++------------------------------------- gdb/score-tdep.c | 25 +++--- gdb/sh-linux-tdep.c | 4 + gdb/sh-tdep.c | 21 +++--- gdb/sh-tdep.h | 2 + gdb/shnbsd-tdep.c | 1 + gdb/sparc-tdep.c | 24 +++--- gdb/sparc64fbsd-nat.c | 1 - gdb/sparc64fbsd-tdep.c | 4 + gdb/tilegx-linux-tdep.c | 22 +++--- gdb/vax-tdep.c | 20 +++-- gdb/xtensa-tdep.c | 27 +++---- 71 files changed, 946 insertions(+), 1219 deletions(-) create mode 100644 gdb/fbsd-tdep.c create mode 100644 gdb/fbsd-tdep.h -- 1.8.4.2