diff options
author | eutarass | 2010-05-06 03:06:26 +0000 |
---|---|---|
committer | eutarass | 2010-05-06 03:06:26 +0000 |
commit | 1571bb8aa1fe7300e4578d1545e8aa353abe1889 (patch) | |
tree | 379a260c974a7e2b53c1ba60eba257d9a5ed2fd2 | |
parent | a7573ae8119e60578d9d0cc156a603e6f77132c1 (diff) | |
download | org.eclipse.tcf-1571bb8aa1fe7300e4578d1545e8aa353abe1889.tar.gz org.eclipse.tcf-1571bb8aa1fe7300e4578d1545e8aa353abe1889.tar.xz org.eclipse.tcf-1571bb8aa1fe7300e4578d1545e8aa353abe1889.zip |
TCF Agent: fixed regression: Registers.getm returns no data
-rw-r--r-- | plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java index 41217f293..460d633b3 100644 --- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java +++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java @@ -921,22 +921,30 @@ class TestRCBP1 implements ITCFTest, })); } if (!reg_map.isEmpty()) { + int data_size = 0; List<IRegisters.Location> locs = new ArrayList<IRegisters.Location>(); String[] ids = reg_map.keySet().toArray(new String[reg_map.size()]); for (int i = 0; i < rnd.nextInt(32); i++) { String id = ids[rnd.nextInt(ids.length)]; IRegisters.RegistersContext ctx = reg_map.get(id); if (!ctx.isReadable()) continue; + if (!ctx.isWriteable()) continue; if (ctx.isReadOnce()) continue; + if (ctx.isWriteOnce()) continue; int offs = rnd.nextInt(ctx.getSize()); int size = rnd.nextInt(ctx.getSize() - offs) + 1; locs.add(new IRegisters.Location(id, offs, size)); + data_size += size; } + final int total_size = data_size; final IRegisters.Location[] loc_arr = locs.toArray(new IRegisters.Location[locs.size()]); cmds.add(rg.getm(loc_arr, new IRegisters.DoneGet() { public void doneGet(IToken token, Exception error, byte[] value) { cmds.remove(token); if (suspended.get(sc.id) != sc) return; + if (error == null && value.length != total_size) { + error = new Exception("Invalid data size in Registers.getm reply"); + } if (error != null) { for (IToken t : cmds) t.cancel(); exit(error); |