Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 325277 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/debug/edc/disassembler/EDCInstruction.java (+5 lines)
Lines 96-101 Link Here
96
		return null;
96
		return null;
97
	}
97
	}
98
98
99
	/** @since 2.0 */
100
	public Integer getSize() {
101
		return (Integer)instruction.getSize();
102
	}
103
99
	@Override
104
	@Override
100
	public String toString() {
105
	public String toString() {
101
		return instruction.toString();
106
		return instruction.toString();
(-)src/org/eclipse/cdt/dsf/debug/service/IInstruction.java (+5 lines)
Lines 50-53 Link Here
50
    */
50
    */
51
    String getArgs();
51
    String getArgs();
52
52
53
    /**
54
    * @return size of the instruction
55
    * @since 2.2
56
    */
57
    Integer getSize();
53
}
58
}
(-)src/org/eclipse/cdt/dsf/mi/service/command/output/MIInstruction.java (+5 lines)
Lines 53-58 Link Here
53
        return args;
53
        return args;
54
    }
54
    }
55
55
56
    /** @since 4.0*/
57
    public Integer getSize() {
58
    	return null;
59
    }
60
56
    /**
61
    /**
57
     *  Parse the assembly instruction result. Each instruction has the following
62
     *  Parse the assembly instruction result. Each instruction has the following
58
     *  fields:
63
     *  fields:
(-)src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java (-20 / +28 lines)
Lines 610-621 Link Here
610
				}
610
				}
611
				// determine instruction byte length
611
				// determine instruction byte length
612
				BigInteger instrLength= null;
612
				BigInteger instrLength= null;
613
				if (j < instructions.length - 1) {
613
				if (instructions[j].getSize() != null) {
614
					instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
614
					instrLength= new BigInteger(instructions[j].getSize().toString());
615
				}
615
				} else {
616
				if (instrLength == null) {
616
					if (j < instructions.length - 1) {
617
					// cannot determine length of last instruction
617
						instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
618
					break;
618
					}
619
					if (instrLength == null) {
620
						// cannot determine length of last instruction
621
						break;
622
					}
619
				}
623
				}
620
				final String opCode;
624
				final String opCode;
621
				// insert function name+offset instead of opcode bytes
625
				// insert function name+offset instead of opcode bytes
Lines 727-752 Link Here
727
					}
731
					}
728
					// determine instruction byte length
732
					// determine instruction byte length
729
					BigInteger instrLength= null;
733
					BigInteger instrLength= null;
730
					if (j < instructions.length - 1) {
734
					if (instructions[j].getSize() != null) {
731
						instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
735
						instrLength= new BigInteger(instructions[j].getSize().toString());
732
					} else if (i < mixedInstructions.length - 1) {
736
					} else {
733
						int nextSrcLineIdx= i+1;
737
						if (j < instructions.length - 1) {
734
						while (nextSrcLineIdx < mixedInstructions.length) {
738
							instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
735
							IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions();
739
						} else if (i < mixedInstructions.length - 1) {
736
							if (nextInstrs.length > 0) {
740
							int nextSrcLineIdx= i+1;
737
								instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs();
741
							while (nextSrcLineIdx < mixedInstructions.length) {
742
								IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions();
743
								if (nextInstrs.length > 0) {
744
									instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs();
745
									break;
746
								}
747
								++nextSrcLineIdx;
748
							}
749
							if (nextSrcLineIdx >= mixedInstructions.length) {
738
								break;
750
								break;
739
							}
751
							}
740
							++nextSrcLineIdx;
741
						}
752
						}
742
						if (nextSrcLineIdx >= mixedInstructions.length) {
753
						if (instrLength == null) {
754
							// cannot determine length of last instruction
743
							break;
755
							break;
744
						}
756
						}
745
					}
757
					}
746
					if (instrLength == null) {
747
						// cannot determine length of last instruction
748
						break;
749
					}
750
					final String opCode;
758
					final String opCode;
751
					// insert function name+offset instead of opcode bytes
759
					// insert function name+offset instead of opcode bytes
752
					if (functionName != null && functionName.length() > 0) {
760
					if (functionName != null && functionName.length() > 0) {

Return to bug 325277