public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible
@ 2017-06-12  8:42 Yao Qi
  2017-06-12  8:42 ` [PATCH 13/25] Dynamically create tdesc in GDBserver Yao Qi
                   ` (26 more replies)
  0 siblings, 27 replies; 82+ messages in thread
From: Yao Qi @ 2017-06-12  8:42 UTC (permalink / raw)
  To: gdb-patches

This patch series is to change GDB and GDBserver builtin target
descriptions more flexible, by removing pre-generated ones.  Instead,
these builtin target descriptions can be got lazily and dynamically.
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.

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-linux (
including i386-linux, amd64-linux and x32-linux) target description
to demonstrate the usefulness of the change.

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

 - only need xml feature files under gdb/features directory.  All
 existing target description xml files can be kept for the 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 V2, and V1 is here
https://sourceware.org/ml/gdb-patches/2017-05/msg00291.html,
the differences are,

 - Change target descriptions for both GDB and GDBserver,
 - Generate functions creating features from xml feature file
   instead of feature name, so that don't have to worry about
   different features with the same name (different features
   with the same name still have different file names).
 - Extend the changes for i386-linux to x86-linux (including,
   {i386,amd64,x32}-linux)

The big design change in V2 is that use generate c files from
xml feature files, and use generate c files in both GDB and
GDBserver.

In next step,  I want to remove the duplication of target
descriptions in GDB and GDBserver, and share more code on
creating x86-linux target descriptions in GDB and GDBserver.
I also want people give comments on how to do unit/self
tests in GDBserver, see patch 14.  The purpose of this patch
series is still to demonstrate the design, so the changelog,
NEWS entry, and doc may be incomplete.  I'll complete them
later.

Regression tested on x86_64-linux (both -m64 and -m32),
native and gdbserver, on aarch64-linux native and gdbserver.
ppc64-linux, native.

*** BLURB HERE ***

Yao Qi (25):
  Move initialize_tdesc_mips* calls from mips-linux-nat.c to
    mips-linux-tdep.c
  Adjust the order of 32bit-linux.xml and 32bit-sse.xml in
    i386/i386-linux.xml
  Class-fy tdesc_reg tdesc_type and tdesc_feature
  Centralize i386 linux target descriptions
  Use visitor pattern for "maint print c-tdesc"
  Generate c for feature instead of tdesc
  Lazily and dynamically create i386-linux target descriptions
  Add "maint check xml-descriptions" to test builtin xml target
    descriptions
  Use target_desc fields expedite_regs and xmltarget ifndef
    IN_PROCESS_AGENT
  Adjust code generated by regformats/regdat.sh
  Use VEC for target_desc.reg_defs
  [GDBserver] Centralize tdesc for i386-linux
  Dynamically create tdesc in GDBserver
  [RFC] GDBserver self test
  [RFC] GDBserver unit test to i386_tdesc
  Dynamically composite xml in reply to GDB
  Remove features/i386/i386-*linux.c
  [GDBserver] Use pre-generated tdesc as test
  GDBserver: remove srv_i386_linux_xmlfiles
  Centralize amd64-linux target descriptions
  Lazily and dynamically create amd64-linux target descriptions
  Regenerate two regformats/i386/.dat files
  [GDBserver] Convert amd64-linux target descriptions
  [GDBserver] Use pre-generated amd64-linux tdesc as test
  Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c

 gdb/amd64-linux-tdep.c                             |  165 ++-
 gdb/amd64-linux-tdep.h                             |    6 +
 gdb/cli/cli-cmds.c                                 |    4 +
 gdb/doc/gdb.texinfo                                |   15 +-
 gdb/features/Makefile                              |   59 +-
 gdb/features/i386/32bit-avx.c                      |   27 +
 gdb/features/i386/32bit-avx512.c                   |   39 +
 gdb/features/i386/32bit-core.c                     |   72 ++
 gdb/features/i386/32bit-linux.c                    |   21 +
 gdb/features/i386/32bit-mpx.c                      |   57 +
 gdb/features/i386/32bit-pkeys.c                    |   20 +
 gdb/features/i386/32bit-sse.c                      |   81 ++
 gdb/features/i386/64bit-avx.c                      |   35 +
 gdb/features/i386/64bit-avx512.c                   |  130 +++
 gdb/features/i386/64bit-core.c                     |   80 ++
 gdb/features/i386/64bit-linux.c                    |   21 +
 gdb/features/i386/64bit-mpx.c                      |   57 +
 gdb/features/i386/64bit-pkeys.c                    |   20 +
 gdb/features/i386/64bit-segments.c                 |   21 +
 gdb/features/i386/64bit-sse.c                      |   89 ++
 gdb/features/i386/amd64-avx-avx512-linux.c         |  288 -----
 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-linux.c            |  215 ----
 gdb/features/i386/amd64-linux.c                    |  159 ---
 gdb/features/i386/amd64-mpx-linux.c                |  197 ----
 gdb/features/i386/i386-avx-avx512-linux.c          |  170 ---
 gdb/features/i386/i386-avx-avx512.c                |    8 +-
 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        |    8 +-
 gdb/features/i386/i386-avx-mpx-linux.c             |  187 ----
 gdb/features/i386/i386-avx-mpx.c                   |    8 +-
 gdb/features/i386/i386-avx.c                       |    8 +-
 gdb/features/i386/i386-linux.c                     |  139 ---
 gdb/features/i386/i386-linux.xml                   |    2 +-
 gdb/features/i386/i386-mmx-linux.c                 |   78 --
 gdb/features/i386/i386-mmx.c                       |    8 +-
 gdb/features/i386/i386-mpx-linux.c                 |  177 ----
 gdb/features/i386/i386-mpx.c                       |    8 +-
 gdb/features/i386/i386.c                           |    8 +-
 gdb/features/i386/x32-avx-avx512-linux.c           |  288 -----
 gdb/features/i386/x32-avx-linux.c                  |  177 ----
 gdb/features/i386/x32-core.c                       |   80 ++
 gdb/features/i386/x32-linux.c                      |  159 ---
 gdb/gdbcmd.h                                       |    4 +
 gdb/gdbserver/Makefile.in                          |    2 +-
 gdb/gdbserver/config.in                            |    3 +
 gdb/gdbserver/configure                            |   12 +-
 gdb/gdbserver/configure.ac                         |    5 +
 gdb/gdbserver/configure.srv                        |   29 +-
 gdb/gdbserver/linux-amd64-ipa.c                    |   56 -
 gdb/gdbserver/linux-i386-ipa.c                     |   36 -
 gdb/gdbserver/linux-x86-low.c                      |  102 +-
 gdb/gdbserver/linux-x86-tdesc-selftest.c           |  200 ++++
 gdb/gdbserver/linux-x86-tdesc.c                    |  218 ++++
 gdb/gdbserver/linux-x86-tdesc.h                    |   77 +-
 gdb/gdbserver/regcache.c                           |   34 +-
 gdb/gdbserver/server.c                             |   28 +-
 gdb/gdbserver/tdesc.c                              |  140 ++-
 gdb/gdbserver/tdesc.h                              |  131 ++-
 gdb/i386-linux-tdep.c                              |  119 ++-
 gdb/i386-linux-tdep.h                              |   10 +-
 gdb/maint.c                                        |   18 +
 gdb/mips-linux-nat.c                               |   11 -
 gdb/mips-linux-tdep.c                              |   11 +
 gdb/mips-linux-tdep.h                              |    6 +
 .../i386/amd64-avx-mpx-avx512-pku-linux.dat        |    1 +
 gdb/regformats/i386/amd64-avx-mpx-avx512-pku.dat   |    3 -
 gdb/regformats/regdat.sh                           |   27 +-
 gdb/regformats/regdef.h                            |   12 +
 gdb/selftest.c                                     |   18 +-
 gdb/target-descriptions.c                          | 1109 +++++++++++++-------
 gdb/target-descriptions.h                          |   13 +-
 gdb/testsuite/gdb.gdb/unittest.exp                 |    5 +
 gdb/x86-linux-nat.c                                |   59 +-
 76 files changed, 2763 insertions(+), 3993 deletions(-)
 create mode 100644 gdb/features/i386/32bit-avx.c
 create mode 100644 gdb/features/i386/32bit-avx512.c
 create mode 100644 gdb/features/i386/32bit-core.c
 create mode 100644 gdb/features/i386/32bit-linux.c
 create mode 100644 gdb/features/i386/32bit-mpx.c
 create mode 100644 gdb/features/i386/32bit-pkeys.c
 create mode 100644 gdb/features/i386/32bit-sse.c
 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-linux.c
 delete mode 100644 gdb/features/i386/amd64-avx-mpx-avx512-pku-linux.c
 delete mode 100644 gdb/features/i386/amd64-avx-mpx-linux.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/i386-avx-avx512-linux.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-linux.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-mpx-linux.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

^ permalink raw reply	[flat|nested] 82+ messages in thread

end of thread, other threads:[~2017-06-29 15:24 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12  8:42 [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible Yao Qi
2017-06-12  8:42 ` [PATCH 13/25] Dynamically create tdesc in GDBserver Yao Qi
2017-06-12  8:42 ` [PATCH 21/25] Lazily and dynamically create amd64-linux target descriptions Yao Qi
2017-06-12  8:42 ` [PATCH 16/25] Dynamically composite xml in reply to GDB Yao Qi
2017-06-12  8:42 ` [PATCH 24/25] [GDBserver] Use pre-generated amd64-linux tdesc as test Yao Qi
2017-06-12  8:42 ` [PATCH 22/25] Regenerate two regformats/i386/.dat files Yao Qi
2017-06-22 12:43   ` Yao Qi
2017-06-12  8:42 ` [PATCH 09/25] Use target_desc fields expedite_regs and xmltarget ifndef IN_PROCESS_AGENT Yao Qi
2017-06-28 16:16   ` Pedro Alves
2017-06-28 17:42     ` Pedro Alves
2017-06-28 17:45       ` Pedro Alves
2017-06-29 11:45     ` Yao Qi
2017-06-12  8:42 ` [PATCH 07/25] Lazily and dynamically create i386-linux target descriptions Yao Qi
2017-06-20 11:01   ` Pedro Alves
2017-06-20 14:07     ` Yao Qi
2017-06-28 15:30       ` Pedro Alves
2017-06-12  8:42 ` [PATCH 03/25] Class-fy tdesc_reg tdesc_type and tdesc_feature Yao Qi
2017-06-19 20:55   ` Simon Marchi
2017-06-19 21:30   ` Simon Marchi
2017-06-20 10:31     ` Yao Qi
2017-06-12  8:42 ` [PATCH 19/25] GDBserver: remove srv_i386_linux_xmlfiles Yao Qi
2017-06-12  8:42 ` [PATCH 10/25] Adjust code generated by regformats/regdat.sh Yao Qi
2017-06-20 11:09   ` Pedro Alves
2017-06-21 14:28     ` Yao Qi
2017-06-12  8:42 ` [PATCH 01/25] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c Yao Qi
2017-06-12 15:25   ` Maciej W. Rozycki
2017-06-13  8:07     ` Yao Qi
2017-06-12  8:42 ` [PATCH 20/25] Centralize amd64-linux target descriptions Yao Qi
2017-06-12  8:42 ` [PATCH 14/25] [RFC] GDBserver self test Yao Qi
2017-06-28 17:09   ` Pedro Alves
2017-06-29  9:08     ` Yao Qi
2017-06-12  8:42 ` [PATCH 02/25] Adjust the order of 32bit-linux.xml and 32bit-sse.xml in i386/i386-linux.xml Yao Qi
2017-06-19 20:22   ` Simon Marchi
2017-06-19 21:24     ` Pedro Alves
2017-06-19 21:48       ` Simon Marchi
2017-06-19 21:56         ` Pedro Alves
2017-06-20  9:20           ` Yao Qi
2017-06-20 10:12             ` Pedro Alves
2017-06-20 11:09               ` Yao Qi
2017-06-12  8:42 ` [PATCH 15/25] [RFC] GDBserver unit test to i386_tdesc Yao Qi
2017-06-28 17:22   ` Pedro Alves
2017-06-29  9:27     ` Yao Qi
2017-06-12  8:42 ` [PATCH 17/25] Remove features/i386/i386-*linux.c Yao Qi
2017-06-12  8:42 ` [PATCH 23/25] [GDBserver] Convert amd64-linux target descriptions Yao Qi
2017-06-28 19:00   ` Pedro Alves
2017-06-12  8:42 ` [PATCH 04/25] Centralize i386 linux " Yao Qi
2017-06-19 21:27   ` Simon Marchi
2017-06-12  8:42 ` [PATCH 05/25] Use visitor pattern for "maint print c-tdesc" Yao Qi
2017-06-20 23:37   ` Simon Marchi
2017-06-12  8:42 ` [PATCH 25/25] Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c Yao Qi
2017-06-12  8:42 ` [PATCH 08/25] Add "maint check xml-descriptions" to test builtin xml target descriptions Yao Qi
2017-06-28 16:13   ` Pedro Alves
2017-06-12  8:42 ` [PATCH 11/25] Use VEC for target_desc.reg_defs Yao Qi
2017-06-28 19:01   ` Pedro Alves
2017-06-29 11:05     ` Yao Qi
2017-06-29 11:31       ` Pedro Alves
2017-06-29 13:24         ` Yao Qi
2017-06-12  8:42 ` [PATCH 12/25] [GDBserver] Centralize tdesc for i386-linux Yao Qi
2017-06-12  8:42 ` [PATCH 18/25] [GDBserver] Use pre-generated tdesc as test Yao Qi
2017-06-12  8:42 ` [PATCH 06/25] Generate c for feature instead of tdesc Yao Qi
2017-06-12 14:48   ` Eli Zaretskii
2017-06-13 12:07     ` Yao Qi
2017-06-13 14:49       ` Eli Zaretskii
2017-06-13 15:31         ` Yao Qi
2017-06-13 15:41           ` Eli Zaretskii
2017-06-14 16:21             ` Yao Qi
2017-06-14 16:32               ` Eli Zaretskii
2017-06-15 13:19                 ` Yao Qi
2017-06-15 14:45                   ` Eli Zaretskii
2017-06-20 10:59   ` Pedro Alves
2017-06-22 14:49     ` Yao Qi
2017-06-22 15:36       ` Pedro Alves
2017-06-22 15:58         ` Yao Qi
2017-06-26 21:38   ` Simon Marchi
2017-06-29 15:24     ` Yao Qi
2017-06-19 19:59 ` [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible Simon Marchi
2017-06-20 11:02   ` Yao Qi
2017-06-26 14:45   ` Tedeschi, Walfred
2017-06-27 13:49     ` Alan Hayward
2017-06-28  8:28       ` Yao Qi
2017-06-28  8:06     ` Yao Qi
2017-06-28 19:06 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).