Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2010-03-10 21:22:39 +0000
committerKen Ryall2010-03-10 21:22:39 +0000
commit2776239295c14137f7365e61a9d55cc43a1d341a (patch)
treea97b631aebb69ea58e6c45c2a26aeaf3456b1d3c /dsf/org.eclipse.cdt.dsf.ui
parenta50a1925f2e3662d3923b3ed113ab26974b946cd (diff)
downloadorg.eclipse.cdt-2776239295c14137f7365e61a9d55cc43a1d341a.tar.gz
org.eclipse.cdt-2776239295c14137f7365e61a9d55cc43a1d341a.tar.xz
org.eclipse.cdt-2776239295c14137f7365e61a9d55cc43a1d341a.zip
Bug 303334, pref cleanup.
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.properties8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java15
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java41
4 files changed, 56 insertions, 14 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java
index cede6bb0711..68136db4131 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java
@@ -54,17 +54,23 @@ public final class DisassemblyMessages extends NLS {
public static String Disassembly_message_notConnected;
public static String Disassembly_log_error_locateFile;
public static String Disassembly_log_error_readFile;
+ public static String DisassemblyPreferencePage_addressFormatTooltip;
public static String DisassemblyPreferencePage_addressRadix;
public static String DisassemblyPreferencePage_showAddressRadix;
public static String DisassemblyPreferencePage_showSource;
+ public static String DisassemblyPreferencePage_showSourceTooltip;
public static String DisassemblyPreferencePage_showSymbols;
+ public static String DisassemblyPreferencePage_showSymbolsTooltip;
public static String DisassemblyPreferencePage_error_not_a_number;
public static String DisassemblyPreferencePage_error_negative_number;
public static String DisassemblyPreferencePage_radix_octal;
public static String DisassemblyPreferencePage_radix_decimal;
public static String DisassemblyPreferencePage_radix_hexadecimal;
public static String DisassemblyPreferencePage_showFunctionOffsets;
+ public static String DisassemblyPreferencePage_showFunctionOffsetsTooltip;
public static String DisassemblyPreferencePage_showAddress;
+ public static String DisassemblyPreferencePage_showAddressTooltip;
+ public static String DisassemblyPreferencePage_showRadixTooltip;
public static String DisassemblyIPAnnotation_primary;
public static String DisassemblyIPAnnotation_secondary;
public static String SourceReadingJob_name;
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.properties b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.properties
index 0d8a8d0294c..5fadaa7be94 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.properties
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.properties
@@ -39,17 +39,23 @@ Disassembly_message_notConnected=No debug context
Disassembly_log_error_locateFile=Unable to locate file:\
Disassembly_log_error_readFile=Cannot read source file:\
-DisassemblyPreferencePage_addressRadix=Address display format
+DisassemblyPreferencePage_addressFormatTooltip=Use this format for the instruction address
+DisassemblyPreferencePage_addressRadix=Address display format:
DisassemblyPreferencePage_showAddressRadix=Force radix prefixes
DisassemblyPreferencePage_showSource=Show source
+DisassemblyPreferencePage_showSourceTooltip=Show source code interleaved with instructions
DisassemblyPreferencePage_showSymbols=Show symbols
+DisassemblyPreferencePage_showSymbolsTooltip=Show symbols used by the instructions
DisassemblyPreferencePage_error_not_a_number=Not a valid number format
DisassemblyPreferencePage_error_negative_number=Address cannot be negative
DisassemblyPreferencePage_radix_octal=Octal
DisassemblyPreferencePage_radix_decimal=Decimal
DisassemblyPreferencePage_radix_hexadecimal=Hexadecimal
DisassemblyPreferencePage_showFunctionOffsets=Show function offsets
+DisassemblyPreferencePage_showFunctionOffsetsTooltip=Show offsets of addresses in a function
DisassemblyPreferencePage_showAddress=Show instruction address
+DisassemblyPreferencePage_showAddressTooltip=Show the address of each instruction
+DisassemblyPreferencePage_showRadixTooltip=Show '0x' with hexadecimal addresses
DisassemblyIPAnnotation_primary=Debug Current Instruction Pointer
DisassemblyIPAnnotation_secondary=Debug Call Stack
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
index 4ec87ca3b18..26b27d95550 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
+import static org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyUtils.getAddressText;
+import static org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyUtils.internalError;
+
import java.io.File;
import java.math.BigInteger;
import java.util.ArrayList;
@@ -21,6 +24,7 @@ import java.util.ListIterator;
import java.util.Map;
import org.eclipse.cdt.core.IAddress;
+import org.eclipse.cdt.debug.core.model.ISteppingModeTarget;
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyPosition;
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.ErrorPosition;
@@ -157,8 +161,6 @@ import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-import static org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyUtils.internalError;
-import static org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyUtils.getAddressText;
/**
* DisassemblyPart
*/
@@ -280,7 +282,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
public void partDeactivated(IWorkbenchPartReference partRef) {
}
public void partOpened(IWorkbenchPartReference partRef) {
- }
+ }
public void partHidden(IWorkbenchPartReference partRef) {
if (partRef.getPart(false) == DisassemblyPart.this) {
setActive(false);
@@ -1764,6 +1766,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
}
+ IAdaptable context = DebugUITools.getDebugContext();
+ if (context != null)
+ {
+ ISteppingModeTarget target= (ISteppingModeTarget) (context).getAdapter(ISteppingModeTarget.class);
+ target.enableInstructionStepping(true);
+ }
+
} else {
fGotoAddressPending= fFocusAddress= PC_UNKNOWN;
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java
index b41dcd46e39..f7164114675 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java
@@ -23,6 +23,8 @@ import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -48,6 +50,7 @@ public class DisassemblyPreferencePage extends PreferencePage implements IWorkbe
numberFieldChanged((Text)e.widget);
}
};
+ private Combo fAddressFormatCombo;
private final static String[] fcRadixItems = {
DisassemblyMessages.DisassemblyPreferencePage_radix_octal,
DisassemblyMessages.DisassemblyPreferencePage_radix_decimal,
@@ -83,7 +86,7 @@ public class DisassemblyPreferencePage extends PreferencePage implements IWorkbe
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
- layout.numColumns = 2;
+ layout.numColumns = 3;
composite.setLayout(layout);
composite.setFont(parent.getFont());
@@ -94,23 +97,36 @@ public class DisassemblyPreferencePage extends PreferencePage implements IWorkbe
// label = DisassemblyMessages.DisassemblyPreferencePage_endAddress; //$NON-NLS-1$
// addTextField(composite, label, DisassemblyPreferenceConstants.END_ADDRESS, 20, 0, true);
+ label = DisassemblyMessages.DisassemblyPreferencePage_showAddress;
+ final Button showAddressCB = addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_ADDRESS_RULER, 0);
+ showAddressCB.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ fAddressFormatCombo.setEnabled(showAddressCB.getSelection());
+ }
+ });
+ showAddressCB.setToolTipText(DisassemblyMessages.DisassemblyPreferencePage_showAddressTooltip);
label = DisassemblyMessages.DisassemblyPreferencePage_addressRadix;
- addComboBox(composite, label, DisassemblyPreferenceConstants.ADDRESS_RADIX, fcRadixItems);
+ fAddressFormatCombo = addComboBox(composite, label, DisassemblyPreferenceConstants.ADDRESS_RADIX, fcRadixItems);
+ fAddressFormatCombo.setToolTipText(DisassemblyMessages.DisassemblyPreferencePage_addressFormatTooltip);
// label = DisassemblyMessages.DisassemblyPreferencePage_instructionRadix;
// addComboBox(composite, label, DisassemblyPreferenceConstants.INSTRUCTION_RADIX, fcRadixItems);
label = DisassemblyMessages.DisassemblyPreferencePage_showSource;
- addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_SOURCE, 0);
+ Button showSourceCB = addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_SOURCE, 0);
+ showSourceCB.setToolTipText(DisassemblyMessages.DisassemblyPreferencePage_showSourceTooltip);
label = DisassemblyMessages.DisassemblyPreferencePage_showSymbols;
- addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_SYMBOLS, 0);
+ Button showSymbolsCB = addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_SYMBOLS, 0);
+ showSymbolsCB.setToolTipText(DisassemblyMessages.DisassemblyPreferencePage_showSymbolsTooltip);
// label = DisassemblyMessages.DisassemblyPreferencePage_simplifiedMnemonics;
// addCheckBox(composite, label, DisassemblyPreferenceConstants.SIMPLIFIED, 0);
label = DisassemblyMessages.DisassemblyPreferencePage_showAddressRadix;
- addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_ADDRESS_RADIX, 0);
+ Button showRadixCB = addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_ADDRESS_RADIX, 0);
+ showRadixCB.setToolTipText(DisassemblyMessages.DisassemblyPreferencePage_showRadixTooltip);
label = DisassemblyMessages.DisassemblyPreferencePage_showFunctionOffsets;
- addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_FUNCTION_OFFSETS, 0);
- label = DisassemblyMessages.DisassemblyPreferencePage_showAddress;
- addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_ADDRESS_RULER, 0);
+ Button showFunctionOffsets = addCheckBox(composite, label, DisassemblyPreferenceConstants.SHOW_FUNCTION_OFFSETS, 0);
+ showFunctionOffsets.setToolTipText(DisassemblyMessages.DisassemblyPreferencePage_showFunctionOffsetsTooltip);
// label = DisassemblyMessages.DisassemblyPreferencePage_avoidReadBeforePC;
// addCheckBox(composite, label, DisassemblyPreferenceConstants.AVOID_READ_BEFORE_PC, 0);
@@ -159,7 +175,7 @@ public class DisassemblyPreferencePage extends PreferencePage implements IWorkbe
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalIndent = indentation;
- gd.horizontalSpan = 2;
+ gd.horizontalSpan = 3;
checkBox.setLayoutData(gd);
checkBox.setData(key);
fCheckBoxes.add(checkBox);
@@ -169,9 +185,14 @@ public class DisassemblyPreferencePage extends PreferencePage implements IWorkbe
private Combo addComboBox(Composite parent, String label, String key, String[] items) {
Label labelControl= new Label(parent, SWT.NONE);
- labelControl.setText(label);
+ labelControl.setText(""); //$NON-NLS-1$
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
labelControl.setLayoutData(gd);
+
+ labelControl= new Label(parent, SWT.NONE);
+ labelControl.setText(label);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ labelControl.setLayoutData(gd);
Combo combo = new Combo(parent, SWT.READ_ONLY);
gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);

Back to the top