Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2010-03-01 09:21:40 +0000
committerAnton Leherbauer2010-03-01 09:21:40 +0000
commita4d55e01a4d96ba7c6033786ba6a28c5d9f13bd8 (patch)
treee39d14949ee43d24e732974f0bfd38edc80f6fb5 /dsf/org.eclipse.cdt.dsf.ui
parent45a77d5da417a2c78e45802a6eacd40e787e86e2 (diff)
downloadorg.eclipse.cdt-a4d55e01a4d96ba7c6033786ba6a28c5d9f13bd8.tar.gz
org.eclipse.cdt-a4d55e01a4d96ba7c6033786ba6a28c5d9f13bd8.tar.xz
org.eclipse.cdt-a4d55e01a4d96ba7c6033786ba6a28c5d9f13bd8.zip
[302925] Clarify insertDisassembly() return value and align implementations
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
index 57fb315ccc7..a978cc1a05a 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
@@ -559,16 +559,18 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IInstruction[] instructions, boolean showSymbols, boolean showDisassembly) {
if (!fCallback.hasViewer() || fDsfSessionId == null) {
+ // return true to avoid a retry
return true;
}
if (DEBUG) System.out.println("insertDisassembly "+ DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
assert fCallback.getUpdatePending();
if (!fCallback.getUpdatePending()) {
// safe-guard in case something weird is going on
+ // return true to avoid a retry
return true;
}
// indicates whether [startAddress] was inserted
- boolean insertedStartAddress = false;
+ boolean insertedStartAddress = startAddress == null;
try {
fCallback.lockScroller();
@@ -651,8 +653,8 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
* an address the caller is hoping will be covered by this
* insertion. I.e., [mixedInstructions] may or may not contain
* that address; the caller wants to know if it does, and so we
- * indicate that via our return value. Can be null or
- * BigInteger(-1) to indicate n/a, in which case we return true
+ * indicate that via our return value. Can be null to indicate n/a,
+ * in which case we return true as long as any instruction was inserted
* as long as any instruction was inserted
* @param endAddress
* cut-off address. Any elements in [mixedInstructions] that
@@ -664,6 +666,7 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
*/
private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IMixedInstruction[] mixedInstructions, boolean showSymbols, boolean showDisassembly) {
if (!fCallback.hasViewer() || fDsfSessionId == null) {
+ // return true to avoid a retry
return true;
}
if (DEBUG) System.out.println("insertDisassembly "+ DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
@@ -671,10 +674,11 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
assert updatePending;
if (!updatePending) {
// safe-guard in case something weird is going on
+ // return true to avoid a retry
return true;
}
// indicates whether [startAddress] was inserted
- boolean insertedStartAddress = false;
+ boolean insertedStartAddress = startAddress == null;
try {
fCallback.lockScroller();
@@ -687,7 +691,7 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
for (int j = 0; j < instructions.length; ++j) {
IInstruction instruction = instructions[j];
BigInteger address= instruction.getAdress();
- if (startAddress == null || startAddress.compareTo(BigInteger.ZERO) < 0) {
+ if (startAddress == null) {
startAddress = address;
fCallback.setGotoAddressPending(address);
}

Back to the top