public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Alan Hayward <alan.hayward@arm.com>
To: gdb-patches@sourceware.org
Cc: nd@arm.com,	Alan Hayward <alan.hayward@arm.com>
Subject: [PATCH v5 0/8] Remove gdbserver dependency on xml files
Date: Tue, 10 Apr 2018 14:34:00 -0000	[thread overview]
Message-ID: <20180410143337.71768-1-alan.hayward@arm.com> (raw)

V5 addresses Simon's review comments, mostly in the first two patches and the
"Create xml..." patch. Added changes since previous verion in the patch
headers. Series is slightly shorted as some early patches have been committed.

Summary:

For those targets that use new style target descriptions (also known as
flexible target descriptions), this set of patches removes the dependency on
xml files. Namely:
* Removes inclusion of xml files within gdbserver.
* Removes the requirement for the .c files in features/ to be generated from
cached xml files.
This is made possible by changing xml descriptions generated by gdbserver, so
that instead of including xml file names, gdbserver now generate a complete
xml description.

The second point will be required for aarch64 SVE support, where the register
size are variable. Creating SVE xml files for every possible vector length
would not be feasible. Instead the plan for aarch64 SVE is to hand write the
features/ .c code that would normally be generated from xml.

Targets which use the older style target descriptions have not been changed.


XML Generation:

In existing code, gdbserver uses C code auto generated from xml files to
create target descriptions. When sending an xml description to GDB, the
function tdesc_get_features_xml () creates an xml containing the name of the
original xml file(s). For example:

<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target>
  <architecture>i386</architecture>
  <osabi>GNU/Linux</osabi>
  <xi:include href="32bit-core.xml"/>
  <xi:include href="32bit-sse.xml"/>
  <xi:include href="32bit-linux.xml"/>
  <xi:include href="32bit-avx.xml"/>
</target>

Upon receipt, GDB then makes requests to gdbserver for the contents of the
xml files. Gdbserver keeps full copies all the xml files inside the binary.

This patch series adds common code that allows gdbserver (and gdb) to turn
a C target description structure into xml.
Now when asked fort an xml description to gdb, gdbserver turns the entire
target description structure back into xml, without using any cached files.
Producing, for example:

<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target>
  <architecture>i386</architecture>
  <osabi>GNU/Linux</osabi>
  <feature name="org.gnu.gdb.i386.core">
    <flags id="i386_eflags" size="4">
      <field name="CF" start="0" end="0"/>
      <field name="" start="1" end="1"/>
      <field name="PF" start="2" end="2"/>
      <field name="AF" start="4" end="4"/>
...etc...


Patch Contents:

Patches 1-3 commonise the various target descriptor functionality, allowing
gdbserver to parse target descriptions in the same way as gdb. This series
does not commonise target_desc, but this is hopefully a long term goal.

The sixth patch adds the xml printer, which iterates through the parsing
generated in the previous patches.

The other patches are clean up patches.

Patches have been tested on a make check on x86 targets=all build with
target boards unix and native-gdbserver. Also built and tested aarch64 and
Arm32 (which uses old style descriptions)
In addition, new test cases are added to the unit tests.

Alan Hayward (8):
  Commonise tdesc_reg
  Commonise tdesc_feature
  Commonise tdesc types
  Add tdesc osabi and architecture functions
  Add feature reference in .dat files
  Create xml from target descriptions
  Remove xml file references from target descriptions.
  Remove xml files from gdbserver

 gdb/Makefile.in                                    |   2 +
 gdb/common/tdesc.c                                 | 400 ++++++++++++++
 gdb/common/tdesc.h                                 | 322 ++++++++++-
 gdb/features/Makefile                              |   6 +
 gdb/features/aarch64-core.c                        |   2 +-
 gdb/features/aarch64-fpu.c                         |   2 +-
 gdb/features/i386/32bit-avx.c                      |   2 +-
 gdb/features/i386/32bit-avx512.c                   |   2 +-
 gdb/features/i386/32bit-core.c                     |   2 +-
 gdb/features/i386/32bit-linux.c                    |   2 +-
 gdb/features/i386/32bit-mpx.c                      |   2 +-
 gdb/features/i386/32bit-pkeys.c                    |   2 +-
 gdb/features/i386/32bit-sse.c                      |   2 +-
 gdb/features/i386/64bit-avx.c                      |   2 +-
 gdb/features/i386/64bit-avx512.c                   |   2 +-
 gdb/features/i386/64bit-core.c                     |   2 +-
 gdb/features/i386/64bit-linux.c                    |   2 +-
 gdb/features/i386/64bit-mpx.c                      |   2 +-
 gdb/features/i386/64bit-pkeys.c                    |   2 +-
 gdb/features/i386/64bit-segments.c                 |   2 +-
 gdb/features/i386/64bit-sse.c                      |   2 +-
 gdb/features/i386/x32-core.c                       |   2 +-
 gdb/features/tic6x-c6xp.c                          |   2 +-
 gdb/features/tic6x-core.c                          |   2 +-
 gdb/features/tic6x-gp.c                            |   2 +-
 gdb/gdbserver/Makefile.in                          |   3 +
 gdb/gdbserver/configure.srv                        |  28 -
 gdb/gdbserver/server.c                             |   2 +-
 gdb/gdbserver/tdesc.c                              | 182 ++-----
 gdb/gdbserver/tdesc.h                              |  19 +-
 gdb/regformats/aarch64.dat                         |   1 +
 gdb/regformats/i386/amd64-avx-avx512-linux.dat     |   1 +
 gdb/regformats/i386/amd64-avx-linux.dat            |   1 +
 .../i386/amd64-avx-mpx-avx512-pku-linux.dat        |   1 +
 gdb/regformats/i386/amd64-avx-mpx-linux.dat        |   1 +
 gdb/regformats/i386/amd64-linux.dat                |   1 +
 gdb/regformats/i386/amd64-mpx-linux.dat            |   1 +
 gdb/regformats/i386/amd64.dat                      |   1 +
 gdb/regformats/i386/i386-avx-avx512-linux.dat      |   1 +
 gdb/regformats/i386/i386-avx-linux.dat             |   1 +
 .../i386/i386-avx-mpx-avx512-pku-linux.dat         |   1 +
 gdb/regformats/i386/i386-avx-mpx-linux.dat         |   1 +
 gdb/regformats/i386/i386-linux.dat                 |   1 +
 gdb/regformats/i386/i386-mmx-linux.dat             |   1 +
 gdb/regformats/i386/i386-mpx-linux.dat             |   1 +
 gdb/regformats/i386/i386.dat                       |   1 +
 gdb/regformats/i386/x32-avx-avx512-linux.dat       |   1 +
 gdb/regformats/i386/x32-avx-linux.dat              |   1 +
 gdb/regformats/i386/x32-linux.dat                  |   1 +
 gdb/regformats/regdat.sh                           |  12 +-
 gdb/regformats/regdef.h                            |   8 +-
 gdb/regformats/tic6x-c62x-linux.dat                |   1 +
 gdb/regformats/tic6x-c64x-linux.dat                |   1 +
 gdb/regformats/tic6x-c64xp-linux.dat               |   1 +
 gdb/target-descriptions.c                          | 604 +++------------------
 gdb/target-descriptions.h                          |   8 -
 gdb/xml-tdesc.c                                    |  11 +
 gdb/xml-tdesc.h                                    |   5 +
 58 files changed, 940 insertions(+), 736 deletions(-)
 create mode 100644 gdb/common/tdesc.c

-- 
2.14.3 (Apple Git-98)

             reply	other threads:[~2018-04-10 14:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 14:34 Alan Hayward [this message]
2018-04-10 14:34 ` [PATCH v5 5/8] Add feature reference in .dat files Alan Hayward
2018-04-10 14:34 ` [PATCH v5 1/8] Commonise tdesc_reg Alan Hayward
2018-04-18  1:57   ` Simon Marchi
2018-04-18  9:03     ` Alan Hayward
2018-04-18 13:54       ` Simon Marchi
2018-04-10 14:34 ` [PATCH v5 3/8] Commonise tdesc types Alan Hayward
2018-04-10 14:34 ` [PATCH v5 8/8] Remove xml files from gdbserver Alan Hayward
2018-04-10 14:34 ` [PATCH v5 6/8] Create xml from target descriptions Alan Hayward
2018-04-18  2:43   ` Simon Marchi
2018-04-18 21:26     ` Alan Hayward
2018-04-10 14:34 ` [PATCH v5 4/8] Add tdesc osabi and architecture functions Alan Hayward
2018-04-18  2:10   ` Simon Marchi
2018-04-10 14:34 ` [PATCH v5 2/8] Commonise tdesc_feature Alan Hayward
2018-04-10 14:34 ` [PATCH v5 7/8] Remove xml file references from target descriptions Alan Hayward
2018-04-18  2:49 ` [PATCH v5 0/8] Remove gdbserver dependency on xml files Simon Marchi

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=20180410143337.71768-1-alan.hayward@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).