Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 00/22 v4] Make GDB builtin target descriptions more flexible
Date: Mon, 21 Aug 2017 15:29:00 -0000	[thread overview]
Message-ID: <1503329347-26711-1-git-send-email-yao.qi@linaro.org> (raw)

This patch series is to change GDB and GDBserver builtin target
descriptions more flexible, by removing pre-generated ones.  Nowadays,
GDB builtin target descriptions are created from initialize_tdesc_*
functions in features/*.c files, while GDBserver builtin target
descriptions are generated from regformats/*.dat files.  Instead,
with these patches applied, these builtin target descriptions can be
got lazily and dynamically.

This patch series changes both GDB and GDBserver to create target
description dynamically from features, instead of using pre-generated
target descriptions.  This patch series only convert x86 target
descriptions to demonstrate the usefulness of the change.

Once one target architecture switches to the new flexible target
description,

 - We only need xml feature files under gdb/features directory.  All
 existing target description xml files can be kept for tests.  Add
 new xml feature file if we want to support the new feature, but
 don't need to add new target description xml files.

 - All existing gdb/regformats/*.dat are not used, but kept for
 the tests.

This is the v4, and v3 can be found
https://sourceware.org/ml/gdb-patches/2017-07/msg00076.html
v3 changes only x86-linux target descriptions, while v4 changes the
whole x86 target descriptions.  The rest of patches aren't changed
since v3.  The first four patches are new in v4, which is about
getting target descriptions via {i386,amd64}_target_description.

I pushed my branch to users/qiyao/target-desc-4

*** BLURB HERE ***

Yao Qi (22):
  Use amd64_target_description to get tdesc_amd64
  Use i386_target_description to get tdesc_i386
  Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0
  Let i386_target_description return tdesc_i386_mmx
  Adjust code generated by regformats/regdat.sh
  Use VEC for target_desc.reg_defs
  Return X86_TDESC_MMX in x86_get_ipa_tdesc_idx
  [GDBserver] Centralize tdesc for i386-linux
  [GDBserver] unit test to i386_tdesc
  Dynamically composite xml in reply to GDB
  Share i386-linux target description between GDB and GDBserver
  Remove features/i386/i386-*linux.c
  [GDBserver] Use pre-generated tdesc as test
  [GDBserver] Shorten srv_i386_linux_xmlfiles
  Update comments in amd64_linux_core_read_description
  Centralize amd64-linux target descriptions
  Lazily and dynamically create amd64-linux target descriptions
  Convert amd64-linux target descriptions
  [GDBserver] Use pre-generated amd64-linux tdesc as test
  [GDBserver] Shorten srv_amd64_linux_xmlfiles
  Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c
  Convert the rest x86 target descriptions

 gdb/Makefile.in                                    |   4 +
 gdb/amd64-darwin-tdep.c                            |   4 +-
 gdb/amd64-dicos-tdep.c                             |   4 +-
 gdb/amd64-fbsd-nat.c                               |   4 +-
 gdb/amd64-fbsd-tdep.c                              |   3 +-
 gdb/amd64-linux-tdep.c                             | 124 ++++----
 gdb/amd64-linux-tdep.h                             |   6 +
 gdb/amd64-nbsd-tdep.c                              |   4 +-
 gdb/amd64-obsd-tdep.c                              |   4 +-
 gdb/amd64-sol2-tdep.c                              |   4 +-
 gdb/amd64-tdep.c                                   |  66 +++--
 gdb/amd64-tdep.h                                   |   2 -
 gdb/amd64-windows-tdep.c                           |   4 +-
 gdb/arch/amd64.c                                   |  74 +++++
 gdb/arch/amd64.h                                   |  22 ++
 gdb/arch/i386.c                                    |  68 +++++
 gdb/arch/i386.h                                    |  21 ++
 gdb/arch/tdesc.h                                   |  92 ++++++
 gdb/configure.tgt                                  |  63 ++--
 gdb/features/Makefile                              |  40 +--
 gdb/features/i386/32bit-avx.c                      |   4 +-
 gdb/features/i386/32bit-avx512.c                   |   4 +-
 gdb/features/i386/32bit-core.c                     |   4 +-
 gdb/features/i386/32bit-linux.c                    |   4 +-
 gdb/features/i386/32bit-mpx.c                      |   4 +-
 gdb/features/i386/32bit-pkeys.c                    |   4 +-
 gdb/features/i386/32bit-sse.c                      |   4 +-
 gdb/features/i386/64bit-avx.c                      |  29 ++
 gdb/features/i386/64bit-avx512.c                   | 124 ++++++++
 gdb/features/i386/64bit-core.c                     |  74 +++++
 gdb/features/i386/64bit-linux.c                    |  15 +
 gdb/features/i386/64bit-mpx.c                      |  51 ++++
 gdb/features/i386/64bit-pkeys.c                    |  14 +
 gdb/features/i386/64bit-segments.c                 |  15 +
 gdb/features/i386/64bit-sse.c                      |  83 ++++++
 gdb/features/i386/amd64-avx-avx512-linux.c         | 288 ------------------
 gdb/features/i386/amd64-avx-avx512.c               | 283 ------------------
 gdb/features/i386/amd64-avx-linux.c                | 177 -----------
 gdb/features/i386/amd64-avx-mpx-avx512-pku-linux.c | 329 ---------------------
 gdb/features/i386/amd64-avx-mpx-avx512-pku.c       | 324 --------------------
 gdb/features/i386/amd64-avx-mpx-linux.c            | 215 --------------
 gdb/features/i386/amd64-avx-mpx.c                  | 210 -------------
 gdb/features/i386/amd64-avx.c                      | 172 -----------
 gdb/features/i386/amd64-linux.c                    | 159 ----------
 gdb/features/i386/amd64-mpx-linux.c                | 197 ------------
 gdb/features/i386/amd64-mpx.c                      | 192 ------------
 gdb/features/i386/amd64.c                          | 154 ----------
 gdb/features/i386/i386-avx-avx512-linux.c          | 170 -----------
 gdb/features/i386/i386-avx-avx512.c                | 165 -----------
 gdb/features/i386/i386-avx-linux.c                 | 149 ----------
 gdb/features/i386/i386-avx-mpx-avx512-pku-linux.c  | 211 -------------
 gdb/features/i386/i386-avx-mpx-avx512-pku.c        | 206 -------------
 gdb/features/i386/i386-avx-mpx-linux.c             | 187 ------------
 gdb/features/i386/i386-avx-mpx.c                   | 182 ------------
 gdb/features/i386/i386-avx.c                       | 144 ---------
 gdb/features/i386/i386-linux.c                     | 139 ---------
 gdb/features/i386/i386-mmx-linux.c                 |  78 -----
 gdb/features/i386/i386-mmx.c                       |  73 -----
 gdb/features/i386/i386-mpx-linux.c                 | 177 -----------
 gdb/features/i386/i386-mpx.c                       | 172 -----------
 gdb/features/i386/i386.c                           | 134 ---------
 gdb/features/i386/x32-avx-avx512-linux.c           | 288 ------------------
 gdb/features/i386/x32-avx-linux.c                  | 177 -----------
 gdb/features/i386/x32-core.c                       |  74 +++++
 gdb/features/i386/x32-linux.c                      | 159 ----------
 gdb/gdbserver/Makefile.in                          |  13 +
 gdb/gdbserver/configure.srv                        |  55 ++--
 gdb/gdbserver/linux-amd64-ipa.c                    |  56 ++--
 gdb/gdbserver/linux-i386-ipa.c                     |  39 +--
 gdb/gdbserver/linux-x86-low.c                      | 146 ++-------
 gdb/gdbserver/linux-x86-tdesc-selftest.c           | 183 ++++++++++++
 gdb/gdbserver/linux-x86-tdesc.c                    | 173 +++++++++++
 gdb/gdbserver/linux-x86-tdesc.h                    |  78 +----
 gdb/gdbserver/lynx-i386-low.c                      |   9 +-
 gdb/gdbserver/nto-x86-low.c                        |  11 +-
 gdb/gdbserver/regcache.c                           |  34 ++-
 gdb/gdbserver/server.c                             |  10 +-
 gdb/gdbserver/tdesc.c                              | 186 +++++++++++-
 gdb/gdbserver/tdesc.h                              | 106 ++++++-
 gdb/gdbserver/win32-i386-low.c                     |  22 +-
 gdb/i386-fbsd-nat.c                                |  10 +-
 gdb/i386-fbsd-tdep.c                               |   4 +-
 gdb/i386-go32-tdep.c                               |   3 +-
 gdb/i386-linux-tdep.c                              |  37 +--
 gdb/i386-tdep.c                                    |  73 +++--
 gdb/i386-tdep.h                                    |   3 -
 gdb/regformats/regdat.sh                           |  26 +-
 gdb/regformats/regdef.h                            |  12 +
 gdb/target-descriptions.c                          |  62 ++--
 gdb/target-descriptions.h                          |  37 +--
 gdb/x86-linux-nat.c                                |  35 +--
 91 files changed, 1858 insertions(+), 6196 deletions(-)
 create mode 100644 gdb/arch/amd64.c
 create mode 100644 gdb/arch/amd64.h
 create mode 100644 gdb/arch/i386.c
 create mode 100644 gdb/arch/i386.h
 create mode 100644 gdb/arch/tdesc.h
 create mode 100644 gdb/features/i386/64bit-avx.c
 create mode 100644 gdb/features/i386/64bit-avx512.c
 create mode 100644 gdb/features/i386/64bit-core.c
 create mode 100644 gdb/features/i386/64bit-linux.c
 create mode 100644 gdb/features/i386/64bit-mpx.c
 create mode 100644 gdb/features/i386/64bit-pkeys.c
 create mode 100644 gdb/features/i386/64bit-segments.c
 create mode 100644 gdb/features/i386/64bit-sse.c
 delete mode 100644 gdb/features/i386/amd64-avx-avx512-linux.c
 delete mode 100644 gdb/features/i386/amd64-avx-avx512.c
 delete mode 100644 gdb/features/i386/amd64-avx-linux.c
 delete mode 100644 gdb/features/i386/amd64-avx-mpx-avx512-pku-linux.c
 delete mode 100644 gdb/features/i386/amd64-avx-mpx-avx512-pku.c
 delete mode 100644 gdb/features/i386/amd64-avx-mpx-linux.c
 delete mode 100644 gdb/features/i386/amd64-avx-mpx.c
 delete mode 100644 gdb/features/i386/amd64-avx.c
 delete mode 100644 gdb/features/i386/amd64-linux.c
 delete mode 100644 gdb/features/i386/amd64-mpx-linux.c
 delete mode 100644 gdb/features/i386/amd64-mpx.c
 delete mode 100644 gdb/features/i386/amd64.c
 delete mode 100644 gdb/features/i386/i386-avx-avx512-linux.c
 delete mode 100644 gdb/features/i386/i386-avx-avx512.c
 delete mode 100644 gdb/features/i386/i386-avx-linux.c
 delete mode 100644 gdb/features/i386/i386-avx-mpx-avx512-pku-linux.c
 delete mode 100644 gdb/features/i386/i386-avx-mpx-avx512-pku.c
 delete mode 100644 gdb/features/i386/i386-avx-mpx-linux.c
 delete mode 100644 gdb/features/i386/i386-avx-mpx.c
 delete mode 100644 gdb/features/i386/i386-avx.c
 delete mode 100644 gdb/features/i386/i386-linux.c
 delete mode 100644 gdb/features/i386/i386-mmx-linux.c
 delete mode 100644 gdb/features/i386/i386-mmx.c
 delete mode 100644 gdb/features/i386/i386-mpx-linux.c
 delete mode 100644 gdb/features/i386/i386-mpx.c
 delete mode 100644 gdb/features/i386/i386.c
 delete mode 100644 gdb/features/i386/x32-avx-avx512-linux.c
 delete mode 100644 gdb/features/i386/x32-avx-linux.c
 create mode 100644 gdb/features/i386/x32-core.c
 delete mode 100644 gdb/features/i386/x32-linux.c
 create mode 100644 gdb/gdbserver/linux-x86-tdesc-selftest.c
 create mode 100644 gdb/gdbserver/linux-x86-tdesc.c

-- 
1.9.1


             reply	other threads:[~2017-08-21 15:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 15:29 Yao Qi [this message]
2017-08-21 15:29 ` [PATCH 05/22] Adjust code generated by regformats/regdat.sh Yao Qi
2017-08-21 15:29 ` [PATCH 11/22] Share i386-linux target description between GDB and GDBserver Yao Qi
2017-08-21 15:29 ` [PATCH 09/22] [GDBserver] unit test to i386_tdesc Yao Qi
2017-08-21 15:29 ` [PATCH 08/22] [GDBserver] Centralize tdesc for i386-linux Yao Qi
2017-08-21 15:29 ` [PATCH 19/22] [GDBserver] Use pre-generated amd64-linux tdesc as test Yao Qi
2017-08-21 15:29 ` [PATCH 01/22] Use amd64_target_description to get tdesc_amd64 Yao Qi
2017-08-21 15:29 ` [PATCH 03/22] Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0 Yao Qi
2017-08-21 16:23   ` John Baldwin
2017-08-21 16:46     ` Yao Qi
2017-08-21 17:00       ` John Baldwin
2017-08-21 15:29 ` [PATCH 04/22] Let i386_target_description return tdesc_i386_mmx Yao Qi
2017-08-21 15:29 ` [PATCH 20/22] [GDBserver] Shorten srv_amd64_linux_xmlfiles Yao Qi
2017-08-21 15:29 ` [PATCH 16/22] Centralize amd64-linux target descriptions Yao Qi
2017-08-21 15:29 ` [PATCH 15/22] Update comments in amd64_linux_core_read_description Yao Qi
2017-08-21 15:30 ` [PATCH 18/22] Convert amd64-linux target descriptions Yao Qi
2017-08-21 15:31 ` [PATCH 06/22] Use VEC for target_desc.reg_defs Yao Qi
2017-08-21 15:31 ` [PATCH 02/22] Use i386_target_description to get tdesc_i386 Yao Qi
2017-08-21 16:23   ` John Baldwin
2017-08-21 15:31 ` [PATCH 07/22] Return X86_TDESC_MMX in x86_get_ipa_tdesc_idx Yao Qi
2017-08-21 15:31 ` [PATCH 10/22] Dynamically composite xml in reply to GDB Yao Qi
2017-08-21 15:31 ` [PATCH 13/22] [GDBserver] Use pre-generated tdesc as test Yao Qi
2017-08-21 15:31 ` [PATCH 14/22] [GDBserver] Shorten srv_i386_linux_xmlfiles Yao Qi
2017-08-21 15:31 ` [PATCH 17/22] Lazily and dynamically create amd64-linux target descriptions Yao Qi
2017-08-21 15:31 ` [PATCH 21/22] Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c Yao Qi
2017-08-21 15:31 ` [PATCH 22/22] Convert the rest x86 target descriptions Yao Qi
2017-08-21 15:31 ` [PATCH 12/22] Remove features/i386/i386-*linux.c Yao Qi
2017-09-05  9:04 ` [PATCH 00/22 v4] Make GDB builtin target descriptions more flexible Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503329347-26711-1-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox