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,

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

________________________________________
From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Vladimir Prus [vladimir@xxxxxxxxxxxxxxxx]
Sent: June 19, 2010 6:54 AM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] [DSF] Supporting new GDB commands

Hi,

suppose I've added a new GDB MI command, called -data-read-memory-in-much-better-way. I also
want to modify DSF to make use of that command when available, and I prefer to use -list-features
to determine whether the command is available -- without any user intervention at all. Could somebody
outline the steps I need to take to achieve that effect? I know what code to modify to actually use
that command instead of -data-read-memory, but I don't yet have big picture of DSF and don't know
where to add checks and how to communicate the result of those checks.

Thanks in advance,

--
Vladimir Prus
CodeSourcery
vladimir@xxxxxxxxxxxxxxxx
(650) 331-3385 x722
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top