mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 520580: Implement new-console support on Windows
A new checkbox on Windows only that starts inferiors in new window. Change-Id: If3efbe5e6b037e3b1c9528eed67068088702b0fe
This commit is contained in:
parent
b7b1d41f08
commit
b090f32e64
13 changed files with 258 additions and 38 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2012 QNX Software Systems and others.
|
* Copyright (c) 2008, 2017 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -24,6 +24,7 @@ import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
@ -60,6 +61,10 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
|
|
||||||
protected Button fUpdateThreadlistOnSuspend;
|
protected Button fUpdateThreadlistOnSuspend;
|
||||||
protected Button fDebugOnFork;
|
protected Button fDebugOnFork;
|
||||||
|
/**
|
||||||
|
* Checkbox for using GDB's new-console -- only displayed on Windows. Will be null if unsupported.
|
||||||
|
*/
|
||||||
|
private Button fExternalConsole;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A combo box to let the user choose if fast tracepoints should be used or not.
|
* A combo box to let the user choose if fast tracepoints should be used or not.
|
||||||
|
@ -101,6 +106,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
||||||
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_EXTERNAL_CONSOLE,
|
||||||
|
preferenceStore.getBoolean(IGdbDebugPreferenceConstants.PREF_EXTERNAL_CONSOLE));
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
|
||||||
|
|
||||||
|
@ -157,6 +164,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||||
boolean debugOnFork = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
boolean debugOnFork = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
||||||
|
boolean externalConsole = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_EXTERNAL_CONSOLE,
|
||||||
|
preferenceStore.getBoolean(IGdbDebugPreferenceConstants.PREF_EXTERNAL_CONSOLE));
|
||||||
|
|
||||||
if (fSolibBlock != null)
|
if (fSolibBlock != null)
|
||||||
fSolibBlock.initializeFrom(configuration);
|
fSolibBlock.initializeFrom(configuration);
|
||||||
|
@ -166,6 +175,9 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
fReverseCheckBox.setSelection(reverseEnabled);
|
fReverseCheckBox.setSelection(reverseEnabled);
|
||||||
fUpdateThreadlistOnSuspend.setSelection(updateThreadsOnSuspend);
|
fUpdateThreadlistOnSuspend.setSelection(updateThreadsOnSuspend);
|
||||||
fDebugOnFork.setSelection(debugOnFork);
|
fDebugOnFork.setSelection(debugOnFork);
|
||||||
|
if (fExternalConsole != null) {
|
||||||
|
fExternalConsole.setSelection(externalConsole);
|
||||||
|
}
|
||||||
|
|
||||||
updateTracepointModeFromConfig(configuration);
|
updateTracepointModeFromConfig(configuration);
|
||||||
|
|
||||||
|
@ -252,6 +264,10 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
fUpdateThreadlistOnSuspend.getSelection());
|
fUpdateThreadlistOnSuspend.getSelection());
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||||
fDebugOnFork.getSelection());
|
fDebugOnFork.getSelection());
|
||||||
|
if (fExternalConsole != null) {
|
||||||
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_EXTERNAL_CONSOLE,
|
||||||
|
fExternalConsole.getSelection());
|
||||||
|
}
|
||||||
|
|
||||||
if (fTracepointModeCombo != null) {
|
if (fTracepointModeCombo != null) {
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
|
@ -333,6 +349,9 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateThreadlistOnSuspend, GdbUIPlugin.PLUGIN_ID + ".update_threadlist_button_context"); //$NON-NLS-1$
|
PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateThreadlistOnSuspend, GdbUIPlugin.PLUGIN_ID + ".update_threadlist_button_context"); //$NON-NLS-1$
|
||||||
|
|
||||||
fDebugOnFork = addCheckbox(comp, LaunchUIMessages.getString("GDBDebuggerPage.Automatically_debug_forked_processes")); //$NON-NLS-1$
|
fDebugOnFork = addCheckbox(comp, LaunchUIMessages.getString("GDBDebuggerPage.Automatically_debug_forked_processes")); //$NON-NLS-1$
|
||||||
|
if (Platform.getOS().startsWith("win")) { //$NON-NLS-1$
|
||||||
|
fExternalConsole = addCheckbox(comp, LaunchUIMessages.getString("GDBDebuggerPage.use_new_console_for_process")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
createTracepointModeCombo(comp);
|
createTracepointModeCombo(comp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Copyright (c) 2003, 2016 QNX Software Systems and others.
|
# Copyright (c) 2003, 2017 QNX Software Systems and others.
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
# which accompanies this distribution, and is available at
|
# which accompanies this distribution, and is available at
|
||||||
|
@ -29,6 +29,7 @@ GDBDebuggerPage.reverse_Debuggingmodesoft=Software Reverse Debugging (detailed b
|
||||||
GDBDebuggerPage.reverse_Debuggingmodehard=Hardware Reverse Debugging (no details but faster)
|
GDBDebuggerPage.reverse_Debuggingmodehard=Hardware Reverse Debugging (no details but faster)
|
||||||
GDBDebuggerPage.update_thread_list_on_suspend=Force thread list update on suspend
|
GDBDebuggerPage.update_thread_list_on_suspend=Force thread list update on suspend
|
||||||
GDBDebuggerPage.Automatically_debug_forked_processes=Automatically debug forked processes (Note: Requires Multi Process GDB)
|
GDBDebuggerPage.Automatically_debug_forked_processes=Automatically debug forked processes (Note: Requires Multi Process GDB)
|
||||||
|
GDBDebuggerPage.use_new_console_for_process=Use external console for inferior (open a new console window for input/output)
|
||||||
GDBDebuggerPage.tracepoint_mode_label=Tracepoint mode:
|
GDBDebuggerPage.tracepoint_mode_label=Tracepoint mode:
|
||||||
GDBDebuggerPage.tracepoint_mode_fast=Fast
|
GDBDebuggerPage.tracepoint_mode_fast=Fast
|
||||||
GDBDebuggerPage.tracepoint_mode_normal=Normal
|
GDBDebuggerPage.tracepoint_mode_normal=Normal
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2012 Ericsson and others.
|
* Copyright (c) 2009, 2017 Ericsson and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -27,6 +27,7 @@ import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.IGdbUIConstants;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.IGdbUIConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.command.CustomTimeoutsMap;
|
import org.eclipse.cdt.dsf.gdb.service.command.CustomTimeoutsMap;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
import org.eclipse.jface.dialogs.TitleAreaDialog;
|
import org.eclipse.jface.dialogs.TitleAreaDialog;
|
||||||
import org.eclipse.jface.fieldassist.ControlDecoration;
|
import org.eclipse.jface.fieldassist.ControlDecoration;
|
||||||
|
@ -610,6 +611,16 @@ public class GdbDebugPreferencePage extends FieldEditorPreferencePage implements
|
||||||
enableNonStop.fillIntoGrid(group1, 3);
|
enableNonStop.fillIntoGrid(group1, 3);
|
||||||
addField(enableNonStop);
|
addField(enableNonStop);
|
||||||
|
|
||||||
|
if (Platform.getOS().startsWith("win")) { //$NON-NLS-1$
|
||||||
|
BooleanFieldEditor externalConsoleField = new BooleanFieldEditor(
|
||||||
|
IGdbDebugPreferenceConstants.PREF_EXTERNAL_CONSOLE,
|
||||||
|
MessagesForPreferences.GdbDebugPreferencePage_external_console,
|
||||||
|
group1);
|
||||||
|
|
||||||
|
externalConsoleField.fillIntoGrid(group1, 3);
|
||||||
|
addField(externalConsoleField);
|
||||||
|
}
|
||||||
|
|
||||||
group1.setLayout(groupLayout);
|
group1.setLayout(groupLayout);
|
||||||
|
|
||||||
final Group group2= new Group(parent, SWT.NONE);
|
final Group group2= new Group(parent, SWT.NONE);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2016 Ericsson and others.
|
* Copyright (c) 2009, 2017 Ericsson and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -66,6 +66,7 @@ class MessagesForPreferences extends NLS {
|
||||||
public static String GdbDebugPreferencePage_use_rtti_label1;
|
public static String GdbDebugPreferencePage_use_rtti_label1;
|
||||||
/** @since 2.3 */
|
/** @since 2.3 */
|
||||||
public static String GdbDebugPreferencePage_use_rtti_label2;
|
public static String GdbDebugPreferencePage_use_rtti_label2;
|
||||||
|
public static String GdbDebugPreferencePage_external_console;
|
||||||
|
|
||||||
public static String ReverseDebugPreferencePage_ReverseSettings;
|
public static String ReverseDebugPreferencePage_ReverseSettings;
|
||||||
public static String ReverseDebugPreferencePage_SelectHardwareTracingMethod;
|
public static String ReverseDebugPreferencePage_SelectHardwareTracingMethod;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Copyright (c) 2009, 2016 Ericsson and others.
|
# Copyright (c) 2009, 2017 Ericsson and others.
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
# which accompanies this distribution, and is available at
|
# which accompanies this distribution, and is available at
|
||||||
|
@ -36,6 +36,8 @@ GdbDebugPreferencePage_initialChildCountLimitForCollections_label=For collection
|
||||||
GdbDebugPreferencePage_use_rtti_label1=Display run-time type of variables
|
GdbDebugPreferencePage_use_rtti_label1=Display run-time type of variables
|
||||||
GdbDebugPreferencePage_use_rtti_label2=(Note: requires GDB 7.5 or higher)
|
GdbDebugPreferencePage_use_rtti_label2=(Note: requires GDB 7.5 or higher)
|
||||||
|
|
||||||
|
GdbDebugPreferencePage_external_console=Use external console for inferior (open a new console window for input/output)
|
||||||
|
|
||||||
GdbDebugPreferencePage_defaults_label=Debug Configurations Defaults
|
GdbDebugPreferencePage_defaults_label=Debug Configurations Defaults
|
||||||
GdbDebugPreferencePage_Delete_button=Delete
|
GdbDebugPreferencePage_Delete_button=Delete
|
||||||
GdbDebugPreferencePage_Invalid_timeout_value=Invalid timeout value
|
GdbDebugPreferencePage_Invalid_timeout_value=Invalid timeout value
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2015 Ericsson and others.
|
* Copyright (c) 2008, 2017 Ericsson and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -114,6 +114,12 @@ public class IGDBLaunchConfigurationConstants {
|
||||||
*/
|
*/
|
||||||
public static final String ATTR_DEBUGGER_DEBUG_ON_FORK = GdbPlugin.PLUGIN_ID + ".DEBUG_ON_FORK"; //$NON-NLS-1$
|
public static final String ATTR_DEBUGGER_DEBUG_ON_FORK = GdbPlugin.PLUGIN_ID + ".DEBUG_ON_FORK"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Launch configuration attribute key. Boolean value to set the 'new-console' GDB option.
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public static final String ATTR_DEBUGGER_EXTERNAL_CONSOLE = GdbPlugin.PLUGIN_ID + ".EXTERNAL_CONSOLE"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch configuration attribute key. The value is a String specifying the type of Tracepoint mode
|
* Launch configuration attribute key. The value is a String specifying the type of Tracepoint mode
|
||||||
* that should be used for this launch.
|
* that should be used for this launch.
|
||||||
|
@ -215,6 +221,12 @@ public class IGDBLaunchConfigurationConstants {
|
||||||
*/
|
*/
|
||||||
public static final boolean DEBUGGER_DEBUG_ON_FORK_DEFAULT = false;
|
public static final boolean DEBUGGER_DEBUG_ON_FORK_DEFAULT = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Launch configuration attribute value. The key is ATTR_DEBUGGER_EXTERNAL_CONSOLE.
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public static final boolean DEBUGGER_EXTERNAL_CONSOLE_DEFAULT = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Possible attribute value for the key is ATTR_DEBUGGER_TRACEPOINT_MODE.
|
* Possible attribute value for the key is ATTR_DEBUGGER_TRACEPOINT_MODE.
|
||||||
* Indicates that only normal tracepoints should be used.
|
* Indicates that only normal tracepoints should be used.
|
||||||
|
|
|
@ -126,6 +126,14 @@ public interface IGdbDebugPreferenceConstants {
|
||||||
*/
|
*/
|
||||||
public static final String PREF_USE_RTTI = PREFIX + "useRtti"; //$NON-NLS-1$
|
public static final String PREF_USE_RTTI = PREFIX + "useRtti"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean preference whether to use new-console. Default is
|
||||||
|
* {@link IGDBLaunchConfigurationConstants#DEBUGGER_EXTERNAL_CONSOLE_DEFAULT}
|
||||||
|
*
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public static final String PREF_EXTERNAL_CONSOLE = PREFIX + "externalConsole"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boolean preference whether to hide or not, the running threads in the debug view.
|
* Boolean preference whether to hide or not, the running threads in the debug view.
|
||||||
* Default is <code>false</code>.
|
* Default is <code>false</code>.
|
||||||
|
|
|
@ -36,6 +36,7 @@ public class GdbPreferenceInitializer extends AbstractPreferenceInitializer {
|
||||||
node.putBoolean(IGdbDebugPreferenceConstants.PREF_USE_INSPECTOR_HOVER, true);
|
node.putBoolean(IGdbDebugPreferenceConstants.PREF_USE_INSPECTOR_HOVER, true);
|
||||||
node.putBoolean(IGdbDebugPreferenceConstants.PREF_ENABLE_PRETTY_PRINTING, true);
|
node.putBoolean(IGdbDebugPreferenceConstants.PREF_ENABLE_PRETTY_PRINTING, true);
|
||||||
node.putBoolean(IGdbDebugPreferenceConstants.PREF_USE_RTTI, true);
|
node.putBoolean(IGdbDebugPreferenceConstants.PREF_USE_RTTI, true);
|
||||||
|
node.putBoolean(IGdbDebugPreferenceConstants.PREF_EXTERNAL_CONSOLE, IGDBLaunchConfigurationConstants.DEBUGGER_EXTERNAL_CONSOLE_DEFAULT);
|
||||||
node.putInt(IGdbDebugPreferenceConstants.PREF_INITIAL_CHILD_COUNT_LIMIT_FOR_COLLECTIONS, 100);
|
node.putInt(IGdbDebugPreferenceConstants.PREF_INITIAL_CHILD_COUNT_LIMIT_FOR_COLLECTIONS, 100);
|
||||||
node.put(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND, IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
|
node.put(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND, IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
|
||||||
node.put(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT, IGDBLaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT);
|
node.put(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT, IGDBLaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2011, 2015 Ericsson and others.
|
* Copyright (c) 2011, 2017 Ericsson and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -32,6 +32,7 @@ import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContex
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.command.ICommand;
|
import org.eclipse.cdt.dsf.debug.service.command.ICommand;
|
||||||
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
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.internal.GdbPlugin;
|
||||||
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
|
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
|
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
|
||||||
|
@ -41,12 +42,14 @@ import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess;
|
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakpoint;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakpoint;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowNewConsoleInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||||
import org.eclipse.cdt.utils.pty.PTY;
|
import org.eclipse.cdt.utils.pty.PTY;
|
||||||
import org.eclipse.cdt.utils.pty.PersistentPTY;
|
import org.eclipse.cdt.utils.pty.PersistentPTY;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -287,6 +290,44 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean externalConsoleDefault = Platform.getPreferencesService().getBoolean(GdbPlugin.PLUGIN_ID,
|
||||||
|
IGdbDebugPreferenceConstants.PREF_EXTERNAL_CONSOLE,
|
||||||
|
IGDBLaunchConfigurationConstants.DEBUGGER_EXTERNAL_CONSOLE_DEFAULT, null);
|
||||||
|
|
||||||
|
boolean externalConsole = CDebugUtils.getAttribute(fAttributes,
|
||||||
|
IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_EXTERNAL_CONSOLE,
|
||||||
|
externalConsoleDefault);
|
||||||
|
if (externalConsole) {
|
||||||
|
initializeExternalConsole(new ImmediateRequestMonitor(rm) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
if (isSuccess()) {
|
||||||
|
fPty = null;
|
||||||
|
rm.done();
|
||||||
|
} else {
|
||||||
|
initializePty(rm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
initializePty(rm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializeExternalConsole(final RequestMonitor rm) {
|
||||||
|
fCommandControl.queueCommand(fCommandFactory.createMIGDBShowNewConsole(getContainerContext()),
|
||||||
|
new ImmediateDataRequestMonitor<MIGDBShowNewConsoleInfo>(rm) {
|
||||||
|
@Override
|
||||||
|
protected void handleSuccess() {
|
||||||
|
fCommandControl.queueCommand(
|
||||||
|
fCommandFactory.createMIGDBSetNewConsole(getContainerContext(), true),
|
||||||
|
new ImmediateDataRequestMonitor<MIInfo>(rm));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializePty(final RequestMonitor rm) {
|
||||||
// Every other type of session that can get to this code, is starting a new process
|
// Every other type of session that can get to this code, is starting a new process
|
||||||
// and requires a pty for it.
|
// and requires a pty for it.
|
||||||
try {
|
try {
|
||||||
|
@ -315,7 +356,6 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
rm.done();
|
rm.done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 4.7
|
* @since 4.7
|
||||||
|
|
|
@ -130,6 +130,7 @@ import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetDisconnectedTraci
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetEnv;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetEnv;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetHostCharset;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetHostCharset;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetLanguage;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetLanguage;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetNewConsole;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetNonStop;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetNonStop;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetPagination;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetPagination;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetPrintObject;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetPrintObject;
|
||||||
|
@ -146,6 +147,7 @@ import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetTraceNotes;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetTraceUser;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetTraceUser;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBShowExitCode;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBShowExitCode;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBShowLanguage;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBShowLanguage;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBShowNewConsole;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBVersion;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBVersion;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIInferiorTTYSet;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIInferiorTTYSet;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIInfoOs;
|
import org.eclipse.cdt.dsf.mi.service.command.commands.MIInfoOs;
|
||||||
|
@ -217,6 +219,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIDataReadMemoryInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIDataWriteMemoryInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIDataWriteMemoryInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowExitCodeInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowExitCodeInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowLanguageInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowLanguageInfo;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowNewConsoleInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBVersionInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBVersionInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfoOsInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfoOsInfo;
|
||||||
|
@ -799,6 +802,11 @@ public class CommandFactory {
|
||||||
return new MIGDBSetLanguage(ctx, language);
|
return new MIGDBSetLanguage(ctx, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 5.4*/
|
||||||
|
public ICommand<MIInfo> createMIGDBSetNewConsole(IDMContext ctx, boolean isSet) {
|
||||||
|
return new MIGDBSetNewConsole(ctx, isSet);
|
||||||
|
}
|
||||||
|
|
||||||
public ICommand<MIInfo> createMIGDBSetNonStop(ICommandControlDMContext ctx, boolean isSet) {
|
public ICommand<MIInfo> createMIGDBSetNonStop(ICommandControlDMContext ctx, boolean isSet) {
|
||||||
return new MIGDBSetNonStop(ctx, isSet);
|
return new MIGDBSetNonStop(ctx, isSet);
|
||||||
}
|
}
|
||||||
|
@ -868,6 +876,11 @@ public class CommandFactory {
|
||||||
return new MIGDBShowExitCode(ctx);
|
return new MIGDBShowExitCode(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 5.4 */
|
||||||
|
public ICommand<MIGDBShowNewConsoleInfo> createMIGDBShowNewConsole(IDMContext ctx) {
|
||||||
|
return new MIGDBShowNewConsole(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
/** @since 4.3 */
|
/** @since 4.3 */
|
||||||
public ICommand<MIGDBShowLanguageInfo> createMIGDBShowLanguage(IDMContext ctx) {
|
public ICommand<MIGDBShowLanguageInfo> createMIGDBShowLanguage(IDMContext ctx) {
|
||||||
return new MIGDBShowLanguage(ctx);
|
return new MIGDBShowLanguage(ctx);
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2017 Kichwa Coders 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:
|
||||||
|
* Kichwa Coders - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.dsf.mi.service.command.commands;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -gdb-set new-console on|off
|
||||||
|
*
|
||||||
|
* Set whether to start in a new console or not
|
||||||
|
*
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public class MIGDBSetNewConsole extends MIGDBSet {
|
||||||
|
|
||||||
|
public MIGDBSetNewConsole(IDMContext ctx, boolean isSet) {
|
||||||
|
super(ctx, new String[] { "new-console", isSet ? "on" : "off" }); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2017 Kichwa Coders 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:
|
||||||
|
* Kichwa Coders - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.dsf.mi.service.command.commands;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIGDBShowNewConsoleInfo;
|
||||||
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* -gdb-show new-console
|
||||||
|
*
|
||||||
|
* @since 5.4
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MIGDBShowNewConsole extends MIGDBShow<MIGDBShowNewConsoleInfo> {
|
||||||
|
|
||||||
|
public MIGDBShowNewConsole(IDMContext ctx) {
|
||||||
|
super(ctx, new String[] { "new-console" }); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MIGDBShowNewConsoleInfo getResult(MIOutput miResult) {
|
||||||
|
return new MIGDBShowNewConsoleInfo(miResult);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2017 Kichwa Coders 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:
|
||||||
|
* Kichwa Coders - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public class MIGDBShowNewConsoleInfo extends MIInfo {
|
||||||
|
|
||||||
|
private Boolean fIsSet = null;
|
||||||
|
|
||||||
|
public MIGDBShowNewConsoleInfo(MIOutput record) {
|
||||||
|
super(record);
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void parse() {
|
||||||
|
if (isDone()) {
|
||||||
|
MIOutput out = getMIOutput();
|
||||||
|
MIResultRecord outr = out.getMIResultRecord();
|
||||||
|
if (outr != null) {
|
||||||
|
MIResult[] results = outr.getMIResults();
|
||||||
|
for (int i = 0; i < results.length; i++) {
|
||||||
|
String var = results[i].getVariable();
|
||||||
|
if (var.equals("value")) { //$NON-NLS-1$
|
||||||
|
MIValue value = results[i].getMIValue();
|
||||||
|
if (value instanceof MIConst) {
|
||||||
|
fIsSet = "on".equals(((MIConst) value).getString()); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return if child will launch in a new console, or <code>null</code> if
|
||||||
|
* new-console unsupported.
|
||||||
|
*/
|
||||||
|
public Boolean isSet() {
|
||||||
|
return fIsSet;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue