Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2012-11-02 17:14:50 +0000
committerEugene Tarassov2012-11-02 17:14:50 +0000
commitee474b0fdc8082b57ad6edeb1570a712886bacbb (patch)
treebfe4149cf8d7e3bbee11830489b7e411543f219d /plugins
parent3c5006fef0cb28924c354bf59db6ea82d8be5599 (diff)
downloadorg.eclipse.tcf-ee474b0fdc8082b57ad6edeb1570a712886bacbb.tar.gz
org.eclipse.tcf-ee474b0fdc8082b57ad6edeb1570a712886bacbb.tar.xz
org.eclipse.tcf-ee474b0fdc8082b57ad6edeb1570a712886bacbb.zip
TCF Debugger: faster retrieval of c-string values
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java35
1 files changed, 23 insertions, 12 deletions
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 0f970b078..2b0901954 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
@@ -522,21 +522,32 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
System.arraycopy(buf, 0, tmp, 0, buf.length);
buf = tmp;
}
- command = mem_space_data.get(addr.add(BigInteger.valueOf(offs)), 1, buf, offs, 1, 0, new IMemory.DoneMemory() {
+ BigInteger get_addr = addr.add(BigInteger.valueOf(offs));
+ final int get_size = 16 - (get_addr.intValue() & 0xf);
+ command = mem_space_data.get(get_addr, 1, buf, offs, get_size, 0, new IMemory.DoneMemory() {
public void doneMemory(IToken token, MemoryError error) {
- if (error != null && offs == 0) {
- set(command, error, null);
- }
- else if (buf[offs] == 0 || offs >= 2048 || error != null) {
- StyledStringBuffer bf = new StyledStringBuffer();
- bf.append(toASCIIString(buf, 0, offs, '"'), StyledStringBuffer.MONOSPACED);
- set(command, null, bf);
- }
- else if (command == token) {
- command = null;
+ if (command != token) return;
+ IMemory.ErrorOffset err_offs = null;
+ if (error instanceof IMemory.ErrorOffset) err_offs = (IMemory.ErrorOffset)error;
+ for (int i = 0; i < get_size; i++) {
+ MemoryError byte_error = null;
+ if (error != null && (err_offs == null || err_offs.getStatus(i) != IMemory.ErrorOffset.BYTE_VALID)) {
+ byte_error = error;
+ if (offs == 0) {
+ set(command, byte_error, null);
+ return;
+ }
+ }
+ if (buf[offs] == 0 || offs >= 2048 || byte_error != null) {
+ StyledStringBuffer bf = new StyledStringBuffer();
+ bf.append(toASCIIString(buf, 0, offs, '"'), StyledStringBuffer.MONOSPACED);
+ set(command, null, bf);
+ return;
+ }
offs++;
- run();
}
+ command = null;
+ run();
}
});
return false;

Back to the top