Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] [DSF] Supporting new GDB commands

 

> -----Original Message-----
> From: Vladimir Prus [mailto:vladimir@xxxxxxxxxxxxxxxx] 
> Sent: Wednesday, June 23, 2010 4:55 AM
> To: Marc Khouzam
> Cc: 'cdt-dev@xxxxxxxxxxx'
> Subject: Re: [cdt-dev] [DSF] Supporting new GDB commands
> 
> On Monday 21 June 2010 17:01:16 Marc Khouzam wrote:
> 
>  > > > 3- instantiate a new version of the CommandFactory for 
> > > debug sessions that can use the new command
> > > > 
> > > > I think #3 is the best.
> > > 
> > > I am not sure I follow #3. The new command is fairly 
> > > different to the old one both in options it
> > > accepts and in output it produces. 
> > 
> > Yes, if the command is different in input/output, you can't
> > use the CommandFactory.  It wasn't clear from your email
> > if the new command was similar or different in that respect.
> 
> It's pretty different.
> 
> > > I am also unsure why you suggest new versio nof 
> > > MemoryService. While the logic has to be different,
> > > it's logic for reading memory block, so it's relatively 
> > > localized. Why cannot existing MemoryService
> > > consult a boolean flag somewhere, and act accordingly? 
> > 
> > I wasn't sure if you wanted to do this in DSF-GDB or in
> > your own product.  For your own product, you'd have to 
> > have your own version of the MemoryService.
> > 
> > For DSF-GDB, we could enhance the current MemoryService
> > depending on the complexity of the change.
> 
> Sorry for not being clear. I've made a change in experimental
> branch of DSF in our repository. In general, we can carry this
> change forever locally, but I would like to have this change
> upstream.

I agree entirely.
Any company/individual that enhances DSF-GDB in a way that would
improve it for the community is encouraged to contribute those
changes, and we'll do our best to get them into CDT.

> > But it looks like the CommandFactory won't work in your case.
> > Changing the service may be the way to go.
> 
> Yes, changing the service seems like the way to go. However, could
> you, as essentially the main DSF support person now, give the roadmap
> for changing the service. Like:

I'm the point of contact for DSF-GDB.  The DSF framework itself
is Pawel's baby.  But in this case, we are dealing with DSF-GDB.

> - When the run -list-features
> - How to communicate the result to memory service?
> 
> Of course, it's possible to run -list-features from memory service
> itself, but:
> 
> - This will mean that in future, every single service will 
> emit -list-features, which smells bad

This is probably the simplest, but I agree it is not very nice.

> - I am not exactly clear on lifetime of services. In 
> particular, will a new
> instance of a service be *always* create when starting new 
> debug session?

Yes, each debug session has its own instance of a service and
it does not change.

> If that's the case, a single member variable inside 
> MemoryService will suffice to hold the result of -list-features.

Yes, that would work.  The problem is how to set this member
variable.

1- set it at the creation of the service.  
   We need to issue -list-features before we instantiate 
   the services (at least the ones that need that info)

2- set it sometime after the service has been created.  This would
   require each service needing the -list-features result to
   have one or more setter methods to update that new member var.

>From what I understood from you, we can run -list-features
once, at the start, before connecting to a target or starting
anything else.  It could be the first gdb command, right?

To do solution #1, you can add the use of -list-features in
the implementation of the IGDBControl service when that service
is first instantiatd (by ServicesLaunchSequence), after that,
each service that care about the result will need to have
access to it (probably by querying the IGDBControl service,
or maybe the IGDBControl will have put the data somewhere;
this is an implementation question).

To do do #2, you can add the use of -list-features as a new step
in FinalLaunchSequence, and then set each service that requires it.

That's what I can thing of without actually trying it out.

Marc


Back to the top