Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: [cdt-dev] Custom Run in CDT Plugin

Hi Wyatt,

the comprehensive article about the launch framework would be a good starting point:
http://www.eclipse.org/articles/Article-Launch-Framework/launch.html

If you haven't already done so, you would probably have to declare an extension of org.eclipse.debug.ui.launchShortcuts and create your own implementation of ILaunchShortcut. A practical example of this is the implementation of the "Run As > Local C/C++ Application" action. Have a look in the plugin.xml (around line 100) of the org.eclipse.cdt.launch plugin and the class CApplicationLaunchShortcut (also found in that plugin).

To run binaries, CDT uses the launch framework (provided by org.eclipse.debug.core) and defines three custom launch configuration types (see plugin.xml of org.eclipse.cdt.launch). 

The top-level explanation is, that binaries are run by creating a launch configuration out of a launch configuration type. Depending on what you want to do, you could either use one of the launch configuration types provided by CDT or use your own. The nitty gritty stuff of launching the binary actually happens in the "LaunchDelegate", which is declared by the launch configuration type. Open the class hierarchy on AbstractCLaunchDelegate and explore from there.

Instantiating a new launch configuration involves getting the ILaunchManager from the DebugPlugin, getting a launch configuration type and getting a launch configuration working copy from the type. The process is a bit lengthy, but is explained very well in this article (for java but works analogous in CDT):
http://www.eclipse.org/articles/Article-Java-launch/launching-java.html

Hope this helps,
Elias.


> -----Ursprüngliche Nachricht-----
> Von: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] Im Auftrag von wspear
> Gesendet: Donnerstag, 27. Oktober 2005 01:30
> An: CDT General developers list.
> Betreff: [cdt-dev] Custom Run in CDT Plugin
> 
> Greetings,
> 
> I am working on a CDT plugin that will include a customized 
> run operation.  Ideally I would be able to select a binary 
> object via a popup menu (that is already done) and then the 
> plugin would generate and execute a new run configuration for 
> it.  I have not been able to locate the API for the CDT's run 
> system in the documentation.  If anyone could point me in the 
> right direction (documentation, samples, CDT source etc) I 
> would appreciate it.
> 
> -Wyatt Spear
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top