]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Dynamically composite xml in reply to GDB
authorYao Qi <yao.qi@linaro.org>
Wed, 24 May 2017 13:59:37 +0000 (14:59 +0100)
committerYao Qi <yao.qi@linaro.org>
Tue, 20 Jun 2017 10:34:14 +0000 (11:34 +0100)
commit16e89d7f76cc36db1a2f404867aea1223aa363f4
tree7b43c45b19066a598eeb3182214338209110e9e2
parent188e9303d5e8e9e2a7663b9136a7c282458ca78e
Dynamically composite xml in reply to GDB

GDBserver still uses pre-generated target descriptions in order to
reply to GDB's query on target description (see xml-builtin-generated.c
in GDBserver build directory).  This patch teaches GDBserver to
create XML contents according to the target descriptions rather than
using pre-generated ones.

First, change target feature c files to pass the feature xml file
name to tdesc_create_feature, so that target description in GDBserver
can record them, and create XML contents from these features in
buffer, like

  ...
  <xi:include href="$FEATURE1_XML_NAME"/>
  <xi:include href="$FEATURE2_XML_NAME"/>
  ...

and send this buffer back to GDB.

gdb/gdbserver:

2017-05-24  Yao Qi  <yao.qi@linaro.org>

* linux-x86-tdesc.c (i386_get_ipa_tdesc): Call
set_tdesc_architecture and set_tdesc_osabi.  Don't set
xmltarget field.
* server.c (get_features_xml): Call tdesc_get_features_xml.
* tdesc.c (set_tdesc_architecture): New function.
(set_tdesc_osabi): New function.
(tdesc_get_features_xml): New function.
(tdesc_create_feature): Add one argument.
* tdesc.h (struct target_desc) <features>: New field.
<arch>: New field.
<osabi>: New field.
(target_desc::~target_desc): xfree arch, osabi, and
features.
(set_tdesc_architecture): Declare.
(set_tdesc_osabi): Declare.
(tdesc_get_features_xml): Declare.
* target-descriptions.c (tdesc_create_feature): Add one
argument.
* target-descriptions.h (tdesc_create_feature): Update
the declaration.
13 files changed:
gdb/features/i386/32bit-avx.c
gdb/features/i386/32bit-avx512.c
gdb/features/i386/32bit-core.c
gdb/features/i386/32bit-linux.c
gdb/features/i386/32bit-mpx.c
gdb/features/i386/32bit-pkeys.c
gdb/features/i386/32bit-sse.c
gdb/gdbserver/linux-x86-tdesc.c
gdb/gdbserver/server.c
gdb/gdbserver/tdesc.c
gdb/gdbserver/tdesc.h
gdb/target-descriptions.c
gdb/target-descriptions.h