@SuppressWarnings("deprecation")
private ILaunchConfiguration getVdmLaunchConfig(int port)
{
// ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType(VDM_LAUNCH_CONFIG_TYPE);// IVdmRtDebugConstants.ATTR_VDM_PROGRAM);
try
{
wc = configType.newInstance(null, launchManager.generateUniqueLaunchConfigurationNameFrom(project.getName()));
final String VDM_LAUNCH_CONFIG_PROJECT = "vdm_launch_config_project";
final String VDM_LAUNCH_CONFIG_MODULE = "vdm_launch_config_module";
final String VDM_LAUNCH_CONFIG_OPERATION = "vdm_launch_config_method";
final String VDM_LAUNCH_CONFIG_STATIC_OPERATION = "vdm_launch_config_static_method";
// final static String VDM_LAUNCH_CONFIG_EXPRESSION_SEPERATOR =
// "vdm_launch_config_expression_seperator";
final String VDM_LAUNCH_CONFIG_EXPRESSION = "vdm_launch_config_expression";
final String VDM_LAUNCH_CONFIG_DEFAULT = "vdm_launch_config_default";
// final String VDM_LAUNCH_CONFIG_IS_TRACE =
// "vdm_launch_config_is_trace";
// final String VDM_LAUNCH_CONFIG_REMOTE_CONTROL =
// "vdm_launch_config_remote_control_class";
// VDM RT LOG
final String VDM_LAUNCH_CONFIG_ENABLE_REALTIME_LOGGING = "vdm_launch_config_enable_realtime_logging";
final String VDM_LAUNCH_CONFIG_CREATE_COVERAGE = "vdm_launch_config_create_coverage";
final String VDM_LAUNCH_CONFIG_REMOTE_DEBUG = "vdm_launch_config_remote_debug";
// final String VDM_LAUNCH_CONFIG_VM_MEMORY_OPTION =
// "vdm_launch_config_memory_option";
final String VDM_LAUNCH_CONFIG_ENABLE_LOGGING = "vdm_launch_config_enable_logging";
final String VDM_LAUNCH_CONFIG_OVERRIDE_PORT = "vdm_launch_config_override_port";
wc.setAttribute(VDM_LAUNCH_CONFIG_PROJECT, project.getName());
// wc.setAttribute(VDM_LAUNCH_CONFIG_CREATE_COVERAGE, true);
wc.setAttribute(VDM_LAUNCH_CONFIG_DEFAULT, "AAA");
wc.setAttribute(VDM_LAUNCH_CONFIG_OPERATION, "AAA" + "()");
wc.setAttribute(VDM_LAUNCH_CONFIG_MODULE, "AAA");
wc.setAttribute(VDM_LAUNCH_CONFIG_EXPRESSION, "new AAA().AAA()");
wc.setAttribute(VDM_LAUNCH_CONFIG_STATIC_OPERATION, false);
wc.setAttribute(VDM_LAUNCH_CONFIG_ENABLE_LOGGING, showDebugInfo);
wc.setAttribute(VDM_LAUNCH_CONFIG_REMOTE_DEBUG, true);
wc.setAttribute(VDM_LAUNCH_CONFIG_OVERRIDE_PORT, port);
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PRE_CHECKS, true))// vdmProject.hasPrechecks())
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PRE_CHECKS, false);
}
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_POST_CHECKS, true))// vdmProject.hasPostchecks())
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_POST_CHECKS, false);
}
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_INV_CHECKS, true))// vdmProject.hasInvchecks())
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_INV_CHECKS, false);
}
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_DTC_CHECKS, true))// vdmProject.hasDynamictypechecks())
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_DTC_CHECKS, false);
}
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MEASURE_CHECKS, true))// vdmProject.hasMeasurechecks())
{
wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MEASURE_CHECKS, false);
}
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_GENERATE_COVERAGE, true))// vdmProject.hasMeasurechecks())
{
wc.setAttribute(VDM_LAUNCH_CONFIG_CREATE_COVERAGE, false);
}
if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_LOG_RT, true))// vdmProject.hasMeasurechecks())
{
wc.setAttribute(VDM_LAUNCH_CONFIG_ENABLE_REALTIME_LOGGING, false);
}
} catch (CoreException e)
{
DestecsDebugPlugin.logError("Failed to create vdm launch config", e);