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 (-1 / +9 lines)
Lines 23-29 Link Here
23
	public EDCInstruction(IDisassembledInstruction instruction) {
23
	public EDCInstruction(IDisassembledInstruction instruction) {
24
		this.instruction = instruction;
24
		this.instruction = instruction;
25
	}
25
	}
26
26
	
27
	/*
27
	/*
28
	 * (non-Javadoc)
28
	 * (non-Javadoc)
29
	 * 
29
	 * 
Lines 96-101 Link Here
96
		return null;
96
		return null;
97
	}
97
	}
98
98
99
	/**
100
	 * @since 2.0
101
	 */
102
	public Integer getSize() {
103
		return (Integer)instruction.getSize();
104
	}
105
106
	
99
	@Override
107
	@Override
100
	public String toString() {
108
	public String toString() {
101
		return instruction.toString();
109
		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 3.0
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 (-14 / +22 lines)
Lines 613-620 Link Here
613
				}
613
				}
614
				// determine instruction byte length
614
				// determine instruction byte length
615
				BigInteger instrLength= null;
615
				BigInteger instrLength= null;
616
				if (j < instructions.length - 1) {
616
				if (instruction.getSize() != null) {
617
					instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
617
					instrLength= new BigInteger(instruction.getSize().toString());
618
				} else {
619
					if (j < instructions.length - 1) {
620
						instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
621
					}
618
				}
622
				}
619
				if (instrLength == null) {
623
				if (instrLength == null) {
620
					// cannot determine length of last instruction
624
					// cannot determine length of last instruction
Lines 730-749 Link Here
730
					}
734
					}
731
					// determine instruction byte length
735
					// determine instruction byte length
732
					BigInteger instrLength= null;
736
					BigInteger instrLength= null;
733
					if (j < instructions.length - 1) {
737
					if (instruction.getSize() != null) {
734
						instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
738
						instrLength= new BigInteger(instruction.getSize().toString());
735
					} else if (i < mixedInstructions.length - 1) {
739
					} else {
736
						int nextSrcLineIdx= i+1;
740
						if (j < instructions.length - 1) {
737
						while (nextSrcLineIdx < mixedInstructions.length) {
741
							instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
738
							IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions();
742
						} else if (i < mixedInstructions.length - 1) {
739
							if (nextInstrs.length > 0) {
743
							int nextSrcLineIdx= i+1;
740
								instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs();
744
							while (nextSrcLineIdx < mixedInstructions.length) {
745
								IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions();
746
								if (nextInstrs.length > 0) {
747
									instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs();
748
									break;
749
								}
750
								++nextSrcLineIdx;
751
							}
752
							if (nextSrcLineIdx >= mixedInstructions.length) {
741
								break;
753
								break;
742
							}
754
							}
743
							++nextSrcLineIdx;
744
						}
745
						if (nextSrcLineIdx >= mixedInstructions.length) {
746
							break;
747
						}
755
						}
748
					}
756
					}
749
					if (instrLength == null) {
757
					if (instrLength == null) {
(-)src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java (-1 / +1 lines)
Lines 697-703 Link Here
697
			if (functionLength > fMaxFunctionLength) {
697
			if (functionLength > fMaxFunctionLength) {
698
				fMaxFunctionLength = functionLength;
698
				fMaxFunctionLength = functionLength;
699
			}
699
			}
700
			if (fNumberOfInstructions < 100) {
700
			if (fNumberOfInstructions < 100 && fMeanSizeOfInstructions < 16.0) {
701
				fMeanSizeOfInstructions = (fMeanSizeOfInstructions * fNumberOfInstructions + pos.fAddressLength.floatValue()) / (++fNumberOfInstructions);
701
				fMeanSizeOfInstructions = (fMeanSizeOfInstructions * fNumberOfInstructions + pos.fAddressLength.floatValue()) / (++fNumberOfInstructions);
702
			}
702
			}
703
		}
703
		}

Return to bug 325277