summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorScott Tepavich2012-08-29 11:55:40 (EDT)
committer Scott Tepavich2012-08-29 11:55:40 (EDT)
commitcda9751b9ec737d8a9782b223a03421bde3c682a (patch)
treeb14240c7c84af806fc409c025a064b5318ca160d
parent0a04f824711e74a8f7aa74bca5c99fc259c07055 (diff)
downloadorg.eclipse.tcf-cda9751b9ec737d8a9782b223a03421bde3c682a.zip
org.eclipse.tcf-cda9751b9ec737d8a9782b223a03421bde3c682a.tar.gz
org.eclipse.tcf-cda9751b9ec737d8a9782b223a03421bde3c682a.tar.bz2
Bug [388356] Disassembly view tries to disassemble beyond the addressrefs/changes/92/7492/1
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
index cfb2113..dbde49a 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
@@ -527,9 +527,29 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
}
big_endian = mem.isBigEndian();
addr_bits = mem.getAddressSize() * 8;
+
+ int accessSize = 0;
+ BigInteger bit = new BigInteger("1");
+ BigInteger mem_end = bit.shiftLeft(addr_bits);
+ mem_end = mem_end.subtract(bit);
+
+ if (startAddress.compareTo(mem_end) > 0) {
+ fCallback.setUpdatePending(false);
+ return;
+ }
+
+ BigInteger requestedLineEndAddr = startAddress.add(BigInteger.valueOf(linesHint * mem.getAddressSize()));
+
+ if (requestedLineEndAddr.compareTo(mem_end) > 0) {
+ accessSize = mem_end.subtract(startAddress).intValue() + 1;
+ }
+ else {
+ accessSize = linesHint * mem.getAddressSize();
+ }
+
if (!done_disassembly) {
Map<String, Object> params = new HashMap<String, Object>();
- disass.disassemble(mem.getID(), startAddress, linesHint * 4, params, new DoneDisassemble() {
+ disass.disassemble(mem.getID(), startAddress, accessSize, params, new DoneDisassemble() {
@Override
public void doneDisassemble(IToken token, final Throwable error, IDisassemblyLine[] res) {
if (execContext != fExecContext) return;