diff options
Diffstat (limited to 'plugins')
3 files changed, 42 insertions, 20 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMainTab.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMainTab.java index 8357714ca..16eb5204d 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMainTab.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMainTab.java @@ -56,6 +56,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { private Button stop_at_main_button; private Button disconnect_on_ctx_exit; private Button terminal_button; + private Button filter_button; private Exception init_error; public void createControl(Composite parent) { @@ -227,17 +228,17 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { } private void createOptionButtons(Composite parent, int col_span) { - Composite terminal_comp = new Composite(parent, SWT.NONE); + Composite composite = new Composite(parent, SWT.NONE); GridLayout terminal_layout = new GridLayout(); terminal_layout.numColumns = 1; terminal_layout.marginHeight = 0; terminal_layout.marginWidth = 0; - terminal_comp.setLayout(terminal_layout); + composite.setLayout(terminal_layout); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = col_span; - terminal_comp.setLayoutData(gd); + composite.setLayoutData(gd); - attach_children_button = createCheckButton(terminal_comp, "Auto-attach process children"); + attach_children_button = createCheckButton(composite, "Auto-attach process children"); attach_children_button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent evt) { @@ -246,7 +247,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { }); attach_children_button.setEnabled(true); - stop_at_entry_button = createCheckButton(terminal_comp, "Stop at program entry"); + stop_at_entry_button = createCheckButton(composite, "Stop at program entry"); stop_at_entry_button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent evt) { @@ -255,7 +256,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { }); stop_at_entry_button.setEnabled(true); - stop_at_main_button = createCheckButton(terminal_comp, "Stop at 'main'"); + stop_at_main_button = createCheckButton(composite, "Stop at 'main'"); stop_at_main_button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent evt) { @@ -264,7 +265,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { }); stop_at_main_button.setEnabled(true); - disconnect_on_ctx_exit = createCheckButton(terminal_comp, "Disconnect when last debug context exits"); + disconnect_on_ctx_exit = createCheckButton(composite, "Disconnect when last debug context exits"); disconnect_on_ctx_exit.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent evt) { @@ -273,7 +274,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { }); disconnect_on_ctx_exit.setEnabled(true); - terminal_button = createCheckButton(terminal_comp, "Use pseudo-terminal for process standard I/O"); + terminal_button = createCheckButton(composite, "Use pseudo-terminal for process standard I/O"); terminal_button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent evt) { @@ -281,6 +282,15 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { } }); terminal_button.setEnabled(true); + + filter_button = createCheckButton(composite, "Hide debug contexts started by other debug sessions"); + filter_button.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + filter_button.setEnabled(true); } public void initializeFrom(ILaunchConfiguration config) { @@ -297,6 +307,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { stop_at_main_button.setSelection(config.getAttribute(TCFLaunchDelegate.ATTR_STOP_AT_MAIN, true)); disconnect_on_ctx_exit.setSelection(config.getAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, true)); terminal_button.setSelection(config.getAttribute(TCFLaunchDelegate.ATTR_USE_TERMINAL, true)); + filter_button.setSelection(config.getAttribute(TCFLaunchDelegate.ATTR_USE_CONTEXT_FILTER, true)); working_dir_text.setEnabled(!default_dir_button.getSelection()); } catch (Exception e) { @@ -327,6 +338,12 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { config.setAttribute(TCFLaunchDelegate.ATTR_STOP_AT_MAIN, stop_at_main_button.getSelection()); config.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, disconnect_on_ctx_exit.getSelection()); config.setAttribute(TCFLaunchDelegate.ATTR_USE_TERMINAL, terminal_button.getSelection()); + if (filter_button.getSelection()) { + config.removeAttribute(TCFLaunchDelegate.ATTR_USE_CONTEXT_FILTER); + } + else { + config.setAttribute(TCFLaunchDelegate.ATTR_USE_CONTEXT_FILTER, false); + } } /** @@ -496,7 +513,8 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab { config.setAttribute(TCFLaunchDelegate.ATTR_STOP_AT_MAIN, true); config.setAttribute(TCFLaunchDelegate.ATTR_DISCONNECT_ON_CTX_EXIT, true); config.setAttribute(TCFLaunchDelegate.ATTR_USE_TERMINAL, true); - config.setAttribute(TCFLaunchDelegate.ATTR_WORKING_DIRECTORY, (String)null); + config.removeAttribute(TCFLaunchDelegate.ATTR_USE_CONTEXT_FILTER); + config.removeAttribute(TCFLaunchDelegate.ATTR_WORKING_DIRECTORY); ITCFLaunchContext launch_context = TCFLaunchContext.getLaunchContext(null); if (launch_context != null) launch_context.setDefaults(getLaunchConfigurationDialog(), config); } diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLaunchDelegate.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLaunchDelegate.java index 5446a7f95..fbfec6d34 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLaunchDelegate.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLaunchDelegate.java @@ -68,7 +68,8 @@ public class TCFLaunchDelegate extends LaunchConfigurationDelegate { ATTR_FILES = ITCFConstants.ID_TCF_DEBUG_MODEL + ".Files", ATTR_PATH_MAP = ITCFConstants.ID_TCF_DEBUG_MODEL + ".PathMap", ATTR_MEMORY_MAP = ITCFConstants.ID_TCF_DEBUG_MODEL + ".MemoryMap", - ATTR_ATTACH_PATH = ITCFConstants.ID_TCF_DEBUG_MODEL + ".Attach"; + ATTR_ATTACH_PATH = ITCFConstants.ID_TCF_DEBUG_MODEL + ".Attach", + ATTR_USE_CONTEXT_FILTER = ITCFConstants.ID_TCF_DEBUG_MODEL + ".UseContextFilter"; public static final String FILES_CONTEXT_FULL_NAME = "Context", diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java index e0a6b9892..648409a14 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java @@ -278,10 +278,16 @@ public class TCFLaunch extends Launch { else { final ILaunchConfiguration cfg = getLaunchConfiguration(); + boolean use_context_filter = + getAttribute("attach_to_context") != null || + getAttribute("attach_to_process") != null || + cfg != null && cfg.getAttribute(TCFLaunchDelegate.ATTR_LOCAL_PROGRAM_FILE, "").length() > 0 || + cfg != null && cfg.getAttribute(TCFLaunchDelegate.ATTR_REMOTE_PROGRAM_FILE, "").length() > 0; + if (cfg != null) use_context_filter = cfg.getAttribute(TCFLaunchDelegate.ATTR_USE_CONTEXT_FILTER, use_context_filter); + if (use_context_filter) context_filter = new HashSet<String>(); + final IRunControl rc_service = getService(IRunControl.class); - if (rc_service != null) { - rc_service.addListener(rc_listener); - } + if (rc_service != null) rc_service.addListener(rc_listener); final IPathMap path_map_service = getService(IPathMap.class); if (path_map_service != null) { @@ -336,10 +342,9 @@ public class TCFLaunch extends Launch { } if (mode.equals(ILaunchManager.DEBUG_MODE)) { - String attach_to_context = getAttribute("attach_to_context"); - if (attach_to_context != null) { - context_filter = new HashSet<String>(); - context_filter.add(attach_to_context); + if (context_filter != null) { + String attach_to_context = getAttribute("attach_to_context"); + if (attach_to_context != null) context_filter.add(attach_to_context); } final IMemoryMap mem_map = channel.getRemoteService(IMemoryMap.class); if (mem_map != null) { @@ -783,7 +788,6 @@ public class TCFLaunch extends Launch { channel.terminate(error); } else { - context_filter = new HashSet<String>(); TCFLaunch.this.process = process; ps.addListener(prs_listener); onAttach(process); @@ -854,7 +858,6 @@ public class TCFLaunch extends Launch { }); } else { - context_filter = new HashSet<String>(); TCFLaunch.this.process = process; ps.addListener(prs_listener); onAttach(process); @@ -1207,7 +1210,7 @@ public class TCFLaunch extends Launch { } public void onAttach(ProcessContext ctx) { - context_filter.add(ctx.getID()); + if (context_filter != null) context_filter.add(ctx.getID()); attached_processes.put(ctx.getID(), ctx); readProcessStreams(ctx); } |