Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 138293 Details for
Bug 234468
[debug view][processes] There should be a preference to terminate debug session after the inferior process exits.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Adding preference
zpatch.txt (text/plain), 18.46 KB, created by
Marc Khouzam
on 2009-06-04 10:44:24 EDT
(
hide
)
Description:
Adding preference
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2009-06-04 10:44:24 EDT
Size:
18.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java,v >retrieving revision 1.13 >diff -u -r1.13 GDBRunControl_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java 30 Apr 2009 14:50:01 -0000 1.13 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0.java 4 Jun 2009 13:52:49 -0000 >@@ -174,6 +174,9 @@ > }); > } > >+ /** >+ * @since 2.0 >+ */ > @Override > public void canResume(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) { > if (fGdb.getSessionType() == SessionType.CORE) { >@@ -184,6 +187,10 @@ > super.canResume(context, rm); > } > >+ >+ /** >+ * @since 2.0 >+ */ > @Override > public void canSuspend(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) { > if (fGdb.getSessionType() == SessionType.CORE) { >@@ -193,7 +200,10 @@ > } > super.canSuspend(context, rm); > } >- >+ >+ /** >+ * @since 2.0 >+ */ > @Override > public void canStep(final IExecutionDMContext context, StepType stepType, final DataRequestMonitor<Boolean> rm) { > if (fGdb.getSessionType() == SessionType.CORE) { >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java,v >retrieving revision 1.6 >diff -u -r1.6 GDBRunControl.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java 19 Apr 2009 19:54:27 -0000 1.6 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl.java 4 Jun 2009 13:52:49 -0000 >@@ -189,6 +189,9 @@ > } > } > >+ /** >+ * @since 2.0 >+ */ > @Override > public void canResume(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) { > if (fGdb.getSessionType() == SessionType.CORE) { >@@ -199,6 +202,9 @@ > super.canResume(context, rm); > } > >+ /** >+ * @since 2.0 >+ */ > @Override > public void canSuspend(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) { > if (fGdb.getSessionType() == SessionType.CORE) { >@@ -209,6 +215,9 @@ > super.canSuspend(context, rm); > } > >+ /** >+ * @since 2.0 >+ */ > @Override > public void canStep(final IExecutionDMContext context, StepType stepType, final DataRequestMonitor<Boolean> rm) { > if (fGdb.getSessionType() == SessionType.CORE) { >Index: src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java,v >retrieving revision 1.5 >diff -u -r1.5 GDBControl.java >--- src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java 20 May 2009 13:45:58 -0000 1.5 >+++ src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java 4 Jun 2009 13:52:49 -0000 >@@ -29,6 +29,7 @@ > import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; > import org.eclipse.cdt.dsf.debug.service.command.ICommandControl; > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; >+import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; > import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; > import org.eclipse.cdt.dsf.gdb.service.IGDBBackend; >@@ -37,6 +38,7 @@ > import org.eclipse.cdt.dsf.mi.service.IMIProcesses; > import org.eclipse.cdt.dsf.mi.service.MIProcesses; > import org.eclipse.cdt.dsf.mi.service.IMIBackend.BackendStateChangedEvent; >+import org.eclipse.cdt.dsf.mi.service.MIProcesses.ContainerExitedDMEvent; > import org.eclipse.cdt.dsf.mi.service.MIProcesses.ContainerStartedDMEvent; > import org.eclipse.cdt.dsf.mi.service.command.AbstractCLIProcess; > import org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl; >@@ -59,6 +61,7 @@ > import org.eclipse.cdt.utils.pty.PTY; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.debug.core.DebugException; > import org.eclipse.debug.core.ILaunchConfiguration; >@@ -404,6 +407,17 @@ > } > } > >+ /** @since 2.0 */ >+ @DsfServiceEventHandler >+ public void eventDispatched(ContainerExitedDMEvent e) { >+ if (Platform.getPreferencesService().getBoolean("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$ >+ IGdbDebugConstants.PREF_AUTO_TERMINATE_GDB, >+ true, null)) { >+ // If the inferior finishes, let's terminate GDB >+ terminate(new RequestMonitor(getExecutor(), null)); >+ } >+ } >+ > public static class InitializationShutdownStep extends Sequence.Step { > public enum Direction { INITIALIZING, SHUTTING_DOWN } > >Index: src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java,v >retrieving revision 1.8 >diff -u -r1.8 GDBControl_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java 20 May 2009 13:45:58 -0000 1.8 >+++ src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java 4 Jun 2009 13:52:49 -0000 >@@ -30,12 +30,14 @@ > import org.eclipse.cdt.dsf.debug.service.command.ICommandControl; > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; > import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; >+import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; > import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; > import org.eclipse.cdt.dsf.gdb.service.GDBRunControl_7_0; > import org.eclipse.cdt.dsf.gdb.service.IGDBBackend; > import org.eclipse.cdt.dsf.gdb.service.IReverseRunControl; > import org.eclipse.cdt.dsf.gdb.service.SessionType; >+import org.eclipse.cdt.dsf.gdb.service.GDBProcesses_7_0.ContainerExitedDMEvent; > import org.eclipse.cdt.dsf.mi.service.IMIBackend; > import org.eclipse.cdt.dsf.mi.service.IMIProcesses; > import org.eclipse.cdt.dsf.mi.service.MIProcesses; >@@ -61,6 +63,7 @@ > import org.eclipse.cdt.utils.pty.PTY; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.debug.core.DebugException; > import org.eclipse.debug.core.ILaunchConfiguration; >@@ -542,6 +545,21 @@ > } > } > >+ /** @since 2.0 */ >+ @DsfServiceEventHandler >+ public void eventDispatched(ContainerExitedDMEvent e) { >+ if (Platform.getPreferencesService().getBoolean("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$ >+ IGdbDebugConstants.PREF_AUTO_TERMINATE_GDB, >+ true, null)) { >+ if (!isConnected() && !fMIBackend.getIsAttachSession()) { >+ // If the last process we are debugging finishes, let's terminate GDB >+ // but not for an attach session, since we could request to attach >+ // to another process >+ terminate(new RequestMonitor(getExecutor(), null)); >+ } >+ } >+ } >+ > public static class InitializationShutdownStep extends Sequence.Step { > public enum Direction { INITIALIZING, SHUTTING_DOWN } > >Index: src/org/eclipse/cdt/dsf/gdb/IGdbDebugConstants.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/IGdbDebugConstants.java >diff -N src/org/eclipse/cdt/dsf/gdb/IGdbDebugConstants.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/IGdbDebugConstants.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,40 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 Ericsson and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Ericsson - initial implementation >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.gdb; >+ >+import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+ >+ >+ >+/** >+ * @noimplement This interface is not intended to be implemented by clients. >+ * @since 2.0 >+ */ >+public interface IGdbDebugConstants { >+ >+ /** >+ * Boolean preference whether to enable GDB traces. Default is <code>true</code>. >+ */ >+ public static final String PREF_TRACES_ENABLE = "tracesEnable"; //$NON-NLS-1$ >+ >+ /** >+ * Boolean preference whether to automatically terminate GDB when the inferior exists. Default is <code>true</code>. >+ */ >+ public static final String PREF_AUTO_TERMINATE_GDB = "autoTerminateGdb"; //$NON-NLS-1$ >+ >+ /** >+ * Help prefixes. >+ */ >+ public static final String PREFIX = GdbPlugin.PLUGIN_ID + "."; //$NON-NLS-1$ >+ >+ public static final String PREFERENCE_PAGE= PREFIX + "preference_page_context"; //$NON-NLS-1$ >+} >+ >#P org.eclipse.cdt.dsf.gdb.ui >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java,v >retrieving revision 1.1 >diff -u -r1.1 MessagesForPreferences.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java 28 Feb 2009 08:26:30 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java 4 Jun 2009 13:52:50 -0000 >@@ -21,6 +21,8 @@ > public static String GdbDebugPreferencePage_description; > public static String GdbDebugPreferencePage_traces_label; > public static String GdbDebugPreferencePage_enableTraces_label; >+ public static String GdbDebugPreferencePage_termination_label; >+ public static String GdbDebugPreferencePage_autoTerminateGdb_label; > > static { > // initialize resource bundle >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java,v >retrieving revision 1.1 >diff -u -r1.1 GdbDebugPreferencePage.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java 28 Feb 2009 08:26:30 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java 4 Jun 2009 13:52:50 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.internal.ui.preferences; > >+import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; > import org.eclipse.jface.preference.BooleanFieldEditor; > import org.eclipse.jface.preference.FieldEditorPreferencePage; >@@ -41,7 +42,7 @@ > @Override > public void createControl(Composite parent) { > super.createControl(parent); >- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IGdbDebugPreferenceConstants.PREFERENCE_PAGE); >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IGdbDebugConstants.PREFERENCE_PAGE); > } > > @Override >@@ -51,22 +52,38 @@ > layout.marginWidth= 0; > parent.setLayout(layout); > >- Group tracesGroup= new Group(parent, SWT.NONE); >- tracesGroup.setText(MessagesForPreferences.GdbDebugPreferencePage_traces_label); >+ Group group= new Group(parent, SWT.NONE); >+ group.setText(MessagesForPreferences.GdbDebugPreferencePage_traces_label); > GridLayout groupLayout= new GridLayout(3, false); >- tracesGroup.setLayout(groupLayout); >- tracesGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ group.setLayout(groupLayout); >+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > >- BooleanFieldEditor traces= new BooleanFieldEditor( >- IGdbDebugPreferenceConstants.PREF_TRACES_ENABLE, >+ BooleanFieldEditor boolField= new BooleanFieldEditor( >+ IGdbDebugConstants.PREF_TRACES_ENABLE, > MessagesForPreferences.GdbDebugPreferencePage_enableTraces_label, >- tracesGroup); >+ group); > >- traces.fillIntoGrid(tracesGroup, 3); >- addField(traces); >+ boolField.fillIntoGrid(group, 3); >+ addField(boolField); >+ // need to set layout again >+ group.setLayout(groupLayout); >+ >+ group= new Group(parent, SWT.NONE); >+ group.setText(MessagesForPreferences.GdbDebugPreferencePage_termination_label); >+ groupLayout= new GridLayout(3, false); >+ group.setLayout(groupLayout); >+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ boolField= new BooleanFieldEditor( >+ IGdbDebugConstants.PREF_AUTO_TERMINATE_GDB, >+ MessagesForPreferences.GdbDebugPreferencePage_autoTerminateGdb_label, >+ group); > >+ boolField.fillIntoGrid(group, 3); >+ addField(boolField); > // need to set layout again >- tracesGroup.setLayout(groupLayout); >+ group.setLayout(groupLayout); >+ > } > > @Override >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/messages.properties,v >retrieving revision 1.1 >diff -u -r1.1 messages.properties >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/messages.properties 28 Feb 2009 08:26:30 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/messages.properties 4 Jun 2009 13:52:50 -0000 >@@ -10,5 +10,9 @@ > ############################################################################### > > GdbDebugPreferencePage_description=General settings for GDB Debugging >+ > GdbDebugPreferencePage_traces_label=Traces > GdbDebugPreferencePage_enableTraces_label=Enable GDB traces >+ >+GdbDebugPreferencePage_termination_label=Termination >+GdbDebugPreferencePage_autoTerminateGdb_label=Automatically terminate GDB when inferior exits >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/IGdbDebugPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/IGdbDebugPreferenceConstants.java,v >retrieving revision 1.1 >diff -u -r1.1 IGdbDebugPreferenceConstants.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/IGdbDebugPreferenceConstants.java 28 Feb 2009 08:26:30 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/IGdbDebugPreferenceConstants.java 4 Jun 2009 13:52:50 -0000 >@@ -16,7 +16,9 @@ > /** > * @noimplement This interface is not intended to be implemented by clients. > * @since 2.0 >+ * @deprecated Has been replaced with org.eclipse.cdt.dsf.gdb.IGdbDebugConstants > */ >+@Deprecated > public interface IGdbDebugPreferenceConstants { > > /** >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java,v >retrieving revision 1.1 >diff -u -r1.1 GdbPreferenceInitializer.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java 28 Feb 2009 08:26:30 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java 4 Jun 2009 13:52:50 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.internal.ui.preferences; > >+import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; > import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; > import org.eclipse.jface.preference.IPreferenceStore; >@@ -21,6 +22,7 @@ > @Override > public void initializeDefaultPreferences() { > IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); >- store.setDefault(IGdbDebugPreferenceConstants.PREF_TRACES_ENABLE, true); >+ store.setDefault(IGdbDebugConstants.PREF_TRACES_ENABLE, true); >+ store.setDefault(IGdbDebugConstants.PREF_AUTO_TERMINATE_GDB, true); > } > } >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/tracing/TracingConsoleManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracing/TracingConsoleManager.java,v >retrieving revision 1.1 >diff -u -r1.1 TracingConsoleManager.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/tracing/TracingConsoleManager.java 28 Feb 2009 08:26:31 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/tracing/TracingConsoleManager.java 4 Jun 2009 13:52:50 -0000 >@@ -10,8 +10,8 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.internal.ui.tracing; > >+import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; >-import org.eclipse.cdt.dsf.gdb.internal.ui.preferences.IGdbDebugPreferenceConstants; > import org.eclipse.cdt.dsf.gdb.launching.ITracedLaunch; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.ILaunch; >@@ -43,7 +43,7 @@ > GdbUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); > > IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); >- fTracingEnabled = store.getBoolean(IGdbDebugPreferenceConstants.PREF_TRACES_ENABLE); >+ fTracingEnabled = store.getBoolean(IGdbDebugConstants.PREF_TRACES_ENABLE); > > if (fTracingEnabled) { > toggleTracing(true); >@@ -104,7 +104,7 @@ > } > > public void propertyChange(PropertyChangeEvent event) { >- if (event.getProperty().equals(IGdbDebugPreferenceConstants.PREF_TRACES_ENABLE)) { >+ if (event.getProperty().equals(IGdbDebugConstants.PREF_TRACES_ENABLE)) { > fTracingEnabled = (Boolean)event.getNewValue(); > toggleTracing(fTracingEnabled); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 234468
:
138293
|
138361