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 138361 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]
Final fix
zpatch.txt (text/plain), 16.05 KB, created by
Marc Khouzam
on 2009-06-04 22:27:02 EDT
(
hide
)
Description:
Final fix
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2009-06-04 22:27:02 EDT
Size:
16.05 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >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.7 >diff -u -r1.7 GDBControl.java >--- src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java 4 Jun 2009 16:23:21 -0000 1.7 >+++ src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java 5 Jun 2009 02:16:23 -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.IGdbDebugPreferenceConstants; > 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$ >+ IGdbDebugPreferenceConstants.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.10 >diff -u -r1.10 GDBControl_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java 4 Jun 2009 16:23:22 -0000 1.10 >+++ src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java 5 Jun 2009 02:16:23 -0000 >@@ -30,12 +30,15 @@ > 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.IGdbDebugPreferenceConstants; > 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.gdb.service.GDBProcesses_7_0.ContainerStartedDMEvent; > 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 +64,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 +546,31 @@ > } > } > >+ /** @since 2.0 */ >+ @DsfServiceEventHandler >+ public void eventDispatched(ContainerStartedDMEvent e) { >+ setConnected(true); >+ } >+ >+ /** @since 2.0 */ >+ @DsfServiceEventHandler >+ public void eventDispatched(ContainerExitedDMEvent e) { >+ setConnected(false); >+ >+ if (Platform.getPreferencesService().getBoolean("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$ >+ IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, >+ true, null)) { >+ if (!isConnected() && >+ !(fMIBackend.getIsAttachSession() && >+ fMIBackend.getSessionType() == SessionType.REMOTE)) { >+ // If the last process we are debugging finishes, let's terminate GDB >+ // but not for a remote 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/service/GDBProcesses_7_0.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java,v >retrieving revision 1.8 >diff -u -r1.8 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 11 May 2009 15:27:25 -0000 1.8 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 5 Jun 2009 02:16:23 -0000 >@@ -850,9 +850,6 @@ > @DsfServiceEventHandler > public void eventDispatched(IStartedDMEvent e) { > if (e instanceof ContainerStartedDMEvent) { >- // This will increment the connect count >- fCommandControl.setConnected(true); >- > fContainerCommandCache.reset(); > } else { > fThreadCommandCache.reset(); >@@ -863,9 +860,6 @@ > @DsfServiceEventHandler > public void eventDispatched(IExitedDMEvent e) { > if (e instanceof ContainerExitedDMEvent) { >- // This will decrement the connect count >- fCommandControl.setConnected(false); >- > fContainerCommandCache.reset(); > } else { > fThreadCommandCache.reset(); >Index: src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java >diff -N src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.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 IGdbDebugPreferenceConstants { >+ >+ /** >+ * 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/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 5 Jun 2009 02:16:25 -0000 >@@ -10,8 +10,8 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.internal.ui.tracing; > >+import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; > 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; >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 5 Jun 2009 02:16:25 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.internal.ui.preferences; > >+import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; > import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; > import org.eclipse.jface.preference.IPreferenceStore; >@@ -22,5 +23,6 @@ > public void initializeDefaultPreferences() { > IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); > store.setDefault(IGdbDebugPreferenceConstants.PREF_TRACES_ENABLE, true); >+ store.setDefault(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true); > } > } >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 5 Jun 2009 02:16:25 -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.IGdbDebugPreferenceConstants > */ >+@Deprecated > public interface IGdbDebugPreferenceConstants { > > /** >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 5 Jun 2009 02:16:25 -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/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 5 Jun 2009 02:16:25 -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=Terminate GDB when last process exits >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 5 Jun 2009 02:16:25 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.internal.ui.preferences; > >+import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; > import org.eclipse.jface.preference.BooleanFieldEditor; > import org.eclipse.jface.preference.FieldEditorPreferencePage; >@@ -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( >+ BooleanFieldEditor boolField= new BooleanFieldEditor( > IGdbDebugPreferenceConstants.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( >+ IGdbDebugPreferenceConstants.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
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
Flags:
cdtdoug
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 234468
:
138293
| 138361