Community
Participate
Working Groups
Created attachment 180635 [details] bugfix to subtract original address from error address to get offset (includes changes found in patch in Bug 326270) org.eclipse.tm.internal.tcf.services.remote.MemoryProxy.MemoryErrorReport.MemoryErrorReport() appears to contain a bug w.r.t. the processing of addresses that are offset from the originally requested address passed as a parameter to org.eclipse.tm.internal.tcf.services.remote.MemoryProxy.MemContext.get() . this snippet of code (also seen in the attached patch) appears to be incorrect: BigInteger addr_bi = addr instanceof BigInteger ? (BigInteger)addr : new BigInteger(addr.toString()); for (Map<String,Object> m : c) { Range r = new Range(); Number x = (Number)m.get(RANGE_KEY_ADDR); BigInteger y = x instanceof BigInteger ? (BigInteger)x : new BigInteger(x.toString()); this call =======> r.offs = y.subtract(addr_bi).intValue(); r.size = ((Number)m.get(RANGE_KEY_SIZE)).intValue(); r.stat = ((Number)m.get(RANGE_KEY_STAT)).intValue(); r.msg = Command.toErrorString(m.get(RANGE_KEY_MSG)); causes this =====> assert r.offs >= 0; to fire the assert r.size >= 0; second time this.ranges[n++] = r; thru the loop } it would seem to be more appropriate to have it be better ==========> r.offs = addr_bi.subtract(y).intValue(); making this a critical due to it blocking the ability to implement an agent mechanism to send back address blocks in a single TCF message that are at appropriate offests.
arrgh … why can't you edit own mistakes in bugzilla?!? the bad snippet and the better substitution in the description are inverted!!! try the following instead: this snippet of code (also seen in the attached patch) appears to be incorrect: BigInteger addr_bi = addr instanceof BigInteger ? (BigInteger)addr : new BigInteger(addr.toString()); for (Map<String,Object> m : c) { Range r = new Range(); Number x = (Number)m.get(RANGE_KEY_ADDR); BigInteger y = x instanceof BigInteger ? (BigInteger)x : new BigInteger(x.toString()); this call =======> r.offs = addr_bi.subtract(y).intValue(); r.size = ((Number)m.get(RANGE_KEY_SIZE)).intValue(); r.stat = ((Number)m.get(RANGE_KEY_STAT)).intValue(); r.msg = Command.toErrorString(m.get(RANGE_KEY_MSG)); causes this =====> assert r.offs >= 0; to fire the assert r.size >= 0; second time this.ranges[n++] = r; thru the loop } it would seem to be more appropriate to have it be better ==========> r.offs = y.subtract(addr_bi).intValue();
subtract() method has a mystical power to get its arguments inverted :-) Yes, it a bug. I have committed the patch. Thanks!
Moving bugs to new home for IP log.
Bulk change: Marking all bugs from the TM era (until June 2011) target 0.3