From 00d9873796602ccaeb0fd6b38bdbb60ba262407a Mon Sep 17 00:00:00 2001 From: eutarass Date: Mon, 24 Mar 2008 19:36:18 +0000 Subject: 1. Debug services RunControl, Breakpoints, Memory, Registers and StackTrace now work on Windows and CygWin. 2. Added missing error checks on all pthreads calls. 3. Fixed Bug 222929: [tcf] "Processes attach " command generates an invalid TCF message --- .../internal/tcf/services/remote/MemoryProxy.java | 38 ++++++++++++---------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'plugins/org.eclipse.tm.tcf') diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java index 40ddf0ae3..a2ed0c0e7 100644 --- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java +++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java @@ -55,27 +55,30 @@ public class MemoryProxy implements IMemory { MemoryErrorReport(String msg, Number addr, Object ranges) { super(msg); Collection> c = (Collection>)ranges; - this.ranges = new Range[c.size()]; - int n = 0; - BigInteger addr_bi = addr instanceof BigInteger ? - (BigInteger)addr : new BigInteger(addr.toString()); - for (Map m : c) { - Range r = new Range(); - Number x = (Number)m.get("addr"); - BigInteger y = x instanceof BigInteger ? - (BigInteger)x : new BigInteger(x.toString()); - r.offs = addr_bi.subtract(y).intValue(); - r.size = ((Number)m.get("size")).intValue(); - r.stat = ((Number)m.get("stat")).intValue(); - r.msg = Command.toErrorString(m.get("msg")); - assert r.offs >= 0; - assert r.size >= 0; - this.ranges[n++] = r; + this.ranges = c == null ? null : new Range[c.size()]; + if (c != null) { + int n = 0; + BigInteger addr_bi = addr instanceof BigInteger ? + (BigInteger)addr : new BigInteger(addr.toString()); + for (Map m : c) { + Range r = new Range(); + Number x = (Number)m.get("addr"); + BigInteger y = x instanceof BigInteger ? + (BigInteger)x : new BigInteger(x.toString()); + r.offs = addr_bi.subtract(y).intValue(); + r.size = ((Number)m.get("size")).intValue(); + r.stat = ((Number)m.get("stat")).intValue(); + r.msg = Command.toErrorString(m.get("msg")); + assert r.offs >= 0; + assert r.size >= 0; + this.ranges[n++] = r; + } + Arrays.sort(this.ranges); } - Arrays.sort(this.ranges); } public String getMessage(int offset) { + if (ranges == null) return null; int l = 0; int h = ranges.length - 1; while (l <= h) { @@ -95,6 +98,7 @@ public class MemoryProxy implements IMemory { } public int getStatus(int offset) { + if (ranges == null) return BYTE_UNKNOWN; int l = 0; int h = ranges.length - 1; while (l <= h) { -- cgit v1.2.3