This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use visitors for make_gdb_type
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>, Yao Qi <qiyaoltc at gmail dot com>
- Cc: Philipp Rudo <prudo at linux dot vnet dot ibm dot com>, Simon Marchi <simark at simark dot ca>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Mon, 5 Feb 2018 11:21:20 -0500
- Subject: Re: [PATCH] Use visitors for make_gdb_type
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <a06ab31b-0144-82fe-5d29-4e81016990d3@arm.com> <F07C9294-69B0-4735-A13E-5D8FF608C8C6@arm.com> <c54fb9a2-868e-8a91-ba90-66999e4be1de@simark.ca> <20180129102836.5d521e5f@ThinkPad> <707546ED-241F-4641-97A9-551C6FF0E7B4@arm.com> <edb69de1-bbbe-bf9f-78c9-c07237338d3c@ericsson.com> <CAH=s-PM4_JMM+-uctVGtj7t-+08HH-Af-qD_7f5TY1aeyVEWaw@mail.gmail.com> <0D465C5F-EA4D-4A6C-94C7-9EE3377CAE7E@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 2018-01-30 10:15 AM, Alan Hayward wrote:
>
>
>> On 29 Jan 2018, at 16:54, Yao Qi <qiyaoltc@gmail.com> wrote:
>>
>> On Mon, Jan 29, 2018 at 4:12 PM, Simon Marchi <simon.marchi@ericsson.com> wrote:
>>>
>>> That seems like unnecessary boilerplate to me. I really don't see why classes derived
>>> from tdesc_element_visitor have to implement methods for nodes they don't care about.
>>>
>>> I added Yao in CC so he can chime in.
>>
>> When I wrote tdesc_element_visitor, in my mind, it is an interface, so
>> I expect child
>> class implement all the methods, because at that moment, all methods are needed,
>> no empty methods. However, the situation changed a little bit, as per
>> Alan's needs,
>> part of the methods of tdesc_element_visitor are needed, and the rest of methods
>> are empty somewhere. I don't mind converting tdesc_element_visitor into a base
>> class which has all these methods empty as a default. That is fine to
>> me. By the
>> way, Alan's approach is fine to me as well :)
>>
>
> I’ve removed the extra class and replaced with default implementations in
> tdesc_element_visitor.
>
> All ok?
>
>
> Tested on a make check on x86 targets=all build with target board unix native-gdbserver.
> Built for power (because it does not use new target descriptions), but am unable to test.
Hi Alan,
This version LGTM.
Thanks,
Simon