mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-01 04:33:36 +02:00
Bug 365471: Explicitly set 'target-async off'
This commit is contained in:
parent
c1f0069b97
commit
5c70f146df
4 changed files with 95 additions and 9 deletions
|
@ -11,6 +11,7 @@
|
||||||
* IBM Corporation
|
* IBM Corporation
|
||||||
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
|
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
|
* Marc Khouzam (Ericsson) - No longer call method to check non-stop for GDB < 7.0 (Bug 365471)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.launching;
|
package org.eclipse.cdt.dsf.gdb.launching;
|
||||||
|
|
||||||
|
@ -79,7 +80,6 @@ public class FinalLaunchSequence extends ReflectionSequence {
|
||||||
"stepSetBreakpointPending", //$NON-NLS-1$
|
"stepSetBreakpointPending", //$NON-NLS-1$
|
||||||
"stepEnablePrettyPrinting", //$NON-NLS-1$
|
"stepEnablePrettyPrinting", //$NON-NLS-1$
|
||||||
"stepSourceGDBInitFile", //$NON-NLS-1$
|
"stepSourceGDBInitFile", //$NON-NLS-1$
|
||||||
"stepSetNonStop", //$NON-NLS-1$
|
|
||||||
"stepSetAutoLoadSharedLibrarySymbols", //$NON-NLS-1$
|
"stepSetAutoLoadSharedLibrarySymbols", //$NON-NLS-1$
|
||||||
"stepSetSharedLibraryPaths", //$NON-NLS-1$
|
"stepSetSharedLibraryPaths", //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -251,6 +251,9 @@ public class FinalLaunchSequence extends ReflectionSequence {
|
||||||
* Enable non-stop mode if requested.
|
* Enable non-stop mode if requested.
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
// Keep this method in this class for backwards-compatibility, although
|
||||||
|
// it is called only by sub-classes.
|
||||||
|
// It could be moved to FinalLaunchSequence_7_0, otherwise.
|
||||||
@Execute
|
@Execute
|
||||||
public void stepSetNonStop(final RequestMonitor requestMonitor) {
|
public void stepSetNonStop(final RequestMonitor requestMonitor) {
|
||||||
boolean isNonStop = CDebugUtils.getAttribute(
|
boolean isNonStop = CDebugUtils.getAttribute(
|
||||||
|
@ -280,7 +283,17 @@ public class FinalLaunchSequence extends ReflectionSequence {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
requestMonitor.done();
|
// Explicitly set target-async to off for all-stop mode.
|
||||||
|
fCommandControl.queueCommand(
|
||||||
|
fCommandFactory.createMIGDBSetTargetAsync(fCommandControl.getContext(), false),
|
||||||
|
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) {
|
||||||
|
@Override
|
||||||
|
protected void handleError() {
|
||||||
|
// We should only be calling this for GDB >= 7.0,
|
||||||
|
// but just in case, accept errors for older GDBs
|
||||||
|
requestMonitor.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2011 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:
|
||||||
|
* Marc Khouzam (Ericsson) - initial API and implementation (Bug 365471)
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.dsf.gdb.launching;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||||
|
import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
|
||||||
|
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass for GDB >= 7.0.
|
||||||
|
* This class currently sets non-stop mode, or makes
|
||||||
|
* sure target-async is off for all-stop.
|
||||||
|
*
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public class FinalLaunchSequence_7_0 extends FinalLaunchSequence {
|
||||||
|
|
||||||
|
public FinalLaunchSequence_7_0(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
|
||||||
|
super(session, attributes, rm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String[] getExecutionOrder(String group) {
|
||||||
|
if (GROUP_TOP_LEVEL.equals(group)) {
|
||||||
|
// Initialize the list with the base class' steps
|
||||||
|
// We need to create a list that we can modify, which is why we create our own ArrayList.
|
||||||
|
List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL)));
|
||||||
|
|
||||||
|
// Now insert our steps right after the initialization of the base class.
|
||||||
|
orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence") + 1, "stepInitializeFinalLaunchSequence_7_0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
|
// Note that stepSetNonStop is defined in the base class for backwards-compatibility
|
||||||
|
orderList.add(orderList.indexOf("stepSourceGDBInitFile") + 1, "stepSetNonStop"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
|
return orderList.toArray(new String[orderList.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the members of the FinalLaunchSequence_7_0 class.
|
||||||
|
* This step is mandatory for the rest of the sequence to complete.
|
||||||
|
*/
|
||||||
|
@Execute
|
||||||
|
public void stepInitializeFinalLaunchSequence_7_0(RequestMonitor rm) {
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Ericsson - initial API and implementation
|
* Ericsson - initial API and implementation
|
||||||
|
* Marc Khouzam (Ericsson) - Use new FinalLaunchSequence_7_0 as base class (Bug 365471)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.launching;
|
package org.eclipse.cdt.dsf.gdb.launching;
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@ import org.eclipse.core.runtime.Status;
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class FinalLaunchSequence_7_2 extends FinalLaunchSequence {
|
public class FinalLaunchSequence_7_2 extends FinalLaunchSequence_7_0 {
|
||||||
|
|
||||||
private IGDBControl fGdbControl;
|
private IGDBControl fGdbControl;
|
||||||
private DsfSession fSession;
|
private DsfSession fSession;
|
||||||
|
@ -56,7 +57,7 @@ public class FinalLaunchSequence_7_2 extends FinalLaunchSequence {
|
||||||
List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL)));
|
List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL)));
|
||||||
|
|
||||||
// Now insert our steps right after the initialization of the base class.
|
// Now insert our steps right after the initialization of the base class.
|
||||||
orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence") + 1, "stepInitializeFinalLaunchSequence_7_2"); //$NON-NLS-1$ //$NON-NLS-2$
|
orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_0") + 1, "stepInitializeFinalLaunchSequence_7_2"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
orderList.add(orderList.indexOf("stepSetBreakpointPending") + 1, "stepDetachOnFork"); //$NON-NLS-1$ //$NON-NLS-2$
|
orderList.add(orderList.indexOf("stepSetBreakpointPending") + 1, "stepDetachOnFork"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
return orderList.toArray(new String[orderList.size()]);
|
return orderList.toArray(new String[orderList.size()]);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
* Ericsson - New version for 7_0
|
* Ericsson - New version for 7_0
|
||||||
* Vladimir Prus (CodeSourcery) - Support for -data-read-memory-bytes (bug 322658)
|
* Vladimir Prus (CodeSourcery) - Support for -data-read-memory-bytes (bug 322658)
|
||||||
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
|
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
|
||||||
|
* Marc Khouzam (Ericsson) - Call new FinalLaunchSequence_7_0 (Bug 365471)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.service.command;
|
package org.eclipse.cdt.dsf.gdb.service.command;
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
|
import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
|
||||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||||
import org.eclipse.cdt.dsf.gdb.launching.FinalLaunchSequence;
|
import org.eclipse.cdt.dsf.gdb.launching.FinalLaunchSequence_7_0;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
|
import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceRecordSelectedChangedDMEvent;
|
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceRecordSelectedChangedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
|
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
|
||||||
|
@ -170,6 +171,7 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return fMIBackend.getId();
|
return fMIBackend.getId();
|
||||||
}
|
}
|
||||||
|
@ -179,10 +181,12 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
return fControlDmc;
|
return fControlDmc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICommandControlDMContext getContext() {
|
public ICommandControlDMContext getContext() {
|
||||||
return fControlDmc;
|
return fControlDmc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void terminate(final RequestMonitor rm) {
|
public void terminate(final RequestMonitor rm) {
|
||||||
if (fTerminated) {
|
if (fTerminated) {
|
||||||
rm.done();
|
rm.done();
|
||||||
|
@ -204,6 +208,7 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
// runnable will kill the task.
|
// runnable will kill the task.
|
||||||
final Future<?> forceQuitTask = getExecutor().schedule(
|
final Future<?> forceQuitTask = getExecutor().schedule(
|
||||||
new DsfRunnable() {
|
new DsfRunnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fMIBackend.destroy();
|
fMIBackend.destroy();
|
||||||
rm.done();
|
rm.done();
|
||||||
|
@ -246,6 +251,7 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public AbstractCLIProcess getCLIProcess() {
|
public AbstractCLIProcess getCLIProcess() {
|
||||||
return fCLIProcess;
|
return fCLIProcess;
|
||||||
}
|
}
|
||||||
|
@ -253,11 +259,13 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
/**
|
/**
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setTracingStream(OutputStream tracingStream) {
|
public void setTracingStream(OutputStream tracingStream) {
|
||||||
setMITracingStream(tracingStream);
|
setMITracingStream(tracingStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since 3.0 */
|
/** @since 3.0 */
|
||||||
|
@Override
|
||||||
public void setEnvironment(Properties props, boolean clear, RequestMonitor rm) {
|
public void setEnvironment(Properties props, boolean clear, RequestMonitor rm) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm);
|
CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm);
|
||||||
|
@ -285,6 +293,7 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
/**
|
/**
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void completeInitialization(final RequestMonitor rm) {
|
public void completeInitialization(final RequestMonitor rm) {
|
||||||
// We take the attributes from the launchConfiguration
|
// We take the attributes from the launchConfiguration
|
||||||
|
@ -321,10 +330,11 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
protected Sequence getCompleteInitializationSequence(Map<String, Object> attributes, RequestMonitorWithProgress rm) {
|
protected Sequence getCompleteInitializationSequence(Map<String, Object> attributes, RequestMonitorWithProgress rm) {
|
||||||
return new FinalLaunchSequence(getSession(), attributes, rm);
|
return new FinalLaunchSequence_7_0(getSession(), attributes, rm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**@since 4.0 */
|
/**@since 4.0 */
|
||||||
|
@Override
|
||||||
public List<String> getFeatures() {
|
public List<String> getFeatures() {
|
||||||
return fFeatures;
|
return fFeatures;
|
||||||
}
|
}
|
||||||
|
@ -468,9 +478,8 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
/**
|
/**
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public void enablePrettyPrintingForMIVariableObjects(
|
@Override
|
||||||
final RequestMonitor rm) {
|
public void enablePrettyPrintingForMIVariableObjects(RequestMonitor rm) {
|
||||||
|
|
||||||
queueCommand(
|
queueCommand(
|
||||||
getCommandFactory().createMIEnablePrettyPrinting(fControlDmc),
|
getCommandFactory().createMIEnablePrettyPrinting(fControlDmc),
|
||||||
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
|
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
|
||||||
|
@ -479,6 +488,7 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
||||||
/**
|
/**
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPrintPythonErrors(boolean enabled, RequestMonitor rm) {
|
public void setPrintPythonErrors(boolean enabled, RequestMonitor rm) {
|
||||||
|
|
||||||
String subCommand = "set python print-stack " + (enabled ? "on" : "off"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
String subCommand = "set python print-stack " + (enabled ? "on" : "off"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||||
|
|
Loading…
Add table
Reference in a new issue