1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 23:05:47 +02:00

[302925] Incorporate John's review feedback

This commit is contained in:
Anton Leherbauer 2010-02-26 08:42:25 +00:00
parent 1400363b31
commit e33b39e5b7
2 changed files with 10 additions and 14 deletions

View file

@ -265,6 +265,8 @@ public class DisassemblyBackendCdi implements IDisassemblyBackend, IDebugEventSe
if (endAddress.subtract(startAddress).compareTo(addressLength) > 0) { if (endAddress.subtract(startAddress).compareTo(addressLength) > 0) {
endAddress= startAddress.add(addressLength); endAddress= startAddress.add(addressLength);
} }
// make sure address range is no less than 32 bytes
// this is an attempt to get better a response from the backend (bug 302925)
final BigInteger finalEndAddress= startAddress.add(BigInteger.valueOf(32)).max(endAddress); final BigInteger finalEndAddress= startAddress.add(BigInteger.valueOf(32)).max(endAddress);
final IDisassemblyRetrieval.DisassemblyRequest disassemblyRequest= new DisassemblyRequest() { final IDisassemblyRetrieval.DisassemblyRequest disassemblyRequest= new DisassemblyRequest() {
@Override @Override
@ -415,7 +417,7 @@ public class DisassemblyBackendCdi implements IDisassemblyBackend, IDebugEventSe
assert !fCallback.getUpdatePending(); assert !fCallback.getUpdatePending();
fCallback.setUpdatePending(true); fCallback.setUpdatePending(true);
fDisassemblyRetrieval.asyncGetDisassembly(null, endAddress, file, 1, lines, true, disassemblyRequest); fDisassemblyRetrieval.asyncGetDisassembly(null, endAddress, file, 1, lines, mixed, disassemblyRequest);
} }
private boolean insertDisassembly(BigInteger startAddress, IDisassemblyBlock disassemblyBlock, boolean mixed, boolean showSymbols, boolean showDisassembly) { private boolean insertDisassembly(BigInteger startAddress, IDisassemblyBlock disassemblyBlock, boolean mixed, boolean showSymbols, boolean showDisassembly) {
@ -512,11 +514,11 @@ public class DisassemblyBackendCdi implements IDisassemblyBackend, IDebugEventSe
break; break;
} }
} else { } else {
if (instructions.length == 1) { // if (instructions.length == 1) {
if (p.fAddressLength.compareTo(BigInteger.valueOf(8)) <= 0) { // if (p.fAddressLength.compareTo(BigInteger.valueOf(8)) <= 0) {
instrLength= p.fAddressLength; // instrLength= p.fAddressLength;
} // }
} // }
} }
if (instrLength == null) { if (instrLength == null) {
// cannot determine length of last instruction // cannot determine length of last instruction

View file

@ -441,6 +441,8 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#retrieveDisassembly(java.math.BigInteger, java.math.BigInteger, java.lang.String, int, int, boolean, boolean, boolean, int) * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#retrieveDisassembly(java.math.BigInteger, java.math.BigInteger, java.lang.String, int, int, boolean, boolean, boolean, int)
*/ */
public void retrieveDisassembly(final BigInteger startAddress, BigInteger endAddress, final String file, final int lineNumber, final int lines, boolean mixed, final boolean showSymbols, final boolean showDisassembly, final int linesHint) { public void retrieveDisassembly(final BigInteger startAddress, BigInteger endAddress, final String file, final int lineNumber, final int lines, boolean mixed, final boolean showSymbols, final boolean showDisassembly, final int linesHint) {
// make sure address range is no less than 32 bytes
// this is an attempt to get better a response from the backend (bug 302505)
final BigInteger finalEndAddress= startAddress.add(BigInteger.valueOf(32)).max(endAddress); final BigInteger finalEndAddress= startAddress.add(BigInteger.valueOf(32)).max(endAddress);
DsfSession session = getSession(); DsfSession session = getSession();
@ -609,10 +611,6 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
BigInteger instrLength= null; BigInteger instrLength= null;
if (j < instructions.length - 1) { if (j < instructions.length - 1) {
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
} else if (instructions.length == 1) {
if (p.fAddressLength.compareTo(BigInteger.valueOf(8)) <= 0) {
instrLength= p.fAddressLength;
}
} }
if (instrLength == null) { if (instrLength == null) {
// cannot determine length of last instruction // cannot determine length of last instruction
@ -739,10 +737,6 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
if (nextSrcLineIdx >= mixedInstructions.length) { if (nextSrcLineIdx >= mixedInstructions.length) {
break; break;
} }
} else if (instructions.length == 1) {
if (p.fAddressLength.compareTo(BigInteger.valueOf(8)) <= 0) {
instrLength= p.fAddressLength;
}
} }
if (instrLength == null) { if (instrLength == null) {
// cannot determine length of last instruction // cannot determine length of last instruction