Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philipp Rudo <prudo@linux.vnet.ibm.com>
To: Alan Hayward <Alan.Hayward@arm.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,
	       "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	       nd <nd@arm.com>
Subject: Re: [PATCH v2 6/8] Create xml from target descriptions
Date: Thu, 25 Jan 2018 16:56:00 -0000	[thread overview]
Message-ID: <20180125175556.33b98409@ThinkPad> (raw)
In-Reply-To: <A06A559B-4878-44AD-81FD-CBA1A15512C9@arm.com>

On Thu, 25 Jan 2018 16:13:16 +0000
Alan Hayward <Alan.Hayward@arm.com> wrote:

> > On 25 Jan 2018, at 13:14, Philipp Rudo <prudo@linux.vnet.ibm.com> wrote:
> > 
> > 
> > i don't really like print_xml_feature::visit_pre being declared in arch/tdesc.h
> > with different implementations in target-descriptions.c and gdbserver/tdesc.c
> > while all other visit_* implementations are in arch/tdesc.c.  I would prefere
> > visit_pre being implemented in arch/tdesc.c, too.  Even when it means to add
> > some #ifdef GDBSERVER ... #else ... #endif blocks until there is a common tdesc.  
> 
> Thanks for the review!
> 
> A common print_xml_feature would require 4 ifdefs, which would be too messy.
> I’ll take a look see if I can communise the tdesc_architecture and tdesc_osabi
> interfaces - it should be fairly simple to do.
> Once done, I should be able to add a common print_xml_feature without any
> ifdefs. Hopefully.
> 

Having a common interface would be even better :)

> 
> > On 25 Jan 2018, at 15:44, Yao Qi <qiyaoltc@gmail.com> wrote:
> > 
> > Philipp Rudo <prudo@linux.vnet.ibm.com> writes:
> >   
> >> Same for tdesc_type::make_gdb_type (patch #5).  But here i would prefer to not
> >> even declare the method for GDBserver, i.e.
> >> 
> >> struct tdesc_type
> >> {
> >> 
> >>  [...]
> >> 
> >> #ifndef GDBSERVER
> >>  virtual type *make_gdb_type (struct gdbarch *gdbarch) const = 0;
> >> #endif
> >> };
> >> 
> >> The problem i see with implementing stubs calling error is that you cannot find
> >> out you made a mistake until you call the function during run-time.  This gives
> >> room to nasty bugs which could easily be prevented when there is a compile bug.  
> > 
> > 
> > make_gdb_type and gdbarch shouldn't be put into arch/tdesc.h at all, if
> > possible.  You can create an sub-class of tdesc_element_visitor in gdb
> > side, and create the gdb type by visiting these elements, like this,
> > 
> > class gdb_type_creator : public tdesc_element_visitor  
> ….
> 
> Nice idea. I can add an extra patch into the series to do this.

Yeah, Yao's solution is better than mine.

Oh i forgot to tell you, great series.

Philipp



  reply	other threads:[~2018-01-25 16:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  9:26 [PATCH v2 0/8] Remove XML files from gdbserver Alan Hayward
2018-01-24  9:26 ` [PATCH v2 1/8] Move tdesc header funcs to c file Alan Hayward
2018-01-24  9:27 ` [PATCH v2 2/8] Use tdesc_reg in gxdbserver tdesc Alan Hayward
2018-01-25 13:12   ` Philipp Rudo
2018-01-24  9:28 ` [PATCH v2 4/8] Move make_gdb_type functions within file Alan Hayward
2018-01-24  9:28 ` [PATCH v2 3/8] Use tdesc_feature in gdbserver tdesc Alan Hayward
2018-01-25 13:12   ` Philipp Rudo
2018-01-24  9:29 ` [PATCH v2 5/8] Use tdesc types " Alan Hayward
2018-01-25 13:13   ` Philipp Rudo
2018-01-29  7:28     ` Omair Javaid
2018-01-29 11:01       ` Alan Hayward
     [not found]         ` <20180129123042.4a1674d6@ThinkPad>
2018-01-29 15:52           ` Alan Hayward
2018-01-24  9:30 ` [PATCH v2 6/8] Create xml from target descriptions Alan Hayward
2018-01-25 13:14   ` Philipp Rudo
2018-01-25 15:45     ` Yao Qi
2018-01-25 16:13       ` Alan Hayward
2018-01-25 16:56         ` Philipp Rudo [this message]
2018-01-24  9:31 ` [PATCH v2 7/8]: Remove xml file references " Alan Hayward
2018-01-24  9:32 ` [PATCH v2 8/8] Remove xml files from gdbserver Alan Hayward
2018-01-24 10:57 ` [PATCH v2 0/8] Remove XML " Omair Javaid
2018-01-24 12:29   ` Alan Hayward
     [not found]     ` <CANW4E-30Q5zRPrA0Vqe648f4psPqPMUCmSADYRjTK292kZy_Ng@mail.gmail.com>
2018-01-24 18:53       ` Alan Hayward
2018-01-25 13:11 ` Philipp Rudo
2018-01-26 22:31   ` Omair Javaid
2018-01-29 16:28     ` Yao Qi
2018-01-29 17:13       ` Alan Hayward
2018-01-31 11:28         ` Alan Hayward
2018-01-29 18:18 ` Pedro Alves
2018-01-30 12:16   ` Alan Hayward

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=20180125175556.33b98409@ThinkPad \
    --to=prudo@linux.vnet.ibm.com \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    --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