Launch n times a Launch Configuration C/C++

87 views Asked by At

I need to launch n times a specific Launch Configurations C/C++ defined by the user, where i change every time the binary executed. How can i do this programmatically? It is possible? I think that it's possible to create n different Run Configuration, starting from originary one, each of which contains different binary and then use Launch Group to launch each run configuration. But i need a sort of External Tool that use a defined Run Configuration from user and then run it n times. The user can make only a C/C++ project e build it and obviously Run it. He have not to specify parameter n: the number of iteration is decided by me based on some informations.

1

There are 1 answers

2
Chandrayya G K On

Try:

  1. Export the launch configuration you want to invoke n times using File->Export wizard and select Run/Debug->Launch configuration
  2. Develop a plug-in which asks the user to enter number of times to launch and the launch configuration file to select. You have create a dialog here which imports the launch configuration files exported in step 1.
  3. Parse the launch configuration files (these are in xml format) and prepare the object of type ILaunchConfiguration and try to invoke the code below(This was copied from org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#handleLaunchPressed())

    ILaunchConfiguration config = fTabViewer.getOriginal();
    if (fTabViewer.isDirty() && fTabViewer.canSave()) {
        config = fTabViewer.handleApplyPressed();
    }
    if(config != null) {
        close();
        DebugUITools.launch(config, getMode());
    }