diff options
author | Marc Khouzam | 2012-02-21 19:14:19 +0000 |
---|---|---|
committer | Marc Khouzam | 2012-03-06 14:23:34 +0000 |
commit | 49c5be791f23eb89f6db1ac86d8519fec0183f42 (patch) | |
tree | 5724ba271c180ffaf461c1b420282f39276d879f /debug | |
parent | 23a8adbdb7b4aa5a80d7d0cbd770efb1022b7b8c (diff) | |
download | org.eclipse.cdt-49c5be791f23eb89f6db1ac86d8519fec0183f42.tar.gz org.eclipse.cdt-49c5be791f23eb89f6db1ac86d8519fec0183f42.tar.xz org.eclipse.cdt-49c5be791f23eb89f6db1ac86d8519fec0183f42.zip |
Bug 370462: Improving the debug preferences - add support for different charsets and unify DSF and CDI debug preferences. Update to number format changes to avoid API breakage.
Diffstat (limited to 'debug')
9 files changed, 38 insertions, 34 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/.settings/.api_filters b/debug/org.eclipse.cdt.debug.core/.settings/.api_filters index 1c282854828..c528f9e508c 100644 --- a/debug/org.eclipse.cdt.debug.core/.settings/.api_filters +++ b/debug/org.eclipse.cdt.debug.core/.settings/.api_filters @@ -1,12 +1,5 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <component id="org.eclipse.cdt.debug.core" version="2"> - <resource path="src/org/eclipse/cdt/debug/core/ICDebugConstants.java" type="org.eclipse.cdt.debug.core.ICDebugConstants"> - <filter id="403853384"> - <message_arguments> - <message_argument value="org.eclipse.cdt.debug.core.ICDebugConstants"/> - </message_arguments> - </filter> - </resource> <resource path="src/org/eclipse/cdt/debug/core/sourcelookup/MappingSourceContainer.java" type="org.eclipse.cdt.debug.core.sourcelookup.MappingSourceContainer"> <filter id="643846161"> <message_arguments> diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java index e3894da28da..342b66ea275 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 QNX Software Systems and others. + * Copyright (c) 2000, 2011 QNX Software Systems 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 @@ -9,7 +9,6 @@ * QNX Software Systems - Initial API and implementation * Freescale Semiconductor - Address watchpoints, https://bugs.eclipse.org/bugs/show_bug.cgi?id=118299 * Patrick Chuong (Texas Instruments) - Update CDT ToggleBreakpointTargetFactory enablement (340177) - * Mathias Kunter - PREF_CHARSET has been renamed to PREF_WIDE_CHARSET (bug 370462) *******************************************************************************/ package org.eclipse.cdt.debug.core; @@ -503,7 +502,7 @@ public class CDebugUtils { private static CharsetDecoder fDecoder; public static CharsetDecoder getCharsetDecoder() { - String charsetName = CDebugCorePlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_WIDE_CHARSET); + String charsetName = CDebugCorePlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET); if (fDecoder == null || !fDecoder.charset().name().equals(charsetName)) { Charset charset = Charset.forName(charsetName); fDecoder = charset.newDecoder(); @@ -757,4 +756,4 @@ public class CDebugUtils { String customModel = System.getProperty(ICDebugConstants.PREF_TOGGLE_BREAKPOINT_MODEL_IDENTIFIER, null); return customModel != null && Boolean.valueOf(customModel); } -} +}
\ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java index 386035ec333..f9615fa3a67 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java @@ -40,16 +40,26 @@ public interface ICDebugConstants { /** * The charset to use for decoding char type strings. We however can't use the ID - * "character_set" here because that would break backwards compatibility. + * "character_set" here because that would break backwards compatibility as it was + * already used for wide charsets. + * @since 7.2 */ - public static final String PREF_CHARSET = PLUGIN_ID + "cDebug.non_wide_character_set"; //$NON-NLS-1$ - + public static final String PREF_DEBUG_CHARSET = PLUGIN_ID + "cDebug.non_wide_character_set"; //$NON-NLS-1$ + /** * The charset to use for decoding wchar_t type strings. We have to use the ID * "character_set" here so that we don't break backwards compatibility. * @since 7.2 */ - public static final String PREF_WIDE_CHARSET = PLUGIN_ID + "cDebug.character_set"; //$NON-NLS-1$ + public static final String PREF_DEBUG_WIDE_CHARSET = PLUGIN_ID + "cDebug.character_set"; //$NON-NLS-1$ + + /** + * Deprecated id for the charset used for decoding wchar_t type strings. + * Replaced by ICDebugConstants.PREF_WIDE_CHARSET. + * @deprecated + */ + @Deprecated + public static final String PREF_CHARSET = PLUGIN_ID + "cDebug.character_set"; //$NON-NLS-1$ /** * The identifier of the default expression format to use in the expressions @@ -117,6 +127,7 @@ public interface ICDebugConstants { * @deprecated Provided for compatibility reasons only. Use the default value * from the Preferences object instead. */ + @Deprecated public static final String DEF_CHARSET = "UTF-16"; //$NON-NLS-1$ /** diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebugCorePreferenceInitializer.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebugCorePreferenceInitializer.java index 7393a9a43f6..5c277a1eb42 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebugCorePreferenceInitializer.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebugCorePreferenceInitializer.java @@ -41,11 +41,11 @@ public class CDebugCorePreferenceInitializer extends AbstractPreferenceInitializ CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, ICDIFormat.NATURAL ); CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT, ICDIFormat.NATURAL ); CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, ICDIFormat.NATURAL ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_CHARSET, Charset.defaultCharset().name() ); + CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEBUG_CHARSET, Charset.defaultCharset().name() ); if (Platform.getOS().equals(Platform.OS_WIN32)) - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_WIDE_CHARSET, "UTF-16"); //$NON-NLS-1$ + CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEBUG_WIDE_CHARSET, "UTF-16"); //$NON-NLS-1$ else - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_WIDE_CHARSET, "UTF-32"); //$NON-NLS-1$ + CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEBUG_WIDE_CHARSET, "UTF-32"); //$NON-NLS-1$ CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_INSTRUCTION_STEP_MODE_ON, false ); } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CIndexedValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CIndexedValue.java index e6ca4898757..fb8c794528c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CIndexedValue.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CIndexedValue.java @@ -166,7 +166,7 @@ public class CIndexedValue extends AbstractCValue implements IIndexedValue { else if ( CVariableFormat.DECIMAL.equals( format ) ) return address.toString(); else if ( CVariableFormat.OCTAL.equals( format ) ) - return address.toOctalAddressString(); + return address.toHexAddressString(); else if ( CVariableFormat.BINARY.equals( format ) ) return address.toBinaryAddressString(); return null; diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java index eca33a16f55..de653eeb2b8 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java @@ -633,7 +633,7 @@ public class CValue extends AbstractCValue { else if ( CVariableFormat.DECIMAL.equals( format ) ) return address.toString(); else if ( CVariableFormat.OCTAL.equals( format ) ) - return address.toOctalAddressString(); + return address.toHexAddressString(); else if ( CVariableFormat.BINARY.equals( format ) ) return address.toBinaryAddressString(); return null; diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties index c60a7ff9ee3..15a35463bcd 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.properties +++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties @@ -68,7 +68,7 @@ RemoveAllGlobalsAction.tooltip=Remove All Global Variables CVariableFormatMenu.label=Format HexVariableFormatAction.label=Hexadecimal DecVariableFormatAction.label=Decimal -NaturalVariableFormatAction.label=Natural +NaturalVariableFormatAction.label=Default BinaryVariableFormatAction.label=Binary CDebugActionGroup.name=C/C++ Debug diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java index 36b018bc6ce..1569d6f0405 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 QNX Software Systems and others. + * Copyright (c) 2009, 2012 QNX Software Systems 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 @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Marc Khouzam (Ericsson) - Support for octal number format (bug 370462) *******************************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; @@ -40,10 +41,10 @@ public class NumberFormatsContribution extends CompoundContributionItem implemen private static final Map<CVariableFormat, String> FORMATS = new LinkedHashMap<CVariableFormat, String>(); static { - FORMATS.put(CVariableFormat.NATURAL, "Natural"); + FORMATS.put(CVariableFormat.NATURAL, "Default"); FORMATS.put(CVariableFormat.DECIMAL, "Decimal"); FORMATS.put(CVariableFormat.HEXADECIMAL, "Hexadecimal"); - //FORMATS.put(CVariableFormat.OCTAL, "Octal"); + FORMATS.put(CVariableFormat.OCTAL, "Octal"); FORMATS.put(CVariableFormat.BINARY, "Binary"); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java index 1960ddd60a5..a58f8e28671 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java @@ -180,18 +180,18 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr // Charset editors PreferenceStore ps = new PreferenceStore(); - ps.setDefault(ICDebugConstants.PREF_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultString(ICDebugConstants.PREF_CHARSET)); - ps.setValue(ICDebugConstants.PREF_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_CHARSET)); + ps.setDefault(ICDebugConstants.PREF_DEBUG_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultString(ICDebugConstants.PREF_DEBUG_CHARSET)); + ps.setValue(ICDebugConstants.PREF_DEBUG_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_DEBUG_CHARSET)); fCharsetEditor.setPreferenceStore(ps); fCharsetEditor.load(); - if (CDebugCorePlugin.getDefault().getPluginPreferences().isDefault(ICDebugConstants.PREF_CHARSET)) + if (CDebugCorePlugin.getDefault().getPluginPreferences().isDefault(ICDebugConstants.PREF_DEBUG_CHARSET)) fCharsetEditor.loadDefault(); - ps.setDefault(ICDebugConstants.PREF_WIDE_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultString(ICDebugConstants.PREF_WIDE_CHARSET)); - ps.setValue(ICDebugConstants.PREF_WIDE_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_WIDE_CHARSET)); + ps.setDefault(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultString(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET)); + ps.setValue(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET, CDebugCorePlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET)); fWideCharsetEditor.setPreferenceStore(ps); fWideCharsetEditor.load(); - if (CDebugCorePlugin.getDefault().getPluginPreferences().isDefault(ICDebugConstants.PREF_WIDE_CHARSET)) + if (CDebugCorePlugin.getDefault().getPluginPreferences().isDefault(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET)) fWideCharsetEditor.loadDefault(); // Others @@ -251,12 +251,12 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr // Create charset editor Composite charsetComposite = ControlFactory.createComposite(formatComposite, 1); - fCharsetEditor = new EncodingFieldEditor(ICDebugConstants.PREF_CHARSET, "", PreferenceMessages.getString( "CDebugPreferencePage.18" ), charsetComposite); //$NON-NLS-1$ //$NON-NLS-2$ + fCharsetEditor = new EncodingFieldEditor(ICDebugConstants.PREF_DEBUG_CHARSET, "", PreferenceMessages.getString( "CDebugPreferencePage.18" ), charsetComposite); //$NON-NLS-1$ //$NON-NLS-2$ fCharsetEditor.setPropertyChangeListener(getPropertyChangeListener()); // Create wide charset editor Composite wideCharsetComposite = ControlFactory.createComposite(formatComposite, 1); - fWideCharsetEditor = new EncodingFieldEditor(ICDebugConstants.PREF_WIDE_CHARSET, "", PreferenceMessages.getString( "CDebugPreferencePage.16" ), wideCharsetComposite); //$NON-NLS-1$ //$NON-NLS-2$ + fWideCharsetEditor = new EncodingFieldEditor(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET, "", PreferenceMessages.getString( "CDebugPreferencePage.16" ), wideCharsetComposite); //$NON-NLS-1$ //$NON-NLS-2$ fWideCharsetEditor.setPropertyChangeListener(getPropertyChangeListener()); } @@ -355,10 +355,10 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, getFormatId( fRegisterFormatCombo.getSelectionIndex() ) ); fCharsetEditor.store(); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue(ICDebugConstants.PREF_CHARSET, fCharsetEditor.getPreferenceStore().getString(ICDebugConstants.PREF_CHARSET)); + CDebugCorePlugin.getDefault().getPluginPreferences().setValue(ICDebugConstants.PREF_DEBUG_CHARSET, fCharsetEditor.getPreferenceStore().getString(ICDebugConstants.PREF_DEBUG_CHARSET)); fWideCharsetEditor.store(); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue(ICDebugConstants.PREF_WIDE_CHARSET, fWideCharsetEditor.getPreferenceStore().getString(ICDebugConstants.PREF_WIDE_CHARSET)); + CDebugCorePlugin.getDefault().getPluginPreferences().setValue(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET, fWideCharsetEditor.getPreferenceStore().getString(ICDebugConstants.PREF_DEBUG_WIDE_CHARSET)); CCorePlugin.getDefault().getPluginPreferences().setValue( CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, fShowBinarySourceFilesButton.getSelection() ); } |