|
Lines 40-45
Link Here
|
| 40 |
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContext; |
40 |
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContext; |
| 41 |
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData; |
41 |
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData; |
| 42 |
import org.eclipse.cdt.dsf.debug.service.IInstruction; |
42 |
import org.eclipse.cdt.dsf.debug.service.IInstruction; |
|
|
43 |
import org.eclipse.cdt.dsf.debug.service.IInstructionWithSize; |
| 43 |
import org.eclipse.cdt.dsf.debug.service.IMixedInstruction; |
44 |
import org.eclipse.cdt.dsf.debug.service.IMixedInstruction; |
| 44 |
import org.eclipse.cdt.dsf.debug.service.IRunControl; |
45 |
import org.eclipse.cdt.dsf.debug.service.IRunControl; |
| 45 |
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; |
46 |
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; |
|
Lines 613-624
Link Here
|
| 613 |
} |
614 |
} |
| 614 |
// determine instruction byte length |
615 |
// determine instruction byte length |
| 615 |
BigInteger instrLength= null; |
616 |
BigInteger instrLength= null; |
| 616 |
if (j < instructions.length - 1) { |
617 |
if (instruction instanceof IInstructionWithSize |
| 617 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
618 |
&& ((IInstructionWithSize)instruction).getSize() != null) { |
| 618 |
} |
619 |
instrLength= new BigInteger(((IInstructionWithSize)instruction).getSize().toString()); |
| 619 |
if (instrLength == null) { |
620 |
} else { |
| 620 |
// cannot determine length of last instruction |
621 |
if (j < instructions.length - 1) { |
| 621 |
break; |
622 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
|
|
623 |
} |
| 624 |
if (instrLength == null) { |
| 625 |
// cannot determine length of last instruction |
| 626 |
break; |
| 627 |
} |
| 622 |
} |
628 |
} |
| 623 |
final String opCode; |
629 |
final String opCode; |
| 624 |
// insert function name+offset instead of opcode bytes |
630 |
// insert function name+offset instead of opcode bytes |
|
Lines 667-673
Link Here
|
| 667 |
* @param showDisassembly |
673 |
* @param showDisassembly |
| 668 |
* @return whether [startAddress] was inserted |
674 |
* @return whether [startAddress] was inserted |
| 669 |
*/ |
675 |
*/ |
| 670 |
|
|
|
| 671 |
private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IMixedInstruction[] mixedInstructions, boolean showSymbols, boolean showDisassembly) { |
676 |
private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IMixedInstruction[] mixedInstructions, boolean showSymbols, boolean showDisassembly) { |
| 672 |
if (!fCallback.hasViewer() || fDsfSessionId == null) { |
677 |
if (!fCallback.hasViewer() || fDsfSessionId == null) { |
| 673 |
// return true to avoid a retry |
678 |
// return true to avoid a retry |
|
Lines 730-755
Link Here
|
| 730 |
} |
735 |
} |
| 731 |
// determine instruction byte length |
736 |
// determine instruction byte length |
| 732 |
BigInteger instrLength= null; |
737 |
BigInteger instrLength= null; |
| 733 |
if (j < instructions.length - 1) { |
738 |
if (instruction instanceof IInstructionWithSize |
| 734 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
739 |
&& ((IInstructionWithSize)instruction).getSize() != null) { |
| 735 |
} else if (i < mixedInstructions.length - 1) { |
740 |
instrLength= new BigInteger(((IInstructionWithSize)instruction).getSize().toString()); |
| 736 |
int nextSrcLineIdx= i+1; |
741 |
} else { |
| 737 |
while (nextSrcLineIdx < mixedInstructions.length) { |
742 |
if (j < instructions.length - 1) { |
| 738 |
IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions(); |
743 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
| 739 |
if (nextInstrs.length > 0) { |
744 |
} else if (i < mixedInstructions.length - 1) { |
| 740 |
instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs(); |
745 |
int nextSrcLineIdx= i+1; |
|
|
746 |
while (nextSrcLineIdx < mixedInstructions.length) { |
| 747 |
IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions(); |
| 748 |
if (nextInstrs.length > 0) { |
| 749 |
instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs(); |
| 750 |
break; |
| 751 |
} |
| 752 |
++nextSrcLineIdx; |
| 753 |
} |
| 754 |
if (nextSrcLineIdx >= mixedInstructions.length) { |
| 741 |
break; |
755 |
break; |
| 742 |
} |
756 |
} |
| 743 |
++nextSrcLineIdx; |
|
|
| 744 |
} |
757 |
} |
| 745 |
if (nextSrcLineIdx >= mixedInstructions.length) { |
758 |
if (instrLength == null) { |
|
|
759 |
// cannot determine length of last instruction |
| 746 |
break; |
760 |
break; |
| 747 |
} |
761 |
} |
| 748 |
} |
762 |
} |
| 749 |
if (instrLength == null) { |
|
|
| 750 |
// cannot determine length of last instruction |
| 751 |
break; |
| 752 |
} |
| 753 |
final String opCode; |
763 |
final String opCode; |
| 754 |
// insert function name+offset instead of opcode bytes |
764 |
// insert function name+offset instead of opcode bytes |
| 755 |
if (functionName != null && functionName.length() > 0) { |
765 |
if (functionName != null && functionName.length() > 0) { |