Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

CDT/cdt-debug-dsf-gdb-extensibility

< CDT
Revision as of 06:21, 26 August 2010 by Marc.khouzam.gmail.com (Talk | contribs) (How to extend DSF-GDB)

How to extend DSF-GDB

Thanks to DSF, DSF-GDB can easily be extended by replacing/adding/removing different services. To do this one can create a custom service factory by:

  1. sub-class the DSF-GDB service you want to modify, or create your entirely new version.
  2. sub-class org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate and override GdbLaunchDelegate#newServiceFactory().
  3. sub-class org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory and override any services' creation method to instantiate your own version of the service. Other versions of GDB can also be handled in those services' creation methods.

In some cases where small changes are required to MI commands, overriding the entire service may be unnecessary. Instead, one can extend DSF-GDB's command factory. Do to this, one still requires a new services factory, but only to set the new command factory:

  1. sub-class any MI command class and its output class to add your changes. These are found in org.eclipse.cdt.dsf.mi.service.command.commands and org.eclipse.cdt.dsf.mi.service.command.output
  2. sub-class org.eclipse.cdt.dsf.mi.service.command.CommandFactory and override/add your necessary changes.
  3. sub-class org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate and override GdbLaunchDelegate#newServiceFactory().
  4. sub-class org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory and override GdbDebugServicesFactory#createCommandControl() to pass in your own command factory.

Requested improvements

This section lists the different use cases that the community would like to see addressed to allow for easier extensibility of DSF-GDB.

  • Allow FinalLaunchSequence to be easily overridden (bug 321084)
  • Allow to easily add a new service (ServicesLaunchSequence and ShutdownSequence)
  • Allow to override the use of -exec-run vs -exec-continue at startup (completed in bug 319257)

Back to the top