1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

Fix for bug 78604: Disassembly causes Java exception when disassembling beyond fn(?).

This commit is contained in:
Mikhail Khodjaiants 2004-11-15 22:29:43 +00:00
parent 407463cb32
commit e99487c7dd
2 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2004-11-15 Mikhail Khodjaiants
Fix for bug 78604: Disassembly causes Java exception when disassembling beyond fn(?).
* DisassemblyEditorInput.java
2004-11-11 Mikhail Khodjaiants 2004-11-11 Mikhail Khodjaiants
Fix for bug 73801: Function breakpoints set from C View aren't shown in editor. Fix for bug 73801: Function breakpoints set from C View aren't shown in editor.
* ToggleBreakpointAdapter.java * ToggleBreakpointAdapter.java

View file

@ -11,7 +11,6 @@
package org.eclipse.cdt.debug.internal.ui.views.disassembly; package org.eclipse.cdt.debug.internal.ui.views.disassembly;
import java.util.Arrays; import java.util.Arrays;
import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IAddress;
import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.model.IAsmInstruction; import org.eclipse.cdt.debug.core.model.IAsmInstruction;
@ -219,8 +218,7 @@ public class DisassemblyEditorInput implements IEditorInput {
} }
} }
} }
int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset, int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset );
fBlock.getSourceLines()[0].getInstructions()[0].getAdress().getCharsNum());
int argPosition = instrPos + maxOpcodeLength + 1; int argPosition = instrPos + maxOpcodeLength + 1;
if ( fBlock.isMixedMode() ) if ( fBlock.isMixedMode() )
fSourceRegions = new IRegion[mi.length]; fSourceRegions = new IRegion[mi.length];
@ -266,8 +264,9 @@ public class DisassemblyEditorInput implements IEditorInput {
return sb.toString(); return sb.toString();
} }
private int calculateInstructionPosition( int maxFunctionName, long maxOffset, int addressLength ) { private int calculateInstructionPosition( int maxFunctionName, long maxOffset ) {
//(Address prefix address representation in chars) + (space) + (<) + (+) + (>) + (:) + (space) //(Address prefix address representation in chars) + (space) + (<) + (+) + (>) + (:) + (space)
int addressLength = getDisassembly().getAddressFactory().getMax().getCharsNum();
return ( addressLength + 6 + maxFunctionName + Long.toString( maxOffset ).length() ); return ( addressLength + 6 + maxFunctionName + Long.toString( maxOffset ).length() );
} }