From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC 6/7] Lazily and dynamically create i386-linux target descriptions
Date: Fri, 19 May 2017 10:15:00 -0000 [thread overview]
Message-ID: <2688beca-29b9-6ab3-4281-a6c1070da177@redhat.com> (raw)
In-Reply-To: <86y3tu6vww.fsf@gmail.com>
On 05/18/2017 04:12 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>>> +
>>> + struct xml_and_mask array[] = {
>>> + { "i386/i386-linux.xml", X86_XSTATE_SSE_MASK },
>>> + { "i386/i386-mmx-linux.xml", X86_XSTATE_X87_MASK },
>>> + { "i386/i386-avx-linux.xml", X86_XSTATE_AVX_MASK },
>>> + { "i386/i386-mpx-linux.xml", X86_XSTATE_MPX_MASK },
>>> + { "i386/i386-avx-mpx-linux.xml", X86_XSTATE_AVX_MPX_MASK },
>>> + { "i386/i386-avx-avx512-linux.xml", X86_XSTATE_AVX_AVX512_MASK },
>>> + { "i386/i386-avx-mpx-avx512-pku-linux.xml",
>>> + X86_XSTATE_AVX_MPX_AVX512_PKU_MASK },
>>
>> About these xml files. Is your idea that:
>>
>> #1 - we remove these xml description files at some point, keeping only
>> the description fragments which are currently xi:included by the xml
>> files above?
>> #2 - or, we'll still continue adding new xml files and grow this
>> list here?
>> #3 - or, we'll keep the existing xml files as representative / legacy,
>> and use them in the unit tests going forward, just to make sure
>> the machinery builds correct descriptions?
>>
>> (I don't expect to answer to be #2, I just put it there for completeness.)
>
> In short, #2 and #3.
>
> IIUC, you are not against "continue adding new xml files" in #2, you are
> against that we have to maintain the list here as we add new xml files.
Well, I wasn't ever expecting we'd end up with #2. I guess I don't see
the point of going through all of this if we end up with having to add
manually-written xml descriptions covering all feature combinations, anyway?
I could see keeping the xml files pushed in the tree, but make them
generated instead? It could be gdb that generates them from that
xml_and_mask array. We'd share the code with gdbserver, so that gdbserver
would generate xml files on the fly to send to gdb.
Or we could do the generation completely outside gdb, with some file
describing the potential combinations (in spirit similar to that xml_and_mask
array), much like we generate the syscall xml files.
> Even we finished the transition for all ports to dynamic tdesc creation,
> we still need to add new xml files to features/ directory for new
> hardware features, because GDBserver needs them (regformats/*.dat need
> them). We may add i386/i386-avx-mpx-avx512-linux.xml, GDB
> doesn't need it, but GDBserver still needs it. Given we need to add
> such .xml file, it is better to grow the list so that we can do the
> test. So the answer is #2. Suppose one day, we don't need these XML
> files to generate regformats/*.dat for GDBserver, we can remove all
> i386-*linux.xml files except i386-avx-mpx-avx512-pku-linux.xml, but I
> still want to move them to somewhere in testsuite directory to keep them
> as tests. Then, it becomes #3.
OK. But if there's no plan to do the gdbserver side of the work,
I kind of call into question the more-complicated state we're getting
into, for an indeterminately long time.
> The purpose of this test is to make sure these lazily/dynamically
> created tdesc (using create_feature_org_gnu_gdb_XXX functions) equal to
> the tdesc created from XML files. The dynamic tdesc creation is still
> new, needs more tests.
>
> During the process that we change other targets (amd64, arm, mips, etc)
> to the dynamic tdesc creation, the lists like this are expected to be
> added for each target.
>
> When we finish the transition to dynamic tdesc creation for all ports,
> and dynamic tdesc creation is quite stable, we can remove all these
> tests and lists, but I prefer to keeping the tests.
I think most ports are not troublesome, WRT to explosion of
target description feature set combinations. Maybe a better approach
would be to fully transition an architecture all the way to
dynamic generation, gdb and gdbserver?
>
> Before we remove these tests and lists, we still need to update the
> lists when,
>
> 1) add a new port with target description, a new list should be added
> in its -tdep.c file.
> 2) add a new xml target description for the existing port,
>
> Let me think about how to generate this list instead of manually
> maintain this list.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-05-19 10:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 15:55 [RFC 0/7] Make GDB builtin target descriptions more flexible Yao Qi
2017-05-11 15:55 ` [RFC 7/7] Remove builtin tdesc_i386_*_linux Yao Qi
2017-05-16 12:02 ` Philipp Rudo
2017-05-17 15:46 ` Pedro Alves
2017-05-11 15:55 ` [RFC 6/7] Lazily and dynamically create i386-linux target descriptions Yao Qi
2017-05-11 18:14 ` John Baldwin
2017-05-11 21:03 ` Yao Qi
2017-05-17 15:43 ` Pedro Alves
2017-05-18 15:12 ` Yao Qi
2017-05-19 10:15 ` Pedro Alves [this message]
2017-05-19 14:27 ` Yao Qi
2017-05-11 15:55 ` [RFC 1/7] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c Yao Qi
2017-05-11 15:55 ` [RFC 3/7] Adjust the order of 32bit-linux.xml and 32bit-sse.xml in i386/i386-linux.xml Yao Qi
2017-05-11 15:55 ` [RFC 5/7] Centralize i386 linux target descriptions Yao Qi
2017-05-11 15:55 ` [RFC 2/7] Add unit test to builtin tdesc generated by xml Yao Qi
2017-05-16 12:00 ` Philipp Rudo
2017-05-16 15:46 ` Yao Qi
2017-05-17 9:09 ` Philipp Rudo
2017-05-17 16:06 ` Pedro Alves
2017-05-30 8:00 ` Philipp Rudo
2017-06-01 17:53 ` Philipp Rudo
2017-05-17 15:41 ` Pedro Alves
2017-05-18 9:54 ` Yao Qi
2017-05-18 11:34 ` Pedro Alves
2017-05-19 15:47 ` Yao Qi
2017-05-22 8:51 ` Yao Qi
2017-05-11 16:06 ` [RFC 0/7] Make GDB builtin target descriptions more flexible Eli Zaretskii
2017-05-11 20:56 ` Yao Qi
2017-05-11 20:55 ` [RFC 4/7] Share code in initialize_tdesc_ functions Yao Qi
2017-05-16 12:02 ` Philipp Rudo
2017-05-17 15:43 ` Pedro Alves
2017-05-18 11:21 ` 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=2688beca-29b9-6ab3-4281-a6c1070da177@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.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