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

Hi,

As far as I understand the purpose of using list-features is to have a "universal" command factory for the future GDB versions (of course it will not eliminate the need of having a command factory for MacOS for instance). So there is no need to use different command factories during a debugging session. Which makes #1 the best solution in my opinion. In the ideal world services would try to instantiate sub-services for supported features. Something similar is already done to support memory spaces.

Regards,
Mikhail

On 19/06/2010 10:19 AM, Marc Khouzam wrote:
Hi,

we haven't started using -list-features yet (but we really should), so I'm not sure what is
the best way to make use of it.  Off the top of my head you could

1- in the MemoryService, the first time you may want to use that command, use -list-features
and set a boolean based on the result, then use the proper -data-read-memory* command.

This is the simplest solution, but it not the nicest.  It may also go against the CommandFactory
model.  Something more elegant would be to either

2- instantiate a new version of the MemoryService for debug sessions that can use the new command

3- instantiate a new version of the CommandFactory for debug sessions that can use the new command

I think #3 is the best.

The problem is that to do that, you first need to use -list-features, and to do that, you actually have
to have instantiated the services (at least the ICommandControl).

Instead, you could actually run a 'gdb -ex -list-features' type of thing, before launching the real gdb instance.
This is what we do for 'gdb -version'.  Not very nice either, and I'm worried that won't even work
because you may have to connect to a remote target before using -list-features, right?

So, this seems to point to the fact that we need to be able to change the CommandFactory and/or
a Service instance during a debugging session.  That should be doable, but is not entirely trivial because
currently we keep pointers to the CommandFactory inside our services.  Instead, we would have to fetch
the current version each time, which is not that bad.

Makes sense?

Marc




Back to the top