|
Lines 11-16
Link Here
|
| 11 |
* IBM Corporation |
11 |
* IBM Corporation |
| 12 |
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121) |
12 |
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121) |
| 13 |
* Sergey Prigogin (Google) |
13 |
* Sergey Prigogin (Google) |
|
|
14 |
* Mohamed Hussein (Mentor Graphics) - Add timeout for gdb commands (Bug 361934) |
| 14 |
*******************************************************************************/ |
15 |
*******************************************************************************/ |
| 15 |
package org.eclipse.cdt.dsf.gdb.launching; |
16 |
package org.eclipse.cdt.dsf.gdb.launching; |
| 16 |
|
17 |
|
|
Lines 28-33
Link Here
|
| 28 |
import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; |
29 |
import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent; |
| 29 |
import org.eclipse.cdt.dsf.datamodel.IDMContext; |
30 |
import org.eclipse.cdt.dsf.datamodel.IDMContext; |
| 30 |
import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext; |
31 |
import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext; |
|
|
32 |
import org.eclipse.cdt.dsf.debug.service.command.ICommandListener; |
| 31 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
33 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
| 32 |
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; |
34 |
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; |
| 33 |
import org.eclipse.cdt.dsf.gdb.actions.IConnect; |
35 |
import org.eclipse.cdt.dsf.gdb.actions.IConnect; |
|
Lines 38-43
Link Here
|
| 38 |
import org.eclipse.cdt.dsf.mi.service.CSourceLookup; |
40 |
import org.eclipse.cdt.dsf.mi.service.CSourceLookup; |
| 39 |
import org.eclipse.cdt.dsf.mi.service.IMIProcesses; |
41 |
import org.eclipse.cdt.dsf.mi.service.IMIProcesses; |
| 40 |
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; |
42 |
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; |
|
|
43 |
import org.eclipse.cdt.dsf.mi.service.command.TimeOutCommandListener; |
| 41 |
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; |
44 |
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; |
| 42 |
import org.eclipse.cdt.dsf.service.DsfServicesTracker; |
45 |
import org.eclipse.cdt.dsf.service.DsfServicesTracker; |
| 43 |
import org.eclipse.cdt.dsf.service.DsfSession; |
46 |
import org.eclipse.cdt.dsf.service.DsfSession; |
|
Lines 59-64
Link Here
|
| 59 |
|
62 |
|
| 60 |
private DsfServicesTracker fTracker; |
63 |
private DsfServicesTracker fTracker; |
| 61 |
private DsfSession fSession; |
64 |
private DsfSession fSession; |
|
|
65 |
private ICommandListener fCommandListener; |
| 62 |
|
66 |
|
| 63 |
/** |
67 |
/** |
| 64 |
* @since 4.0 |
68 |
* @since 4.0 |
|
Lines 75-80
Link Here
|
| 75 |
return new String[] { |
79 |
return new String[] { |
| 76 |
"stepInitializeFinalLaunchSequence", //$NON-NLS-1$ |
80 |
"stepInitializeFinalLaunchSequence", //$NON-NLS-1$ |
| 77 |
// Global GDB settings |
81 |
// Global GDB settings |
|
|
82 |
"stepSetCommandTimeout", //$NON-NLS-1$ |
| 78 |
"stepSetEnvironmentDirectory", //$NON-NLS-1$ |
83 |
"stepSetEnvironmentDirectory", //$NON-NLS-1$ |
| 79 |
"stepSetBreakpointPending", //$NON-NLS-1$ |
84 |
"stepSetBreakpointPending", //$NON-NLS-1$ |
| 80 |
"stepEnablePrettyPrinting", //$NON-NLS-1$ |
85 |
"stepEnablePrettyPrinting", //$NON-NLS-1$ |
|
Lines 151-156
Link Here
|
| 151 |
} |
156 |
} |
| 152 |
|
157 |
|
| 153 |
/** |
158 |
/** |
|
|
159 |
* Sets gdb command timeout if the {@link IGdbDebugPreferenceConstants#PREF_COMMAND_TIMEOUT_ENABLE} is enabled. |
| 160 |
* @since 4.1 |
| 161 |
*/ |
| 162 |
@Execute |
| 163 |
public void stepSetCommandTimeout(RequestMonitor requestMonitor) { |
| 164 |
if (Platform.getPreferencesService().getBoolean(GdbPlugin.PLUGIN_ID, |
| 165 |
IGdbDebugPreferenceConstants.PREF_COMMAND_TIMEOUT_ENABLE, true, null)) { |
| 166 |
fCommandListener = new TimeOutCommandListener(fCommandControl, requestMonitor); |
| 167 |
fCommandControl.addCommandListener(fCommandListener); |
| 168 |
} |
| 169 |
requestMonitor.done(); |
| 170 |
} |
| 171 |
|
| 172 |
/** |
| 173 |
* Removes the timeout listener. |
| 174 |
* @since 4.1 |
| 175 |
*/ |
| 176 |
@RollBack("stepSetCommandTimeout") |
| 177 |
public void rollBackSetCommandTimeout(RequestMonitor requestMonitor) { |
| 178 |
if (fCommandListener != null) { |
| 179 |
fCommandControl.removeCommandListener(fCommandListener); |
| 180 |
fCommandListener = null; |
| 181 |
} |
| 182 |
requestMonitor.done(); |
| 183 |
} |
| 184 |
|
| 185 |
/** |
| 154 |
* Specify GDB's working directory. |
186 |
* Specify GDB's working directory. |
| 155 |
* @since 4.0 |
187 |
* @since 4.0 |
| 156 |
*/ |
188 |
*/ |