1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

Bug 478740: Remove Reverse Debug dialog preference

Change-Id: I2a7f668ebc50bac6047395e0ca0e4eb7668cc863
This commit is contained in:
Marc Khouzam 2016-02-22 21:21:12 -05:00
parent aff7275044
commit 9e5888fb37
11 changed files with 49 additions and 113 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2015 QNX Software Systems and others. * Copyright (c) 2004, 2016 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
@ -7,7 +7,6 @@
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* Intel Corporation - Added Reverse Debugging BTrace support
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.internal.ui; package org.eclipse.cdt.debug.internal.ui;
@ -37,6 +36,5 @@ public class CDebugUIPreferenceInitializer extends AbstractPreferenceInitializer
pstore.setDefault( ICDebugPreferenceConstants.PREF_DISASM_OPEN_SOURCE_NOT_FOUND, false ); pstore.setDefault( ICDebugPreferenceConstants.PREF_DISASM_OPEN_SOURCE_NOT_FOUND, false );
pstore.setDefault( ICDebugPreferenceConstants.PREF_DISASM_SHOW_INSTRUCTIONS, true ); pstore.setDefault( ICDebugPreferenceConstants.PREF_DISASM_SHOW_INSTRUCTIONS, true );
pstore.setDefault( ICDebugPreferenceConstants.PREF_DISASM_SHOW_SOURCE, true ); pstore.setDefault( ICDebugPreferenceConstants.PREF_DISASM_SHOW_SOURCE, true );
pstore.setDefault( ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, true );
} }
} }

View file

@ -12,8 +12,6 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS { public class Messages extends NLS {
public static String ReverseDebugging_Error; public static String ReverseDebugging_Error;
public static String ReverseDebugging_UndefinedTraceMethod; public static String ReverseDebugging_UndefinedTraceMethod;
public static String ReverseDebugging_HardwareTracingNotAvailable;
public static String ReverseDebugging_DoNotShowAgain;
public static String ReverseDebugging_ToggleHardwareTrace; public static String ReverseDebugging_ToggleHardwareTrace;
public static String ReverseDebugging_ToggleSoftwareTrace; public static String ReverseDebugging_ToggleSoftwareTrace;
public static String ReverseDebugging_ToggleReverseDebugging; public static String ReverseDebugging_ToggleReverseDebugging;

View file

@ -8,8 +8,6 @@
ReverseDebugging_Error=Error ReverseDebugging_Error=Error
ReverseDebugging_UndefinedTraceMethod=Undefined trace method for Reverse Debugging. ReverseDebugging_UndefinedTraceMethod=Undefined trace method for Reverse Debugging.
ReverseDebugging_HardwareTracingNotAvailable=Hardware Tracing Method not available, Reverse debugging is switched Off, please select another method
ReverseDebugging_DoNotShowAgain=Don't show this message again
ReverseDebugging_ToggleHardwareTrace=Toggle Hardware Trace ReverseDebugging_ToggleHardwareTrace=Toggle Hardware Trace
ReverseDebugging_ToggleSoftwareTrace=Toggle Software Trace ReverseDebugging_ToggleSoftwareTrace=Toggle Software Trace
ReverseDebugging_ToggleReverseDebugging=Toggle Reverse Debugging ReverseDebugging_ToggleReverseDebugging=Toggle Reverse Debugging

View file

@ -17,8 +17,6 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.model.IChangeReverseMethodHandler; import org.eclipse.cdt.debug.core.model.IChangeReverseMethodHandler;
import org.eclipse.cdt.debug.core.model.IChangeReverseMethodHandler.ReverseTraceMethod; import org.eclipse.cdt.debug.core.model.IChangeReverseMethodHandler.ReverseTraceMethod;
import org.eclipse.cdt.debug.core.model.IReverseToggleHandler; import org.eclipse.cdt.debug.core.model.IReverseToggleHandler;
import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.FileLocator;
@ -37,7 +35,6 @@ import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextService; import org.eclipse.debug.ui.contexts.IDebugContextService;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
@ -240,8 +237,7 @@ public class ReverseToggleCommandHandler extends DebugCommandHandler implements
new WorkbenchJob("") { //$NON-NLS-1$ new WorkbenchJob("") { //$NON-NLS-1$
@Override @Override
public IStatus runInUIThread(IProgressMonitor monitor) { public IStatus runInUIThread(IProgressMonitor monitor) {
boolean prop = CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean(ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE); if (request.getStatus() != null && request.getStatus().getCode() != 0) {
if (prop && request.getStatus() != null && request.getStatus().getCode() != 0) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
Shell activeShell = null; Shell activeShell = null;
if (window != null) { if (window != null) {
@ -249,16 +245,10 @@ public class ReverseToggleCommandHandler extends DebugCommandHandler implements
} else { } else {
activeShell = new Shell(PlatformUI.getWorkbench().getDisplay()); activeShell = new Shell(PlatformUI.getWorkbench().getDisplay());
} }
MessageDialogWithToggle dialogbox = new MessageDialogWithToggle(activeShell, Messages.ReverseDebugging_Error, MessageDialog dialogbox = new MessageDialog(activeShell, Messages.ReverseDebugging_Error,
null, Messages.ReverseDebugging_HardwareTracingNotAvailable, MessageDialog.QUESTION, null, request.getStatus().getMessage(), MessageDialog.ERROR,
new String[] {IDialogConstants.OK_LABEL}, 0, new String[] {IDialogConstants.OK_LABEL}, 0);
Messages.ReverseDebugging_DoNotShowAgain, false); dialogbox.open();
dialogbox.setPrefStore(CDebugUIPlugin.getDefault().getPreferenceStore());
dialogbox.setPrefKey(ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE);
if (dialogbox.open() == 0) {
boolean toggled = dialogbox.getToggleState();
CDebugUIPlugin.getDefault().getPreferenceStore().setValue(ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, !toggled);
}
} }
// Request re-evaluation of property "org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled" to update // Request re-evaluation of property "org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled" to update
// visibility of reverse stepping commands. // visibility of reverse stepping commands.

View file

@ -7,7 +7,6 @@
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* Intel Corporation - Added Reverse Debugging BTrace support
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.preferences; package org.eclipse.cdt.debug.internal.ui.preferences;
@ -51,9 +50,4 @@ public interface ICDebugPreferenceConstants {
* Boolean preference controlling whether the disassembly editor is be activated if the source file can't be found. * Boolean preference controlling whether the disassembly editor is be activated if the source file can't be found.
*/ */
public static final String PREF_DISASM_OPEN_SOURCE_NOT_FOUND = ICDebugUIConstants.PLUGIN_ID + ".disassembly.openSourceNotFound"; //$NON-NLS-1$ public static final String PREF_DISASM_OPEN_SOURCE_NOT_FOUND = ICDebugUIConstants.PLUGIN_ID + ".disassembly.openSourceNotFound"; //$NON-NLS-1$
/**
* Boolean preference controlling whether to display error dialog box when trace method is not available.
*/
public static final String PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE = ICDebugUIConstants.PLUGIN_ID + ".reversedebugpref.tracemethodNotAvailable"; //$NON-NLS-1$
} }

View file

@ -134,7 +134,7 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
// avoid the default dialog box from eclipse and we propagate the error // avoid the default dialog box from eclipse and we propagate the error
// with the plugin specific code of 1, here the ReverseToggleCommandHandler // with the plugin specific code of 1, here the ReverseToggleCommandHandler
// interprets it as, the selected trace method is not available // interprets it as, the selected trace method is not available
request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, null, null)); request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, Messages.GdbReverseDebugging_HardwareTracingNotAvailable, null));
} }
}); });
@ -143,7 +143,7 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
if (runControl_old != null) { if (runControl_old != null) {
if(fTraceMethod != ReverseTraceMethod.STOP_TRACE && fTraceMethod != ReverseTraceMethod.FULL_TRACE) { if(fTraceMethod != ReverseTraceMethod.STOP_TRACE && fTraceMethod != ReverseTraceMethod.FULL_TRACE) {
runControl_old.enableReverseMode(controlDmc, false, rm); // Swtich Off tracing runControl_old.enableReverseMode(controlDmc, false, rm); // Swtich Off tracing
request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, null, null)); request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, Messages.GdbReverseDebugging_HardwareTracingNotAvailable, null));
return; return;
} }
runControl_old.isReverseModeEnabled(controlDmc, runControl_old.isReverseModeEnabled(controlDmc,

View file

@ -48,6 +48,9 @@ public class Messages extends NLS {
public static String GdbDebugNewExecutableCommand_Select_Binary; public static String GdbDebugNewExecutableCommand_Select_Binary;
public static String GdbDebugNewExecutableCommand_Select_binary_and_specify_arguments; public static String GdbDebugNewExecutableCommand_Select_binary_and_specify_arguments;
public static String GdbReverseDebugging_HardwareTracingNotAvailable;
static { static {
// initialize resource bundle // initialize resource bundle
NLS.initializeMessages( Messages.class.getName(), Messages.class ); NLS.initializeMessages( Messages.class.getName(), Messages.class );

View file

@ -26,3 +26,5 @@ GdbDebugNewExecutableCommand_New_Executable_Prompt_Job=New Executable Prompt Job
GdbDebugNewExecutableCommand_Select_binaries_on_host_and_target=Select binaries on the host and the target and specify the arguments GdbDebugNewExecutableCommand_Select_binaries_on_host_and_target=Select binaries on the host and the target and specify the arguments
GdbDebugNewExecutableCommand_Select_Binary=Select Binary GdbDebugNewExecutableCommand_Select_Binary=Select Binary
GdbDebugNewExecutableCommand_Select_binary_and_specify_arguments=Select a binary and specify the arguments GdbDebugNewExecutableCommand_Select_binary_and_specify_arguments=Select a binary and specify the arguments
GdbReverseDebugging_HardwareTracingNotAvailable=Hardware Tracing Method not available, Reverse debugging is switched Off, please select another method

View file

@ -67,12 +67,11 @@ class MessagesForPreferences extends NLS {
/** @since 2.3 */ /** @since 2.3 */
public static String GdbDebugPreferencePage_use_rtti_label2; public static String GdbDebugPreferencePage_use_rtti_label2;
public static String ReverseDebugPreferencePage_1; public static String ReverseDebugPreferencePage_ReverseSettings;
public static String ReverseDebugPreferencePage_2; public static String ReverseDebugPreferencePage_SelectHardwareTracingMethod;
public static String ReverseDebugPreferencePage_3; public static String ReverseDebugPreferencePage_GDBPreference;
public static String ReverseDebugPreferencePage_4; public static String ReverseDebugPreferencePage_BranchTrace;
public static String ReverseDebugPreferencePage_6; public static String ReverseDebugPreferencePage_ProcessorTrace;
public static String ReverseDebugPreferencePage_8;
static { static {
// initialize resource bundle // initialize resource bundle

View file

@ -56,9 +56,8 @@ GdbDebugPreferencePage_GDB_debugger_dialog_title=GDB Debugger
GdbDebugPreferencePage_Non_stop_mode=Non-stop mode (Note: Requires non-stop GDB) GdbDebugPreferencePage_Non_stop_mode=Non-stop mode (Note: Requires non-stop GDB)
GdbDebugPreferencePage_Stop_on_startup_at=Stop on startup at: GdbDebugPreferencePage_Stop_on_startup_at=Stop on startup at:
ReverseDebugPreferencePage_1=Reverse Debug Settings ReverseDebugPreferencePage_ReverseSettings=Settings for Reverse Debugging
ReverseDebugPreferencePage_2=Show Error Dialog when Reverse Trace Method not available ReverseDebugPreferencePage_SelectHardwareTracingMethod=Hardware Tracing Method:
ReverseDebugPreferencePage_3=Select Hardware Tracing Method ReverseDebugPreferencePage_GDBPreference=GDB Preference
ReverseDebugPreferencePage_4=Use GDB preference ReverseDebugPreferencePage_BranchTrace=Branch Trace
ReverseDebugPreferencePage_6=Use Branch Trace ReverseDebugPreferencePage_ProcessorTrace=Processor Trace
ReverseDebugPreferencePage_8=Use Processor Trace

View file

@ -10,11 +10,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.preferences; package org.eclipse.cdt.dsf.gdb.internal.ui.preferences;
import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; 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.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditor; import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore;
@ -22,76 +19,34 @@ import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.IWorkbenchPreferencePage;
@SuppressWarnings("restriction")
public class ReverseDebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public class ReverseDebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
public ReverseDebugPreferencePage() { public ReverseDebugPreferencePage() {
super( GRID ); super( GRID );
IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store ); setPreferenceStore( store );
setDescription( MessagesForPreferences.ReverseDebugPreferencePage_1 ); setDescription( MessagesForPreferences.ReverseDebugPreferencePage_ReverseSettings );
} }
@Override @Override
protected void createFieldEditors() { protected void createFieldEditors() {
FieldEditor edit = new BooleanFieldEditor( FieldEditor edit = new RadioGroupFieldEditor(
ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE,
MessagesForPreferences.ReverseDebugPreferencePage_2, MessagesForPreferences.ReverseDebugPreferencePage_SelectHardwareTracingMethod,
getFieldEditorParent() ) { 1,
/** We are swapping the preference store since PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE is new String[][] {
* available with CDebugUIPlugin */ {MessagesForPreferences.ReverseDebugPreferencePage_GDBPreference, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE},
{MessagesForPreferences.ReverseDebugPreferencePage_BranchTrace, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE},
{MessagesForPreferences.ReverseDebugPreferencePage_ProcessorTrace, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE}
},
getFieldEditorParent() );
edit.fillIntoGrid( getFieldEditorParent(), 1 );
getPreferenceStore().setDefault( IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE,
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE );
addField( edit );
}
@Override @Override
protected void doStore() { public void init( IWorkbench workbench ) {
IPreferenceStore store = CDebugUIPlugin.getDefault().getPreferenceStore(); }
setPreferenceStore( store );
super.doStore();
store = GdbUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
}
@Override
protected void doLoadDefault() {
IPreferenceStore store = CDebugUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
super.doLoadDefault();
store = GdbUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
}
@Override
protected void doLoad() {
IPreferenceStore store = CDebugUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
super.doLoad();
store = GdbUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
}
};
IPreferenceStore store = CDebugUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
edit.fillIntoGrid( getFieldEditorParent(), 2 );
getPreferenceStore().setDefault(ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, true);
addField( edit );
store = GdbUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore( store );
edit = new RadioGroupFieldEditor(
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE
, MessagesForPreferences.ReverseDebugPreferencePage_3
,1
, new String[][] {
{MessagesForPreferences.ReverseDebugPreferencePage_4, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE},
{MessagesForPreferences.ReverseDebugPreferencePage_6, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE},
{MessagesForPreferences.ReverseDebugPreferencePage_8, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE}
}
, getFieldEditorParent() );
edit.fillIntoGrid( getFieldEditorParent(), 1 );
getPreferenceStore().setDefault(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE);
addField( edit );
}
@Override
public void init( IWorkbench workbench ) {
}
} }