1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Bug 432734 - Infinite loop retrieving disassembly when debugging

optimized code with GDB

Implement IInstructionWithSize#getSize() for DSF-GDB backend.

Change-Id: Id2daa9f5924caee975ce69c5d7e4ffd9cab0b103
Signed-off-by: Teodor Madan <teodor.madan@freescale.com>
Reviewed-on: https://git.eclipse.org/r/24962
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Teodor Madan 2014-04-14 16:58:06 +03:00
parent e0154961f6
commit 90f0e17976
3 changed files with 13 additions and 3 deletions

View file

@ -71,7 +71,7 @@ public class AddressRangePosition extends Position {
public String toString() {
return getClass().getSimpleName() + '@' + Integer.toHexString(System.identityHashCode(this))
+ (fValid ? "" : "[INVALID]") //$NON-NLS-1$ //$NON-NLS-2$
+ '[' + offset + ':' + length + "]->[" + fAddressOffset //$NON-NLS-1$
+ ':' + fAddressLength + ']';
+ '[' + offset + ':' + length + "]->[" + fAddressOffset.toString(16) //$NON-NLS-1$
+ ':' + fAddressLength.toString(16) + ']';
}
}

View file

@ -27,6 +27,7 @@ public class MIInstruction extends AbstractInstruction {
String opcode = ""; //$NON-NLS-1$
String args = ""; //$NON-NLS-1$
BigInteger rawOpcodes = null;
Integer opcodeSize = null;
public MIInstruction(MITuple tuple) {
parse(tuple);
@ -154,6 +155,7 @@ public class MIInstruction extends AbstractInstruction {
if (var.equals("opcodes")) { //$NON-NLS-1$
try {
rawOpcodes = decodeOpcodes(str);
opcodeSize = Integer.valueOf(str.replace(" ", "").length() / 2); //$NON-NLS-1$//$NON-NLS-2$
} catch (NumberFormatException e) {
}
continue;
@ -189,4 +191,12 @@ public class MIInstruction extends AbstractInstruction {
// Removing space separation and parse as single big integer
return new BigInteger(string.replace(" ", ""), 16); //$NON-NLS-1$ //$NON-NLS-2$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.debug.service.AbstractInstruction#getSize()
*/
@Override
public Integer getSize() {
return opcodeSize;
}
}

View file

@ -1732,7 +1732,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
lineNumber= fBackend.getFrameLine();
}
}
if (DEBUG) System.out.println("Asking backend to retrieve disassembly: sa=" + startAddress + ",ea=" + endAddress + ",file=" + file + ",lineNumber=" + lineNumber + ",lines=" + lines); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
if (DEBUG) System.out.println("Asking backend to retrieve disassembly: sa=0x" + startAddress.toString(16) + ",ea=0x" + endAddress.toString(16) + ",file=" + file + ",lineNumber=" + lineNumber + ",lines=" + lines); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
fBackend.retrieveDisassembly(startAddress, endAddress, file, lineNumber, lines, mixed, fShowSymbols, fShowDisassembly, linesHint);
}