Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2017-01-16 22:08:44 +0000
committerEugene Tarassov2017-01-16 22:08:44 +0000
commit8819c30479cec273ce3f9a8647ba986776eaff60 (patch)
tree1c776556b26000ab438d1f56bfed5aa086e6b090 /plugins
parent20923800aa77cc57641969d2c3825396a8727d76 (diff)
downloadorg.eclipse.tcf-8819c30479cec273ce3f9a8647ba986776eaff60.tar.gz
org.eclipse.tcf-8819c30479cec273ce3f9a8647ba986776eaff60.tar.xz
org.eclipse.tcf-8819c30479cec273ce3f9a8647ba986776eaff60.zip
TCF Debugger: allow editing of char type values in the Variables view
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java3
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java34
2 files changed, 34 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 7ea64841c..d0b53ee20 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -2183,8 +2183,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
mb.setText(title);
- mb.setMessage(getErrorMessage(error, !(error instanceof IErrorReport)));
- if (error instanceof IErrorReport) Activator.log(title, error);
+ mb.setMessage(getErrorMessage(error, true));
mb.open();
}
});
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
index 0b5527eba..5036206c6 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
@@ -2139,7 +2139,9 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
StyledStringBuffer bf = node.getPrettyExpression(this);
if (bf == null) return;
String s = bf.toString();
- done(s.startsWith("0x") || TCFNumberFormat.isValidDecNumber(true, s) == null);
+ done(s.startsWith("0x") ||
+ s.startsWith("'") && s.endsWith("'") ||
+ TCFNumberFormat.isValidDecNumber(true, s) == null);
return;
}
}
@@ -2276,6 +2278,36 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
error = TCFNumberFormat.isValidHexNumber(s);
if (error == null) bf = TCFNumberFormat.toByteArray(s, 16, false, size, signed, big_endian);
}
+ else if (input.startsWith("'") && input.endsWith("'")) {
+ String s = input.substring(1, input.length() - 1);
+ int l = s.length();
+ int i = 0;
+ int n = 0;
+ if (i < l) {
+ char ch = s.charAt(i++);
+ if (ch == '\\' && i < l) {
+ ch = s.charAt(i++);
+ switch (ch) {
+ case 'r': n = '\r'; break;
+ case 'n': n = '\n'; break;
+ case 'b': n = '\b'; break;
+ case 't': n = '\t'; break;
+ case 'f': n = '\f'; break;
+ default:
+ while (ch >= '0' && ch <= '7') {
+ n = n * 8 + (ch - '0');
+ if (i >= l) break;
+ ch = s.charAt(i++);
+ }
+ }
+ }
+ else {
+ n = ch;
+ }
+ }
+ if (i < l) throw new Exception("Invalid character literal: " + value);
+ bf = TCFNumberFormat.toByteArray(Integer.toString(n), 10, false, size, signed, big_endian);
+ }
else if (bin_scale != null) {
int n = bin_scale.intValue();
BigDecimal d = new BigDecimal(input);

Back to the top