• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/qiyao/target-desc-3
RSS
Rev. Hora Autor
203ae25 users/qiyao/target-desc-3 2017-07-10 22:46:26 Yao Qi

Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c

gdb:

2017-06-09 Yao Qi <yao.qi@linaro.org>

* features/Makefile (XMLTOC): Remove i386/amd64XXX-linux.xml.
* features/i386/amd64-avx-avx512-linux.c: Removed.
* features/i386/amd64-avx-linux.c: Removed.
* features/i386/amd64-avx-mpx-avx512-pku-linux.c: Removed.
* features/i386/amd64-avx-mpx-linux.c: Removed.
* features/i386/amd64-linux.c: Removed.
* features/i386/amd64-mpx-linux.c: Removed.
* features/i386/x32-avx-avx512-linux.c: Removed.
* features/i386/x32-avx-linux.c: Removed.
* features/i386/x32-linux.c: Removed.

5810735 2017-07-10 22:46:26 Yao Qi

[GDBserver] shorten srv_amd64_linux_xmlfiles

GDBserver now is able to generate target descriptions from features, so
don't need to remember these target description files.

gdb/gdbserver:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* configure.srv (srv_amd64_linux_xmlfiles): Remove
i386/amd64-XXX-linux from it.

8c9fa90 2017-07-10 22:46:26 Yao Qi

[GDBserver] Use pre-generated amd64-linux tdesc as test

Now, all these amd64-linux pre-generated tdesc can be used as test, so
don't need to build them if $development is false.

Note that this patch wants to remove ipa_x32_linux_regobj, but it was
removed by mistake by 22049425ce40324139be82d9a6ec518c46b65815.

gdb/gdbserver:

2017-06-09 Yao Qi <yao.qi@linaro.org>

* configure.srv: Empty srv_amd64_linux_regobj if $development is
false.
(ipa_amd64_linux_regobj): Remove.

353030e 2017-07-10 22:45:26 Yao Qi

Convert amd64-linux target descriptions

This patch changes amd64-linux target descriptions so that they can be
dynamically generated in both GDB and GDBserver.

gdb/gdbserver:

2017-06-09 Yao Qi <yao.qi@linaro.org>

* Makefile.in (arch-amd64.o): New rule.
* configure.srv: Append arch-amd64.o.
* linux-amd64-ipa.c: Include common/x86-xstate.h.
(get_ipa_tdesc): Call amd64_linux_read_description.
(initialize_low_tracepoint): Don't call init_registers_x32_XXX
and init_registers_amd64_XXX.
* linux-x86-low.c (x86_linux_read_description): Call
amd64_linux_read_description.
(x86_get_ipa_tdesc_idx): Call amd64_get_ipa_tdesc_idx.
(initialize_low_arch): Don't call init_registers_x32_XXX and
init_registers_amd64_XXX.
* linux-x86-tdesc-selftest.c: Declare init_registers_amd64_XXX
and tdesc_amd64_XXX.
[__x86_64__] (amd64_tdesc_test): New function.
(initialize_low_tdesc) [__x86_64__]: Call init_registers_x32_XXX
and init_registers_amd64_XXX.
* linux-x86-tdesc.c: Include arch/amd64.h.
(xcr0_to_tdesc_idx): New function.
(i386_linux_read_description): New function.
(amd64_get_ipa_tdesc_idx): New function.
* linux-x86-tdesc.h (amd64_get_ipa_tdesc_idx): Declare.
(amd64_get_ipa_tdesc): Declare.

gdb:

2017-07-03 Yao Qi <yao.qi@linaro.org>

* amd64-linux-tdep.c: Include arch/amd64.h. Don't include
features/i386/*.c.
(amd64_linux_read_description): Call
amd64_create_target_description.
* arch/amd64.c: New file.
* arch/amd64.h: New file.
* configure.tgt (x86_64-*-linux*): Append amd64.o.
* Makefile.in (ALL_64_TARGET_OBS): Append amd64.o.

9a4130f 2017-07-10 22:42:52 Yao Qi

Lazily and dynamically create amd64-linux target descriptions

This patch starts to use the generate c feature files to dynamically
create amd64-linux target descriptions.

gdb:

2017-06-08 Yao Qi <yao.qi@linaro.org>

* amd64-linux-tdep.c: Don't include amd64-XXX-linux and
x32-XXX-linux.c. Include 64bit-XX.c and x32-XX.c.
(amd64_linux_read_description): Create target descriptions.
(_initialize_amd64_linux_tdep): Don't call initialize_tdesc_XXX
functions. Add unit tests.
* features/Makefile (FEATURE_XMLFILES): Append 64bit-XXX.xml and
x32-core.xml.
* features/i386/64bit-avx.c: Generated.
* features/i386/64bit-avx512.c: Generated.
* features/i386/64bit-core.c: Generated.
* features/i386/64bit-linux.c: Generated.
* features/i386/64bit-mpx.c: Generated.
* features/i386/64bit-pkeys.c: Generated.
* features/i386/64bit-segments.c: Generated.
* features/i386/64bit-sse.c: Generated.
* features/i386/x32-core.c: Generated.
* target-descriptions.c (maint_print_c_tdesc_cmd): Print feature
c files for amd64-linux and x32-linux.

2e83593 2017-07-10 22:42:51 Yao Qi

Centralize amd64-linux target descriptions

This patch adds a new function amd64_linux_read_description, which
creates amd64-linux target descriptions according to its two
arguments, xcr0 and is_x32.

gdb:

2017-06-07 Yao Qi <yao.qi@linaro.org>

* amd64-linux-tdep.c (amd64_linux_read_description): New
function.
(amd64_linux_core_read_description): Call
amd64_linux_read_description.
(amd64_linux_init_abi): Likewise.
(amd64_x32_linux_init_abi): Likewise.
* amd64-linux-tdep.h (amd64_linux_read_description): Declare.
* x86-linux-nat.c (x86_linux_read_description): Call
amd64_linux_read_description.

a41e6e3 2017-07-10 22:42:51 Yao Qi

Update comments in amd64_linux_core_read_description

gdb:

2017-07-06 Yao Qi <yao.qi@linaro.org>

* amd64-linux-tdep.c (amd64_linux_core_read_description): Update
comments.

5ffa279 2017-07-10 22:42:45 Yao Qi

[GDBserver] Shorten srv_i386_linux_xmlfiles

GDBserver now is able to generate target descriptions from features, so
don't need to remember these target description files.

gdb/gdbserver:

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

* configure.srv (srv_i386_linux_xmlfiles): Remove
i386/i386-XXX-linux.xml from it.

68ecf3c 2017-07-10 20:02:50 Yao Qi

[GDBserver] Use pre-generated tdesc as test

Now, these *-generate.c files are only used in GDBserver for unit test.
If $development is false (in release), these *-generate.c files won't be
used at all.

gdb/gdbserver:

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

* configure.srv: Set srv_i386_linux_regobj empty if $development
is false.
* linux-i386-ipa.c (initialize_low_tracepoint): Don't call
initialize_low_tdesc.
* linux-x86-low.c (initialize_low_arch): Wrap initialize_low_tdesc
with #if initialize_low_tdesc.
* linux-x86-tdesc-selftest.c: New file.
* linux-x86-tdesc.c: Move code to linux-x86-tdesc-selftest.c.

ff087c3 2017-07-10 20:02:50 Yao Qi

Remove features/i386/i386-*linux.c

Now, features/i386/i386-XXX-linux.c are not used, remove them.

gdb:

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

* features/Makefile (XMLTOC): Remove i386/i386-XX-linux.xml.
* features/i386/i386-avx-avx512-linux.c: Remove.
* features/i386/i386-avx-linux.c: Remove.
* features/i386/i386-avx-mpx-avx512-pku-linux.c: Remove.
* features/i386/i386-avx-mpx-linux.c: Remove.
* features/i386/i386-linux.c: Remove.
* features/i386/i386-mmx-linux.c: Remove.
* features/i386/i386-mpx-linux.c: Remove.

9ebe025 2017-07-10 20:02:50 Yao Qi

Share i386-linux target description between GDB and GDBserver

The code on creating i386-linux target descriptions are quite similar
between GDB and GDBserver, so this patch moves them into a shared file
arch/i386.c. I didn't name it as i386-linux.c, because I want to reuse it
to create other i386 non-linux target descriptions later.

gdb:

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

* Makefile.in (ALL_TARGET_OBS): Add i386.o.
(SFILES): Add arch/i386.c.
(HFILES_NO_SRCDIR): Add arch/i386.h.
* arch/i386.c: New file.
* arch/i386.h: New file.
* arch/tdesc.h (allocate_target_description): Declare.
(set_tdesc_architecture): Declare.
(set_tdesc_osabi): Declare.
* configure.tgt (i[34567]86-*-linux*): Add i386.o.
* i386-linux-tdep.c: Don't include ../features/i386/32bit-XXX.c.
include arch/i386.h.
(i386_linux_read_description): Remove code and call
i386_create_target_description.
(set_tdesc_architecture): New function.
(set_tdesc_osabi): New function.
* target-descriptions.h (allocate_target_description): Remove.

gdb/gdbserver:

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

* Makefile.in (arch-i386.o): New rule.
* configure.srv (i[34567]86-*-linux*): Add arch-i386.o.
(x86_64-*-linux*): Likewise.
* linux-x86-tdesc.c: Don't include ../features/i386/32bit-XXX.c,
include arch/i386.h.
(i386_linux_read_description): Remove code and call
i386_create_target_description.
* tdesc.c (allocate_target_description): New function.
* tdesc.h (set_tdesc_architecture): Remove declaration.
(set_tdesc_osabi): Likewise.

756aa67 2017-07-10 20:02:50 Yao Qi

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.

Note that this patch reuses target_desc.xmltarget a little bit, which is
to hold the XML contents dynamically generated in tdesc_get_features_xml.
However, it is not xfree'ed in ~target_desc, because we can't tell it is
from xstrdup or a literal string. Since we don't delete target_desc,
there is no memory leak yet. After we change all target descriptions to
the new style, target_desc.xmltarget is from xstrdup, then, we can safely
xfree it in ~target_desc.

gdb:

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

* arch/tdesc.h (tdesc_create_feature): Add an argument xml.
* target-descriptions.c (tdesc_create_feature): Likewise, and
adjust code.
* features/i386/32bit-avx.c: Re-generated.
* features/i386/32bit-avx512.c: Re-generated.
* features/i386/32bit-core.c: Re-generated.
* features/i386/32bit-linux.c: Re-generated.
* features/i386/32bit-mpx.c: Re-generated.
* features/i386/32bit-pkeys.c: Re-generated.
* features/i386/32bit-sse.c: Re-generated.

gdb/gdbserver:

2017-07-03 Yao Qi <yao.qi@linaro.org>

* linux-x86-tdesc.c: Don't include <inttypes.h>.
(i386_linux_read_description) [!IN_PROCESS_AGENT]: Call
set_tdesc_architecture and set_tdesc_osabi. Remove code setting
.xmltarget.
* 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 an argument.
* tdesc.h (struct target_desc) <features>: New field.
<arch, osabi>: New field.
(~target_desc): xfree features, arch, and osabi.
(target_desc::oerator==): Don't compare .xmltarget.
[!IN_PROCESS_AGENT] (set_tdesc_architecture): Declare.
(set_tdesc_osabi): Likewise.
(tdesc_get_features_xml): Likewise.

cf80899 2017-07-10 20:02:50 Yao Qi

[GDBserver] unit test to i386_tdesc

This patch adds a unit test in GDBserver to test dynamically created
target descriptions equal these pre-generated ones.

gdb/gdbserver:

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

* linux-x86-tdesc.c: Include selftest.h.
(i386_tdesc_test): New function.
(initialize_low_tdesc): Call register_self_test.
* tdesc.h: Include regdef.h.
(target_desc): Override operator == and !=.

gdb:

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

* regformats/regdef.h (struct reg): Override operator == and !=.

1f0a4b4 2017-07-10 20:02:49 Yao Qi

GDBserver self test

This patch uses GDB self test in GDBserver. The self tests are run if
GDBserver is started with option --selftest.

We decide to still reuse GDB's selftest in GDBserver, so this patch moves
selftest.{c,h} to common/, and use some #ifdef as few as I can.

gdb:

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

* NEWS: Mention GDBserver's new option "--selftest".
* Makefile.in (SFILES): Remove selftest.c, add common/selftest.c.
* selftest.c: Move it common/selftest.c.
* selftest.h: Move it common/selftest.h.

gdb/gdbserver:

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

* Makefile.in (OBS): Add selftest.o.
* configure.ac: AC_DEFINE GDB_SELF_TEST if $development.
* configure, config.in: Re-generated.
* server.c: Include common/sefltest.h.
(captured_main): Handle option --selftest.
(gdbserver_usage): Print usage for "--selftest".

gdb/testsuite:

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

* gdb.server/unittest.exp: New.

gdb/doc:

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

* gdb.texinfo (Server): Document "--selftest".

e4ef971 2017-07-10 20:02:49 Yao Qi

[GDBserver] Centralize tdesc for i386-linux

tdesc_i386_XXX_linux is used in many places in linux-x86-low.c and this
patch adds a new function i386_linux_read_description to return the right
tdesc according to xcr0. i386_linux_read_description is quite similar to
the counterpart in GDB, and the following patch will share the duplicated
code, so this patch adds arch/tdesc.h includes the declarations of various
tdesc apis which are used by the shared code. The generated c feature
files can include arch/tdesc.h only.

gdb/gdbserver:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* configure.srv (srv_tgtobj): Append linux-x86-tdesc.o.
(ipa_obj): Likewise.
* linux-i386-ipa.c: Include common/x86-xstate.h
(get_ipa_tdesc): Call i386_linux_read_description.
(initialize_low_tracepoint): Don't call init_registers_XXX
functions, call initialize_low_tdesc instead.
* linux-x86-low.c (x86_linux_read_description): Call
i386_linux_read_description.
(initialize_low_arch): Don't call init_registers_i386_XXX
functions, call initialize_low_tdesc.
* linux-x86-tdesc.c: New file.
* linux-x86-tdesc.h (x86_linux_tdesc): New X86_TDESC_LAST.
(i386_get_ipa_tdesc_idx): Declare.
(i386_get_ipa_tdesc): Declare.
(initialize_low_tdesc): Declare.

gdb:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* arch/tdesc.h: New file.
* regformats/regdat.sh: Generate code using tdesc_create_reg.
* target-descriptions.c: Update comments.
* target-descriptions.h: Include "arch/tdesc.h". Remove the
declarations.
* features/i386/32bit-avx.c: Re-generated.
* features/i386/32bit-avx512.c: Re-generated.
* features/i386/32bit-core.c: Re-generated.
* features/i386/32bit-linux.c: Re-generated.
* features/i386/32bit-mpx.c: Re-generated.
* features/i386/32bit-pkeys.c: Re-generated.
* features/i386/32bit-sse.c: Re-generated.

5a46d0a 2017-07-10 20:02:49 Yao Qi

Return X86_TDESC_MMX in x86_get_ipa_tdesc_idx

gdb/gdbserver:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* linux-x86-low.c (x86_get_ipa_tdesc_idx): Use X86_TDESC_MMX
instead of 0.

500e288 2017-07-10 20:02:49 Yao Qi

Use VEC for target_desc.reg_defs

Nowadays, target_desc.reg_defs is a pointer points to a pre-generated
array, which is not flexible. This patch changes it from an array
to a VEC so that GDBserver can create target descriptions dynamically
later. Instead of using pre-generated array, the -generated.c calls
VEC_safe_push to add each register to vector.

Since target_desc.reg_defs is used in IPA, we need to build common/vec.c
for IPA too.

gdb/gdbserver:

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

* Makefile.in (IPA_OBJS): Add vec-ipa.o
* regcache.c (get_thread_regcache): Use VEC_length.
(init_register_cache): Likewise.
(regcache_cpy): Likewise.
(registers_to_string): Iterate reg_defs via VEC_iterate.
(find_regno): Likewise.
(find_register_by_number): Use VEC_index.
(register_size): Call find_register_by_number.
(register_data): Call find_register_by_number.
(supply_regblock): Use VEC_length.
(regcache_raw_read_unsigned): Likewise.
* tdesc.c (init_target_desc): Iterate reg_defs via
VEC_iterate.
(default_description): Update initializer.
(copy_target_description): Don't update field num_registers.
* tdesc.h (struct target_desc) <reg_defs>: Change it to VEC.
<num_registers>: Remove.

gdb:

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

* regformats/regdat.sh: Update generated code.

ab87391 2017-07-10 20:02:48 Yao Qi

Adjust code generated by regformats/regdat.sh

regformats/regdat.sh generate some *-generated.c files when GDBserver
is built. Each .c file has some static variables, which are only used
within function init_registers_XXX, like this,

static struct reg regs_i386_linux[] = {
{ "eax", 0, 32 },
{ "ecx", 32, 32 },
...
};

static const char *expedite_regs_i386_linux[] = { "ebp", "esp", "eip", 0 };
static const char *xmltarget_i386_linux = "i386-linux.xml";

void
init_registers_i386_linux (void)
{
...
}

This patch moves these static variables' definitions to function
init_registers_XXX, so the generated files look like this,

void
init_registers_i386_linux (void)
{
static struct target_desc tdesc_i386_linux_s;
struct target_desc *result = &tdesc_i386_linux_s;
static struct reg regs_i386_linux[] = {
...
};

static const char *expedite_regs_i386_linux[] = { "ebp", "esp", "eip", 0 };
static const char *xmltarget_i386_linux = "i386-linux.xml";

...
}

We want GDBserver create target descriptions dynamically in each
init_registers_XXXX functions, so this patch moves all the related code
into function init_registers_XXXX, so that the following patch can easily
change function init_registers_XXXX to create target description
dynamically, rather than using current pre-generated array.

gdb:

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

* regformats/regdat.sh: Adjust code order.

c7a8fd9 2017-07-10 20:02:48 Yao Qi

Add "maint check xml-descriptions" to test builtin xml target descriptions

Now, GDB is able to dynamically create i386-linux target descriptions
from features, instead of using pre-generated target descriptions. These
pre-generated target descriptions are no longer used by GDB (note that
they are still used by GDBserver).

This patch add a new maint command "maint check xml-descriptions" to test
dynamically generated tdesc are identical to these generated from xml files.

v3:
- Update doc, swap the implementation of operator == and !=,
- Use filename_completer,
- Use tilde_expand,

gdb:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* cli/cli-cmds.c (maintenancechecklist): New variable.
* gdbcmd.h (maintenancechecklist): Declare it.
* i386-linux-tdep.c (_initialize_i386_linux_tdep) [GDB_SELF_TEST]:
Call i386_linux_read_description with different masks.
* maint.c (maintenance_check_command): New function.
(_initialize_maint_cmds): Call add_prefix_cmd.
* target-descriptions.c (tdesc_reg): override operator != and ==.
(tdesc_type): Likewise.
(tdesc_feature): Likewise.
(target_desc): Likewise.
[GDB_SELF_TEST] (selftests::record_xml_tdesc): New function.
(maintenance_check_xml_descriptions): New function.
(_initialize_target_descriptions) Add command "xml-descriptions".
* target-descriptions.h (selftests::record_xml_tdesc): Declare.

gdb/testsuite:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* gdb.gdb/unittest.exp: Invoke command
"maintenance check xml-descriptions".

gdb/doc:

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

* gdb.texinfo (Maintenance Commands): Document command
"maint check xml-descriptions".

d1d97c5 2017-07-10 20:02:48 Yao Qi

Lazily and dynamically create i386-linux target descriptions

Instead of using pre-generated target descriptions, this patch
changes GDB to lazily and dynamically create target descriptions
according to the target hardware capability (xcr0 in i386).
This support any combination of target features.

Some reg in target description has "regnum" attribute, so its register
number is got from the attribute value instead from sequential allocation.

<reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>

when target description is created, it should match the regnum, so this
patch adds a new field m_next_regnum to track it, if attribute number is
greater than the m_next_regnum, print the code to set register number
explicitly.

v3:
- Add sanity check, use error rather than gdb_assert, because it checks
GDB input (The invalid input shouldn't trigger gdb internal error).
- Add comments,

gdb:

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

* i386-linux-tdep.c: Don't include features/i386/i386-*linux.c.
Include features/i386/32bit-*.c.
(i386_linux_read_description): Generate target description if it
doesn't exist.
(_initialize_i386_linux_tdep): Don't call _initialize_tdesc_i386
functions.
* features/i386/32bit-linux.c: Re-generated.
* features/i386/32bit-sse.c: Likewise.
* target-descriptions.c (print_c_feature::visit): Print code to
set register number if needed.
(print_c_feature) <m_next_regnum>: New field.

f638606 2017-07-10 20:02:48 Yao Qi

Generate c for feature instead of tdesc

This patch changes Makefile and command "maint print c-files" so
that GDB can print c files for features instead target description.
Previously, we feed GDB a target description xml file, which generate
c files including multiple features.

With this patch, in Makefile, we wrap each feature xml file, and
create a temp target description which include only one feature.
Then, adjust the target description printer for them, and print
a c function for each given feature, so that we can use these
c functions later to create target description in a flexible way.

v3:
- Add comments,
- Use startswith,
- Rename CFILES with TDESC_CFILES,
- Split the code adding an optional argument in "maint print c-files",

gdb:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* features/Makefile (CFILES): Rename with TDESC_CFILES.
(FEATURE_XMLFILES): New.
(FEATURE_CFILES): New.
New rules.
(clean-cfiles): Remove generated c files.
* features/i386/32bit-avx.c: Generated.
* features/i386/32bit-avx512.c: Generated.
* features/i386/32bit-core.c: Generated.
* features/i386/32bit-linux.c: Generated.
* features/i386/32bit-mpx.c: Generated.
* features/i386/32bit-pkeys.c: Generated.
* features/i386/32bit-sse.c: Generated.
* target-descriptions.c: Include algorithm.
(tdesc_element_visitor): Add method visit_end.
(print_c_tdesc): Implement visit_end.
(print_c_tdesc:: m_filename_after_features): Move it to
protected.
(print_c_feature): New class.
(maint_print_c_tdesc_cmd): Use print_c_feature if XML file
name starts with "i386/32bit-".

9f4fad3 2017-07-10 20:02:47 Yao Qi

Use visitor pattern for "maint print c-tdesc"

Target description can be modeled as a tree, the target description
is the root node, features are children nodes, registers and types are
grand-children nodes. So command "maint print c-tdesc" in effect
traverse/visit each node, and print them in c. This can be
implemented by visitor pattern, this is the first reason. Secondly,
I want to this command prints c files in a different way for some
specific xml files, but still print c files the same way for the rest
of xml files. Third, I even want to print xml files from target
descriptions, so that GDBserver can use it to reply GDB's query
qXfer:features:read:target.xml.

gdb:

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

* target-descriptions.c (tdesc_element_visitor): New class.
(tdesc_element): New class.
(tdesc_reg): Inherit from tdesc_element.
(tdesc_reg::accept): New function.
(tdesc_type): Inherit from tdesc_element.
(tdesc_type::accept): New function.
(tdesc_feature): Inherit from tdesc_element.
(tdesc_feature::accept): New function.
(target_desc): Inherit from tdesc_element.
(target_desc::target_desc): New.
(target_desc::~target_desc): New.
(target_desc::accept): New.
(allocate_target_description): Use new.
(free_target_description): Use delete.
(print_c_tdesc): New class.
(maint_print_c_tdesc_cmd): Adjust.

* features/aarch64.c: Re-generated.
* features/arc-arcompact.c: Re-generated.
* features/arc-v2.c: Re-generated.
* features/arm/arm-with-iwmmxt.c: Re-generated.
* features/arm/arm-with-m.c: Re-generated.
* features/arm/arm-with-m-fpa-layout.c: Re-generated.
* features/arm/arm-with-m-vfp-d16.c: Re-generated.
* features/arm/arm-with-neon.c: Re-generated.
* features/arm/arm-with-vfpv2.c: Re-generated.
* features/arm/arm-with-vfpv3.c: Re-generated.
* features/i386/amd64-avx-avx512.c: Re-generated.
* features/i386/amd64-avx-avx512-linux.c: Re-generated.
* features/i386/amd64-avx.c: Re-generated.
* features/i386/amd64-avx-linux.c: Re-generated.
* features/i386/amd64-avx-mpx-avx512-pku.c: Re-generated.
* features/i386/amd64-avx-mpx-avx512-pku-linux.c: Re-generated.
* features/i386/amd64-avx-mpx.c: Re-generated.
* features/i386/amd64-avx-mpx-linux.c: Re-generated.
* features/i386/amd64.c: Re-generated.
* features/i386/amd64-linux.c: Re-generated.
* features/i386/amd64-mpx.c: Re-generated.
* features/i386/amd64-mpx-linux.c: Re-generated.
* features/i386/i386-avx-avx512.c: Re-generated.
* features/i386/i386-avx-avx512-linux.c: Re-generated.
* features/i386/i386-avx.c: Re-generated.
* features/i386/i386-avx-linux.c: Re-generated.
* features/i386/i386-avx-mpx-avx512-pku.c: Re-generated.
* features/i386/i386-avx-mpx-avx512-pku-linux.c: Re-generated.
* features/i386/i386-avx-mpx.c: Re-generated.
* features/i386/i386-avx-mpx-linux.c: Re-generated.
* features/i386/i386.c: Re-generated.
* features/i386/i386-linux.c: Re-generated.
* features/i386/i386-mmx.c: Re-generated.
* features/i386/i386-mmx-linux.c: Re-generated.
* features/i386/i386-mpx.c: Re-generated.
* features/i386/i386-mpx-linux.c: Re-generated.
* features/i386/x32-avx-avx512.c: Re-generated.
* features/i386/x32-avx-avx512-linux.c: Re-generated.
* features/i386/x32-avx.c: Re-generated.
* features/i386/x32-avx-linux.c: Re-generated.
* features/i386/x32.c: Re-generated.
* features/i386/x32-linux.c: Re-generated.
* features/microblaze.c: Re-generated.
* features/microblaze-with-stack-protect.c: Re-generated.
* features/mips64-dsp-linux.c: Re-generated.
* features/mips64-linux.c: Re-generated.
* features/mips-dsp-linux.c: Re-generated.
* features/mips-linux.c: Re-generated.
* features/nds32.c: Re-generated.
* features/nios2.c: Re-generated.
* features/nios2-linux.c: Re-generated.
* features/rs6000/powerpc-32.c: Re-generated.
* features/rs6000/powerpc-32l.c: Re-generated.
* features/rs6000/powerpc-403.c: Re-generated.
* features/rs6000/powerpc-403gc.c : Re-generated.
* features/rs6000/powerpc-405.c: Re-generated.
* features/rs6000/powerpc-505.c: Re-generated.
* features/rs6000/powerpc-601.c: Re-generated.
* features/rs6000/powerpc-602.c: Re-generated.
* features/rs6000/powerpc-603.c: Re-generated.
* features/rs6000/powerpc-604.c: Re-generated.
* features/rs6000/powerpc-64.c: Re-generated.
* features/rs6000/powerpc-64l.c: Re-generated.
* features/rs6000/powerpc-7400.c: Re-generated.
* features/rs6000/powerpc-750.c: Re-generated.
* features/rs6000/powerpc-860.c: Re-generated.
* features/rs6000/powerpc-altivec32.c: Re-generated.
* features/rs6000/powerpc-altivec32l.c: Re-generated.
* features/rs6000/powerpc-altivec64.c: Re-generated.
* features/rs6000/powerpc-altivec64l.c: Re-generated.
* features/rs6000/powerpc-cell32l.c: Re-generated.
* features/rs6000/powerpc-cell64l.c: Re-generated.
* features/rs6000/powerpc-e500.c: Re-generated.
* features/rs6000/powerpc-e500l.c: Re-generated.
* features/rs6000/powerpc-isa205-32l.c: Re-generated.
* features/rs6000/powerpc-isa205-64l.c: Re-generated.
* features/rs6000/powerpc-isa205-altivec32l.c: Re-generated.
* features/rs6000/powerpc-isa205-altivec64l.c: Re-generated.
* features/rs6000/powerpc-isa205-vsx32l.c: Re-generated.
* features/rs6000/powerpc-isa205-vsx64l.c: Re-generated.
* features/rs6000/powerpc-vsx32.c: Re-generated.
* features/rs6000/powerpc-vsx32l.c: Re-generated.
* features/rs6000/powerpc-vsx64.c: Re-generated.
* features/rs6000/powerpc-vsx64l.c: Re-generated.
* features/rs6000/rs6000.c: Re-generated.
* features/s390-linux32.c: Re-generated.
* features/s390-linux32v1.c: Re-generated.
* features/s390-linux32v2.c: Re-generated.
* features/s390-linux64.c: Re-generated.
* features/s390-linux64v1.c: Re-generated.
* features/s390-linux64v2.c: Re-generated.
* features/s390-te-linux64.c: Re-generated.
* features/s390-tevx-linux64.c: Re-generated.
* features/s390-vx-linux64.c: Re-generated.
* features/s390x-linux64.c: Re-generated.
* features/s390x-linux64v1.c: Re-generated.
* features/s390x-linux64v2.c: Re-generated.
* features/s390x-te-linux64.c: Re-generated.
* features/s390x-tevx-linux64.c: Re-generated.
* features/s390x-vx-linux64.c: Re-generated.
* features/sparc/sparc32-solaris.c: Re-generated.
* features/sparc/sparc64-solaris.c: Re-generated.
* features/tic6x-c62x.c: Re-generated.
* features/tic6x-c62x-linux.c: Re-generated.
* features/tic6x-c64x.c: Re-generated.
* features/tic6x-c64x-linux.c: Re-generated.
* features/tic6x-c64xp.c: Re-generated.
* features/tic6x-c64xp-linux.c: Re-generated.

f2e8f13 2017-07-10 20:02:47 Yao Qi

Centralize i386 linux target descriptions

This patch moves all the tdesc_i386*_linux target descriptions to a
function i386_linux_read_description, which returns the right target
description according to xcr0. This also remove the duplication in
getting target descriptions in corefile and native target.

v3: Add comment and remove an extra space.

gdb:

2017-04-27 Yao Qi <yao.qi@linaro.org>

* i386-linux-tdep.c (i386_linux_read_description): New function.
(i386_linux_core_read_description): Call
i386_linux_read_description.
* i386-linux-tdep.h (i386_linux_read_description): Declare.
(tdesc_i386_linux, tdesc_i386_mmx_linux): Remove declarations.
(tdesc_i386_avx_linux, tdesc_i386_mpx_linux): Likewise
(tdesc_i386_avx_mpx_linux, tdesc_i386_avx_avx512_linux): Likewise.
(tdesc_i386_avx_mpx_avx512_pku_linux): Likewise.
* x86-linux-nat.c (x86_linux_read_description): Call
i386_linux_read_description.

367d4a7 2017-07-10 20:02:47 Yao Qi

Add optional argument to command "maint prints c-tdesc"

Nowadays, we need two steps to print c files for xml target description,
that is, 1) read xml target description in, update the current tdesc,
2) visit the current tdesc, print the c file. It is unnecessary to
involve in current tdesc, and some validations in each gdbarch are
performed unnecessarily, which will reject some target descriptions if
they are missing some mandatory feature.

This patch adds an optional argument to "maint print c-tdesc", which
is an XML file target description, so that we can combine the two
steps above into one step, and don't have to involve in global current
tdesc.

gdb:

2017-06-30 Yao Qi <yao.qi@linaro.org>

* NEWS: Mention it.
* features/Makefile (%.c: %.xml): Pass the xml file name to
command "maint print c-tdesc".
* target-descriptions.c (maint_print_c_tdesc_cmd): Get file
name from 'arg'.

gdb/doc:

2017-06-30 Yao Qi <yao.qi@linaro.org>

* gdb.texinfo (Maintenance Commands): Document optional
argument of "maint print c-tdesc".

a35c5de 2017-07-10 20:02:47 Yao Qi

Class-fy target_desc

This patch adds ctor and dtor in target_desc.

gdb:

2017-06-30 Yao Qi <yao.qi@linaro.org>

* target-descriptions.c (target_desc): Add ctor and dtor. Do
in-class initialization.
(tdesc_create_feature): Call new instead of XCNEW.
(free_target_description): Ue delete.

060ec93 2017-07-10 20:02:46 Yao Qi

Improve doc about "maint print c-tdesc"

In my patch extending command "maint print c-tdesc"
(https://sourceware.org/ml/gdb-patches/2017-06/msg00286.html), Eli
raised some questions on the existing doc to this command. It is not
very clear, so this patch improves it. Eli approved it.

gdb/doc:

2017-06-30 Yao Qi <yao.qi@linaro.org>

* gdb.texinfo (Maintenance Commands): Improve the doc to
command "maint print c-tdesc".

77c501b 2017-07-10 20:00:35 Yao Qi

Re-generate i386/amd64-avx-avx512-linux.c and i386/amd64-avx-mpx-avx512-pku-linux.c

gdb:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* features/i386/amd64-avx-avx512-linux.c: Re-generated.
* features/i386/amd64-avx-mpx-avx512-pku-linux.c: Re-generated.

2e1e43e 2017-07-10 19:53:44 Yao Qi

Re-indent the code

gdb/gdbserver:

2017-07-10 Yao Qi <yao.qi@linaro.org>

* linux-x86-low.c (x86_linux_read_description): Re-indent the code.

3d99e81 2017-07-10 19:23:12 Anton Kolesov

Import setenv and unsetenv from gnulib

This patch supersedes
https://sourceware.org/ml/gdb-patches/2017-07/msg00009.html

---

Patch [1] broke a build on MinGW hosts, because MinGW doesn't provide POSIX
functions setenv () and unsetenv (). This can be fixed by using
implementations from gnulib.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a6c7d9c0

gdb/ChangeLog
yyyy-mm-dd Anton Kolesov <Anton.Kolesov@synopsys.com>

* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add setenv and
unsetenv.
* gnulib/aclocal.m4: Regenerate.
* gnulib/config.in: Regenerate.
* gnulib/configure: Regenerate.
* gnulib/import/Makefile.am: Regenerate.
* gnulib/import/Makefile.in: Regenerate.
* gnulib/import/m4/gnulib-cache.m4: Regenerate.
* gnulib/import/m4/gnulib-comp.m4: Regenerate.
* gnulib/import/m4/environ.m4: New file.
* gnulib/import/m4/setenv.m4: New file.
* gnulib/import/setenv.c: New file.
* gnulib/import/unsetenv.c: New file.

a074796 2017-07-10 09:00:41 GDB Administrator

Automatic date update in version.in