Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Dubrow2010-03-13 14:59:57 +0000
committerDavid Dubrow2010-03-13 14:59:57 +0000
commite7d0761389fb894064a243a7eeae461067863c93 (patch)
treea3e9280bd7715a225b688fbe1b522e5e4d732bfc /dsf/org.eclipse.cdt.dsf.ui
parent900aeefc478f301388690f3116430b2e8e837a1e (diff)
downloadorg.eclipse.cdt-e7d0761389fb894064a243a7eeae461067863c93.tar.gz
org.eclipse.cdt-e7d0761389fb894064a243a7eeae461067863c93.tar.xz
org.eclipse.cdt-e7d0761389fb894064a243a7eeae461067863c93.zip
Bug 305365 allowing editable value to differ from formatted value
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java19
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableCellModifier.java2
2 files changed, 14 insertions, 7 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java
index bfbf41e93b1..049af3a6756 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java
@@ -374,11 +374,13 @@ public class SyncVariableDataAccess {
private IFormattedDataDMContext fDmc;
private String fFormatId;
+ private boolean fEditable;
- public GetFormattedValueValueQuery(IFormattedDataDMContext dmc, String formatId) {
+ public GetFormattedValueValueQuery(IFormattedDataDMContext dmc, String formatId, boolean editable) {
super();
fDmc = dmc;
fFormatId = formatId;
+ fEditable = editable;
}
@Override
@@ -413,10 +415,7 @@ public class SyncVariableDataAccess {
service.getFormattedExpressionValue(formDmc, new DataRequestMonitor<FormattedValueDMData>(session.getExecutor(), rm) {
@Override
protected void handleSuccess() {
- /*
- * All good set return value.
- */
- rm.setData(getData().getFormattedValue());
+ rm.setData(fEditable ? getData().getEditableValue() : getData().getFormattedValue());
rm.done();
}
});
@@ -424,6 +423,14 @@ public class SyncVariableDataAccess {
}
public String getFormattedValue(Object element, String formatId) {
+ return getValue(element, formatId, false);
+ }
+
+ public String getEditableValue(Object element, String formatId) {
+ return getValue(element, formatId, true);
+ }
+
+ public String getValue(Object element, String formatId, boolean editable) {
/*
* Get the DMC and the session. If element is not an register DMC, or
@@ -439,7 +446,7 @@ public class SyncVariableDataAccess {
* guard against RejectedExecutionException, because
* DsfSession.getSession() above would only return an active session.
*/
- GetFormattedValueValueQuery query = new GetFormattedValueValueQuery(dmc, formatId);
+ GetFormattedValueValueQuery query = new GetFormattedValueValueQuery(dmc, formatId, editable);
session.getExecutor().execute(query);
/*
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableCellModifier.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableCellModifier.java
index aea2966637b..b390e2aefd7 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableCellModifier.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableCellModifier.java
@@ -90,7 +90,7 @@ public class VariableCellModifier extends WatchExpressionCellModifier {
formatId = IFormattedValues.NATURAL_FORMAT;
}
- String value = fDataAccess.getFormattedValue(element, formatId);
+ String value = fDataAccess.getEditableValue(element, formatId);
if (value == null) {
return "..."; //$NON-NLS-1$

Back to the top