Community
Participate
Working Groups
DSF-GDB was originally meant to be and example of how to use DSF. It has grown to be extended itself but does not provide a detailed example of how to extend it. Furthermore, DSF-GDB allows to easily extends its services, but not so much is view model. The example should address all this and help define ways to improve extendibility.
I pushed a patch to gerrit that provides the beginnings of an example. It can help get some discussion going. Basically, it adds a new launch delegate to "C/C++ Applicaiton", which is called "Example GDB Extended Launch Delegate". Then it overrides different aspects of DSF-GDB. https://git.eclipse.org/r/#/c/30660/ I'd like to commit it and then have it updated by different people as DSF-GDB evolves. I'll leave it on Gerrit until I come back from vacation, but if someone wants to make changes to it, feel free.
I have committed to master the current version of this patch which shows how to extend quite a few things (see list below). So there is now a new plugin dsf-gdb/org.eclipse.cdt.examples.dsf.gdb which can evolve with new and better examples as DSF-GDB evolves. It can also be used to test how easy or hard it is to extend particular aspects. For example, doing this plugin showed me a limitation that led to opening and fixing Bug 455537. Current examples shown: 1- Define a new service: GDBExtendedService 2- Extend the FinalLaunchSequence with GdbExtendedFinalLaunchSequence_7_7 to: a) popup a dialog showing the GDB version b) always set 'pagination off' in GDB 3- Define a new launch delegate for CDT's "C/C++ Application" launch: GdbExtendedLaunchDelegate 4- Define a new launch to allow to override the view model: GdbExtendedLaunch 5- Extend the ServicesLaunchSequence to start the new service: GdbExtendedServicesLaunchSequence 6- Create a new MICommand: CLIGDBVersion 7- Extend the CommandFactory_6_8 with GdbExtendedCommandFactory_6_8 to: a) create the new CLIGDBVersion command b) prefix every dynamic-printf with [EX] 8- Extend GDBControl_7_7 with GDBExtendedControl_7_7 to use GdbExtendedFinalLaunchSequence_7_7 9- Extend GdbDebugServicesFactory with GdbExtendedDebugServicesFactory and GdbExtendedDebugServicesFactoryNS to: a) instantiate the new version of the Control service: GDBExtendedControl_7_7 b) instantiate the new service: IGDBExtendedFunctions 10- Extend the view model, GdbExtendedLaunchVMProvider, GdbExtendedThreadVMNode, GdbExtendedAdapterFactory, and GdbExtendedViewModelAdapter, to modify the label of each thread shown in the Debug view to use the word "DSP" instead of "Thread"
I've put a little blurb a the bottom of the Debug part of the N&N in case this can help people extending CDT.
I pushed an update to this because there was a collision between the launch tabs of the example plugin with the actual DSF-GDB plugin. I had forgotten to change the tab ids. Fix here committed here: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=a38c6c6d86de1ab4f7f026c3f5437ea8ddfffa6f
*** cdt git genie on behalf of Marc Khouzam *** Bug 441277 - Fix colliding tab ids in example plugin that extends DSF-GDB Change-Id: Iac8e2802e78db88d6fcf6e4ee048df1efacd6303 Signed-off-by: Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=a38c6c6d86de1ab4f7f026c3f5437ea8ddfffa6f