Thanks Shaiju for your reply.
I can have 2 different launches for Core_1 and Core_2. As earlier core_1 works fine. Now in case of 2nd instance, though ILaunchConfiguration instance store new value of port, uses the port value for Core_1.
ILaunchConfigurationType[] types = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
ILaunchConfigurationType confType = null;
for(int i=0;i<types.length;i++){
if(types[i].getName().equals("XYZ C/C++ Debugger"))
confType =
types[i];//System.out.println(types[i].getName());
}
ILaunchConfiguration config_4 = confType.newInstance(null, "Core_2");
ILaunchConfigurationWorkingCopy wc = config_4.getWorkingCopy();
Saving attributes like debug_mode, verbose_mode, hostname, port, etc. to wc.
config_4 = wc.doSave();
config_4.launch(ILaunchManager.DEBUG_MODE, new SubProgressMonitor(monitor, 50));
launch method here takes care of new debug session, setting runtime options, new target and new process
as shown below
if ( process != null ) {
iprocess = DebugPlugin.newProcess( launch, process, renderProcessLabel( exePath.toOSString() ), getDefaultProcessMap() );
}
CDIDebugModel.newDebugTarget( launch, project.getProject(), targets[i], renderTargetLabel( debugConfig ), iprocess, exeFile, true, false, stopSymbol, true );
But still for some reason its taking port value for core_1. Please suggest if I'm missing anything obvious here.
Thanks in
advance,
Vrushali.