diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java 2004-09-17 09:11:01.000000000 +0400 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi.event; +import org.eclipse.cdt.core.IAddress; + /** * * Notifies that the originator has changed. @@ -19,5 +21,5 @@ /** * @return the modified addresses. */ - Long[] getAddresses(); + IAddress[] getAddresses(); } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDILocation.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDILocation.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDILocation.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDILocation.java 2004-09-17 09:11:01.000000000 +0400 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; + /** * @@ -24,7 +26,7 @@ * * @return the address of this location */ - long getAddress(); + IAddress getAddress(); /** * Returns the source file of this location or null diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; /** @@ -41,7 +42,7 @@ * @return a memory block with the specified identifier * @throws CDIException on failure. Reasons include: */ - ICDIMemoryBlock createMemoryBlock(long address, int length) + ICDIMemoryBlock createMemoryBlock(IAddress address, int length) throws CDIException; /** diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; @@ -40,7 +41,7 @@ * @param endAddress is the end address * @throws CDIException on failure. */ - ICDIInstruction[] getInstructions(long startAddress, long endAddress) + ICDIInstruction[] getInstructions(IAddress startAddress, IAddress endAddress) throws CDIException; /** @@ -66,8 +67,8 @@ * @throws CDIException on failure. */ ICDIMixedInstruction[] getMixedInstructions( - long startAddress, - long endAddress) + IAddress startAddress, + IAddress endAddress) throws CDIException; /** diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint; /** @@ -155,5 +156,5 @@ * @param address - an address * @return an ICDILocation object */ - ICDILocation createLocation( long address ); + ICDILocation createLocation( IAddress address ); } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; + /** * * Represents a machine instruction. @@ -22,7 +24,7 @@ * Returns the Address. * @return the address. */ - long getAdress(); + IAddress getAdress(); /** * @return the function name. diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; /** @@ -26,7 +27,7 @@ * * @return the start address of this memory block */ - long getStartAddress(); + IAddress getStartAddress(); /** * Returns the length of this memory block in bytes. diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java 2004-09-17 09:11:01.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; /** @@ -32,14 +33,14 @@ * * @return the start address of this library */ - long getStartAddress(); + IAddress getStartAddress(); /** * Returns the end address of this library. * * @return the end address of this library */ - long getEndAddress(); + IAddress getEndAddress(); /** * Returns whether the symbols of this library are read. diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDILocation; @@ -182,6 +183,6 @@ /** * Returns a ICDILocation */ - ICDILocation createLocation(long address); + ICDILocation createLocation(IAddress address); } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java 2004-09-17 09:11:01.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi.model.type; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; @@ -22,5 +23,5 @@ */ public interface ICDIPointerValue extends ICDIDerivedValue { - long pointerValue() throws CDIException; + IAddress pointerValue() throws CDIException; } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java --- workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java 2004-09-17 09:11:01.000000000 +0400 @@ -10,11 +10,12 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi.model.type; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; /** */ public interface ICDIReferenceValue extends ICDIDerivedValue { - long referenceValue() throws CDIException; + IAddress referenceValue() throws CDIException; } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java 2004-09-17 09:12:37.000000000 +0400 @@ -91,19 +91,6 @@ } } - public static String toHexAddressString( long address ) - { - String addressString = Long.toHexString( address ); - StringBuffer sb = new StringBuffer( 10 ); - sb.append( "0x" ); //$NON-NLS-1$ - for ( int i = 0; i < 8 - addressString.length(); ++i ) - { - sb.append( '0' ); - } - sb.append( addressString ); - return sb.toString(); - } - public static char[] getByteText( byte b ) { return new char[]{ charFromByte( (byte)((b >>> 4) & 0x0f) ), @@ -201,18 +188,6 @@ return Long.parseLong( bytesToString( bytes, le, false ), 16 ); } - public static long toLongLong( char[] bytes, boolean le ) - { - if ( bytes.length != 16 ) - return 0; - return Long.parseLong( bytesToString( bytes, le, false ), 16 ); - } - - public static long toUnsignedLongLong( char[] bytes, boolean le ) - { - return 0; - } - private static String bytesToString( char[] bytes, boolean le, boolean signed ) { char[] copy = new char[bytes.length]; diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java 2004-09-17 09:12:37.000000000 +0400 @@ -12,6 +12,8 @@ import java.text.MessageFormat; import java.util.HashMap; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDILocation; @@ -255,7 +257,7 @@ */ public static ICAddressBreakpoint createAddressBreakpoint( String sourceHandle, IResource resource, - long address, + IAddress address, boolean enabled, int ignoreCount, String condition, @@ -266,7 +268,7 @@ attributes.put( IMarker.CHAR_END, new Integer( 0 ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); - attributes.put( ICLineBreakpoint.ADDRESS, Long.toString( address ) ); + attributes.put( ICLineBreakpoint.ADDRESS, address.toHexAddressString() ); attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IAsmInstruction.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IAsmInstruction.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IAsmInstruction.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IAsmInstruction.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,8 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; + /** * An instruction of disassemby. */ @@ -20,7 +22,7 @@ * * @return the address of this instruction */ - long getAdress(); + IAddress getAdress(); /** * Returns the function name of this instruction, diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; /** @@ -30,5 +31,5 @@ * @return the target address of the given breakpoint * @throws DebugException if the address is not available */ - long getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException; + IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException; } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IDebugElement; @@ -30,14 +31,14 @@ * * @return the start address of this library */ - long getStartAddress(); + IAddress getStartAddress(); /** * Returns the end address of this library. * * @return the end address of this library */ - long getEndAddress(); + IAddress getEndAddress(); /** * Returns whether the symbols of this library are read. diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICStackFrame.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICStackFrame.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICStackFrame.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICStackFrame.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.IValue; @@ -24,7 +25,7 @@ * * @return the address of this stack frame */ - public long getAddress(); + public IAddress getAddress(); /** * Returns the source file of this stack frame or null diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IMemoryBlock; @@ -104,13 +105,15 @@ char getPaddingCharacter(); - long nextRowAddress(); + public IAddress getRealStartAddress(); - long previousRowAddress(); + IAddress nextRowAddress(); - long nextPageAddress(); + IAddress previousRowAddress(); - long previousPageAddress(); + IAddress nextPageAddress(); + + IAddress previousPageAddress(); void reformat( int format, int wordSize, @@ -124,7 +127,7 @@ char paddingChar ) throws DebugException; void dispose(); - Long[] getChangedAddresses(); + IAddress[] getChangedAddresses(); boolean isFrozen(); diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java 2004-09-17 09:12:37.000000000 +0400 @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; + /** * * Represents a row in the output table of formatted memory block. @@ -24,7 +26,7 @@ * * @return the address of this row */ - long getAddress(); + IAddress getAddress(); /** * Returns the array of memory words. diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java 2004-09-17 09:15:43.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; /** @@ -22,12 +23,12 @@ * * @return whether this operation is currently available */ - public boolean canJumpToAddress( long address ); + public boolean canJumpToAddress( IAddress address ); /** * Causes this element to resume the execution at the specified address. * * @exception DebugException on failure. Reasons include: */ - public void jumpToAddress( long address ) throws DebugException; + public void jumpToAddress( IAddress address ) throws DebugException; } \ No newline at end of file diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java 2004-09-17 09:15:53.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; /** @@ -22,12 +23,12 @@ * * @return whether this operation is currently available */ - public boolean canRunToAddress( long address ); + public boolean canRunToAddress( IAddress address ); /** * Causes this element to run to specified address. * * @exception DebugException on failure. Reasons include: */ - public void runToAddress( long address, boolean skipBreakpoints ) throws DebugException; + public void runToAddress( IAddress address, boolean skipBreakpoints ) throws DebugException; } \ No newline at end of file diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,13 +10,12 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.core.breakpoints; -import java.text.MessageFormat; import java.util.Map; import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.internal.core.CDebugUtils; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import org.eclipse.osgi.framework.msg.MessageFormat; /** * A breakpoint that suspend the execution when a particular address is reached. @@ -58,8 +57,7 @@ sb.append( name ); } try { - long address = Long.parseLong( getAddress() ); - sb.append( MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.2" ), new String[] { CDebugUtils.toHexAddressString( address ) } ) ); //$NON-NLS-1$ + sb.append( MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.2" ), new String[] { getAddress() } ) ); //$NON-NLS-1$ } catch( NumberFormatException e ) { } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java 2004-09-17 09:12:37.000000000 +0400 @@ -15,6 +15,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugUtils; @@ -256,7 +258,7 @@ return getBreakpointMap().getCBreakpoint( cdiBreakpoint ); } - public long getBreakpointAddress( ICBreakpoint breakpoint ) { + public IAddress getBreakpointAddress( ICBreakpoint breakpoint ) { if ( breakpoint != null ) { ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) { @@ -269,7 +271,7 @@ } } } - return 0; + return fDebugTarget.getAddressFactory().getZero(); } public void setBreakpoint( ICBreakpoint breakpoint ) throws DebugException { @@ -493,7 +495,7 @@ private ICDIBreakpoint setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException { ICDITarget cdiTarget = getCDITarget(); - ICDILocation location = cdiTarget.createLocation( Long.parseLong( breakpoint.getAddress() ) ); + ICDILocation location = cdiTarget.createLocation( getDebugTarget().getAddressFactory().createAddress(breakpoint.getAddress())); ICDIBreakpoint cdiBreakpoint = null; synchronized ( getBreakpointMap() ) { cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true ); @@ -563,7 +565,7 @@ else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { breakpoint = createFunctionBreakpoint( cdiBreakpoint ); } - else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) { + else if ( ! cdiBreakpoint.getLocation().getAddress().isZero() ) { breakpoint = createAddressBreakpoint( cdiBreakpoint ); } } @@ -571,7 +573,7 @@ else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { breakpoint = createFunctionBreakpoint( cdiBreakpoint ); } - else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) { + else if ( ! cdiBreakpoint.getLocation().getAddress().isZero()) { breakpoint = createAddressBreakpoint( cdiBreakpoint ); } } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.model.IAsmInstruction; @@ -30,7 +31,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IAsmInstruction#getAdress() */ - public long getAdress() { + public IAddress getAdress() { return fCDIInstruction.getAdress(); } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 2004-09-17 09:14:15.000000000 +0400 @@ -15,7 +15,10 @@ import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; + import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IAddress; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.IBinary; @@ -205,6 +208,8 @@ */ private Preferences fPreferences = null; + private IAddressFactory fAddressFactory; + /** * Constructor for CDebugTarget. */ @@ -754,7 +759,8 @@ * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long) */ public IMemoryBlock getMemoryBlock( long startAddress, long length ) throws DebugException { - return null; + //IPF_TODO look into implementation + throw new RuntimeException("Method getMemoryBlock should not be called from CDT"); } /* (non-Javadoc) @@ -1498,7 +1504,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IRunToAddress#canRunToAddress(long) */ - public boolean canRunToAddress( long address ) { + public boolean canRunToAddress( IAddress address ) { // for now return canResume(); } @@ -1506,7 +1512,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IRunToAddress#runToAddress(long, boolean) */ - public void runToAddress( long address, boolean skipBreakpoints ) throws DebugException { + public void runToAddress( IAddress address, boolean skipBreakpoints ) throws DebugException { if ( !canRunToAddress( address ) ) return; if ( skipBreakpoints ) { @@ -1602,7 +1608,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#canJumpToAddress(long) */ - public boolean canJumpToAddress( long address ) { + public boolean canJumpToAddress( IAddress address ) { // check if supports jump to address return canResume(); } @@ -1610,7 +1616,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#jumpToAddress(long) */ - public void jumpToAddress( long address ) throws DebugException { + public void jumpToAddress( IAddress address ) throws DebugException { if ( !canJumpToAddress( address ) ) return; ICDILocation location = getCDITarget().createLocation( address ); @@ -1760,8 +1766,8 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IBreakpointTarget#getBreakpointAddress(org.eclipse.cdt.debug.core.model.ICLineBreakpoint) */ - public long getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException { - return (getBreakpointManager() != null) ? getBreakpointManager().getBreakpointAddress( breakpoint ) : 0; + public IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException { + return (getBreakpointManager() != null) ? getBreakpointManager().getBreakpointAddress( breakpoint ) : getAddressFactory().getZero(); } /* (non-Javadoc) @@ -1838,4 +1844,19 @@ public boolean isPostMortem() { return false; } + public IAddressFactory getAddressFactory() + { + if ( fAddressFactory == null ) + { + if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) ) + { + ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() ); + if ( cFile instanceof IBinary ) + { + fAddressFactory = ((IBinary)cFile).getAddressFactory(); + } + } + } + return fAddressFactory; + } } \ No newline at end of file diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,9 +10,11 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import java.math.BigInteger; import java.util.ArrayList; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.cdi.CDIException; @@ -43,14 +45,14 @@ { class CFormattedMemoryBlockRow implements IFormattedMemoryBlockRow { - private long fAddress; + private IAddress fAddress; private String[] fData; private String fAscii; /** * Constructor for CFormattedMemoryBlockRow. */ - public CFormattedMemoryBlockRow( long address, String[] data, String ascii ) + public CFormattedMemoryBlockRow( IAddress address, String[] data, String ascii ) { fAddress = address; fData = data; @@ -60,7 +62,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getAddress() */ - public long getAddress() + public IAddress getAddress() { return fAddress; } @@ -92,7 +94,7 @@ private boolean fDisplayAscii = true; private char fPaddingChar = '.'; private List fRows = null; - private Long[] fChangedAddresses = new Long[0]; + private IAddress[] fChangedAddresses = new IAddress[0]; private boolean fStartAddressChanged = false; /** @@ -219,33 +221,33 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextRowAddress() */ - public long nextRowAddress() + public IAddress nextRowAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousRowAddress() */ - public long previousRowAddress() + public IAddress previousRowAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextPageAddress() */ - public long nextPageAddress() + public IAddress nextPageAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousPageAddress() */ - public long previousPageAddress() + public IAddress previousPageAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) @@ -285,13 +287,18 @@ */ public long getStartAddress() { + //IPF_TODO look into implementation + throw new RuntimeException("Method IMemoryBlock.getStartAddress shoud not be called in CDT debug"); + } + + public IAddress getRealStartAddress() + { if ( fCDIMemoryBlock != null ) { return fCDIMemoryBlock.getStartAddress(); } - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } - /* (non-Javadoc) * @see org.eclipse.debug.core.model.IMemoryBlock#getLength() */ @@ -510,19 +517,19 @@ fireTerminateEvent(); } - public Long[] getChangedAddresses() + public IAddress[] getChangedAddresses() { return fChangedAddresses; } - protected void setChangedAddresses( Long[] changedAddresses ) + protected void setChangedAddresses( IAddress[] changedAddresses ) { fChangedAddresses = changedAddresses; } protected void resetChangedAddresses() { - fChangedAddresses = new Long[0]; + fChangedAddresses = new IAddress[0]; } /** @@ -679,12 +686,13 @@ return fStartAddressChanged; } - private long getRowAddress( int offset ) + private IAddress getRowAddress(int offset ) { - long result = getStartAddress() + offset; - if ( result > 0xFFFFFFFFL ) + IAddress result = getRealStartAddress().add(BigInteger.valueOf(offset)); + IAddress max = ((CDebugTarget)getDebugTarget()).getAddressFactory().getMax(); + if ( result.compareTo(max) > 0 ) { - result -= 0xFFFFFFFFL; + result = result.add(result.getMaxOffset().negate()); } return result; } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; @@ -52,21 +53,21 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getStartAddress() */ - public long getStartAddress() + public IAddress getStartAddress() { if ( getCDISharedLibrary() != null ) return getCDISharedLibrary().getStartAddress(); - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getEndAddress() */ - public long getEndAddress() + public IAddress getEndAddress() { if ( getCDISharedLibrary() != null ) return getCDISharedLibrary().getEndAddress(); - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java 2004-09-17 09:12:37.000000000 +0400 @@ -16,6 +16,8 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; @@ -529,7 +531,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.ICStackFrame#getAddress() */ - public long getAddress() { + public IAddress getAddress() { return getCDIStackFrame().getLocation().getAddress(); } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java 2004-09-17 09:12:37.000000000 +0400 @@ -16,6 +16,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; @@ -274,12 +276,20 @@ private String getLongValueString( ICDILongValue value ) throws CDIException { CVariableFormat format = getParentVariable().getFormat(); if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) { - return (isUnsigned()) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); + if ( isUnsigned() ) { + BigInteger bigValue = new BigInteger( value.getValueString() ); + return bigValue.toString(); + } + return Long.toString( value.longValue() ); } else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) { StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$ - String stringValue = Long.toHexString( (isUnsigned()) ? value.longValue() : value.intValue() ); - sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); + if ( isUnsigned() ) { + BigInteger bigValue = new BigInteger( value.getValueString() ); + sb.append( bigValue.toString( 16 ) ); + } + else + sb.append( Long.toHexString( value.longValue() ) ); return sb.toString(); } return null; @@ -351,33 +361,32 @@ return null; } - private String getPointerValueString( ICDIPointerValue value ) throws CDIException { - long longValue = value.pointerValue(); - CVariableFormat format = getParentVariable().getFormat(); - if ( CVariableFormat.DECIMAL.equals( format ) ) { - return Long.toString( longValue ); - } - else if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) ) { - StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$ - String stringValue = Long.toHexString( longValue ); - sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } + private String getPointerValueString( ICDIPointerValue value ) throws CDIException + { + //IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references + IAddress address = value.pointerValue(); + if(address == null) return ""; + CVariableFormat format = getParentVariable().getFormat(); + if( CVariableFormat.NATURAL.equals( format ) || + CVariableFormat.HEXADECIMAL.equals( format ) ) + return address.toHexAddressString(); + if( CVariableFormat.DECIMAL.equals( format )) + return address.toString(); return null; } - private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException { - long longValue = value.referenceValue(); - CVariableFormat format = getParentVariable().getFormat(); - if ( CVariableFormat.DECIMAL.equals( format ) ) { - return Long.toString( longValue ); - } - else if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) ) { - StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$ - String stringValue = Long.toHexString( longValue ); - sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } + private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException + { + //NOTE: Reference should be displayed identically to address + //IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references + IAddress address = value.referenceValue(); + if(address == null) return ""; + CVariableFormat format = getParentVariable().getFormat(); + if( CVariableFormat.NATURAL.equals( format ) || + CVariableFormat.HEXADECIMAL.equals( format ) ) + return address.toHexAddressString(); + if( CVariableFormat.DECIMAL.equals( format )) + return address.toString(); return null; } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java 2004-09-17 09:12:37.000000000 +0400 @@ -16,6 +16,7 @@ import java.io.IOException; import java.io.LineNumberReader; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; import org.eclipse.cdt.debug.core.model.IAsmInstruction; @@ -39,9 +40,9 @@ private IAsmSourceLine[] fSourceLines; - private long fStartAddress = 0; + private IAddress fStartAddress; - private long fEndAddress = 0; + private IAddress fEndAddress; private boolean fMixedMode = false; @@ -100,8 +101,9 @@ public boolean contains( ICStackFrame frame ) { if ( !getDisassembly().getDebugTarget().equals( frame.getDebugTarget() ) ) return false; - long address = frame.getAddress(); - return (address >= fStartAddress && address <= fEndAddress); + IAddress address = frame.getAddress(); + return ( address.compareTo(fStartAddress) >= 0 && + address.compareTo(fEndAddress) <= 0 ); } /* (non-Javadoc) diff -NaurbB workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/Disassembly.java workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/Disassembly.java --- workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/Disassembly.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/Disassembly.java 2004-09-17 09:12:37.000000000 +0400 @@ -10,8 +10,10 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import java.math.BigInteger; import java.util.ArrayList; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.ICDebugConstants; import org.eclipse.cdt.debug.core.cdi.CDIException; @@ -62,7 +64,7 @@ String fileName = frame.getFile(); int lineNumber = frame.getLineNumber(); ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0]; - long address = frame.getAddress(); + IAddress address = frame.getAddress(); if ( fileName != null && fileName.length() > 0 ) { try { mixedInstrs = sm.getMixedInstructions( fileName, @@ -73,19 +75,17 @@ targetRequestFailed( e.getMessage(), e ); } } - if ( mixedInstrs.length == 0 || // Double check if debugger returns correct address range. + if ( mixedInstrs.length == 0 || !containsAddress( mixedInstrs, address ) ) { - if ( address >= 0 ) { try { - ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( address, address + DISASSEMBLY_BLOCK_SIZE ) ); + ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( address, address.add(BigInteger.valueOf(DISASSEMBLY_BLOCK_SIZE)) ) ); return DisassemblyBlock.create( this, instructions ); } catch( CDIException e ) { targetRequestFailed( e.getMessage(), e ); } } - } else { return DisassemblyBlock.create( this, mixedInstrs ); } @@ -94,11 +94,11 @@ return null; } - private boolean containsAddress( ICDIMixedInstruction[] mi, long address ) { + private boolean containsAddress( ICDIMixedInstruction[] mi, IAddress address ) { for( int i = 0; i < mi.length; ++i ) { ICDIInstruction[] instructions = mi[i].getInstructions(); for ( int j = 0; j < instructions.length; ++j ) - if ( instructions[j].getAdress() == address ) + if ( address.equals(instructions[j].getAdress())) return true; } return false; diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java 2004-09-17 09:16:34.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.resources.FileStorage; import org.eclipse.cdt.debug.core.model.IJumpToAddress; import org.eclipse.cdt.debug.core.model.IJumpToLine; @@ -176,7 +177,7 @@ } } - protected void jumpToAddress( long address ) + protected void jumpToAddress( IAddress address ) { IJumpToAddress target = (IJumpToAddress)getDebugTarget().getAdapter( IJumpToAddress.class ); if ( target != null ) diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java 2004-09-17 09:16:34.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.IJumpToAddress; import org.eclipse.cdt.debug.core.model.IJumpToLine; @@ -247,7 +248,7 @@ } ITextSelection textSelection = (ITextSelection)selection; int lineNumber = textSelection.getStartLine() + 1; - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); return jumpToAddress.canJumpToAddress( address ); } return false; @@ -287,7 +288,7 @@ else { ITextSelection textSelection = (ITextSelection)selection; int lineNumber = textSelection.getStartLine() + 1; - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); IJumpToAddress jumpToAddress = (IJumpToAddress)((IAdaptable)debugTarget).getAdapter( IJumpToAddress.class ); if ( jumpToAddress != null ) jumpToAddress.jumpToAddress( address ); diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java 2004-09-17 09:16:34.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.IRunToAddress; import org.eclipse.cdt.debug.core.model.IRunToLine; @@ -83,7 +84,7 @@ else { ITextSelection textSelection = (ITextSelection)selection; int lineNumber = textSelection.getStartLine() + 1; - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); if ( target instanceof IAdaptable ) { IRunToAddress runToAddress = (IRunToAddress)((IAdaptable)target).getAdapter( IRunToAddress.class ); if ( runToAddress != null && runToAddress.canRunToAddress( address ) ) { diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java 2004-09-17 09:16:34.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.IDeclaration; import org.eclipse.cdt.core.model.IFunction; @@ -110,8 +111,8 @@ errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$ } else { - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); - if ( address == 0 ) { + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + if ( address == null ) { errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$ } else { diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java 2004-09-17 09:16:34.000000000 +0400 @@ -24,16 +24,7 @@ */ public class CDebugUIUtils { - static public String toHexAddressString( long address ) - { - String tmp = Long.toHexString( address ); - char[] prefix = new char[10 - tmp.length()]; - prefix[0] = '0'; - prefix[1] = 'x'; - for ( int i = 2; i < prefix.length; ++i ) - prefix[i] = '0'; - return new String( prefix ) + tmp; - } + static public IRegion findWord( IDocument document, int offset ) { diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java 2004-09-17 09:16:34.000000000 +0400 @@ -703,9 +703,8 @@ protected StringBuffer appendAddress( ICAddressBreakpoint breakpoint, StringBuffer label ) throws CoreException { try { - long address = Long.parseLong( breakpoint.getAddress() ); label.append( ' ' ); - label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.27" ), new String[]{ CDebugUtils.toHexAddressString( address ) } ) ); //$NON-NLS-1$ + label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.27" ), new String[]{ breakpoint.getAddress() } ) ); //$NON-NLS-1$ } catch( NumberFormatException e ) { } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java 2004-09-17 09:16:34.000000000 +0400 @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.eclipse.cdt.debug.core.CDebugUtils; + import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; @@ -293,13 +293,6 @@ ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint; addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.6" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ String address = PropertyPageMessages.getString( "CBreakpointPropertyPage.4" ); //$NON-NLS-1$ - try { - address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) ); - } - catch( CoreException e ) { - } - catch( NumberFormatException e ) { - } if ( address != null ) { addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.5" ), address ) ); //$NON-NLS-1$ } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java 2004-09-17 09:16:34.000000000 +0400 @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.internal.ui.views.disassembly; import java.util.Arrays; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.IAsmInstruction; import org.eclipse.cdt.debug.core.model.IAsmSourceLine; @@ -20,7 +22,6 @@ import org.eclipse.cdt.debug.core.model.ICStackFrame; import org.eclipse.cdt.debug.core.model.IDisassembly; import org.eclipse.cdt.debug.core.model.IDisassemblyBlock; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; @@ -67,7 +68,7 @@ * @param disassembly * @param instructions */ - private DisassemblyEditorInput( IDisassemblyBlock block ) { + private DisassemblyEditorInput( IDisassemblyBlock block) { fBlock = block; createContents(); } @@ -125,7 +126,7 @@ return fContents; } - public int getInstructionLine( long address ) { + public int getInstructionLine( IAddress address ) { if ( fBlock != null ) { IAsmSourceLine[] lines = fBlock.getSourceLines(); int result = 0; @@ -134,13 +135,13 @@ ++result; for ( int j = 0; j < instructions.length; ++j ) { ++result; - if ( instructions[j].getAdress() == address ) { + if ( address.compareTo(instructions[j].getAdress()) == 0) { return result; } } } } - return 0; + return -1; } public int getInstructionLine( ICLineBreakpoint breakpoint ) { @@ -150,8 +151,8 @@ IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class ); if ( bt != null ) { try { - long address = bt.getBreakpointAddress( breakpoint ); - if ( address != 0 ) + IAddress address = bt.getBreakpointAddress( breakpoint ); + if ( ! address.isZero() ) return getInstructionLine( address ); } catch( DebugException e ) { @@ -159,10 +160,10 @@ } } } - return 0; + return -1; } - public long getAddress( int lineNumber ) { + public IAddress getAddress( int lineNumber ) { if ( fBlock != null ) { IAsmSourceLine[] lines = fBlock.getSourceLines(); int current = 0; @@ -176,7 +177,7 @@ current += instructions.length; } } - return 0; + return null; } public String getModuleFile() { @@ -185,10 +186,11 @@ public static DisassemblyEditorInput create( ICStackFrame frame ) throws DebugException { DisassemblyEditorInput input = null; - IDisassembly disassembly = ((ICDebugTarget)frame.getDebugTarget()).getDisassembly(); + ICDebugTarget target = ((ICDebugTarget)frame.getDebugTarget()); + IDisassembly disassembly = target.getDisassembly(); if ( disassembly != null ) { IDisassemblyBlock block = disassembly.getDisassemblyBlock( frame ); - input = new DisassemblyEditorInput( block ); + input = new DisassemblyEditorInput( block); } return input; } @@ -216,7 +218,8 @@ } } } - int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset ); + int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset, + fBlock.getSourceLines()[0].getInstructions()[0].getAdress().getCharsNum()); int argPosition = instrPos + maxOpcodeLength + 1; if ( fBlock.isMixedMode() ) fSourceRegions = new IRegion[mi.length]; @@ -241,7 +244,7 @@ Arrays.fill( spaces, ' ' ); StringBuffer sb = new StringBuffer(); if ( instruction != null ) { - sb.append( CDebugUIUtils.toHexAddressString( instruction.getAdress() ) ); + sb.append( instruction.getAdress().toHexAddressString() ); sb.append( ' ' ); String functionName = instruction.getFunctionName(); if ( functionName != null && functionName.length() > 0 ) { @@ -262,8 +265,9 @@ return sb.toString(); } - private int calculateInstructionPosition( int maxFunctionName, long maxOffset ) { - return (16 + maxFunctionName + Long.toString( maxOffset ).length()); + private int calculateInstructionPosition( int maxFunctionName, long maxOffset, int addressLength ) { + //(Address prefix address representation in chars) + (space) + (<) + (+) + (>) + (:) + (space) + return ( addressLength + 6 + maxFunctionName + Long.toString( maxOffset ).length() ); } private String getSourceLineString( IAsmSourceLine line ) { @@ -282,8 +286,8 @@ return ( fBlock != null ) ? fBlock.getDisassembly() : null; } - public ICLineBreakpoint breakpointExists( long address ) throws CoreException { - Assert.isTrue( address != 0 ); + public ICLineBreakpoint breakpointExists( IAddress address ) throws CoreException { + Assert.isTrue( address != null ); IDisassembly dis = getDisassembly(); if ( dis != null ) { IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class ); @@ -294,7 +298,7 @@ if ( bps[i] instanceof ICLineBreakpoint ) { ICLineBreakpoint b = (ICLineBreakpoint)bps[i]; try { - if ( address == bt.getBreakpointAddress( b ) ) + if ( address.compareTo(bt.getBreakpointAddress( b )) == 0) return b; } catch( NumberFormatException e ) { diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java 2004-09-17 09:16:34.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.views.disassembly; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.model.ICDebugTarget; import org.eclipse.cdt.debug.core.model.ICStackFrame; import org.eclipse.cdt.debug.core.model.IDisassembly; @@ -63,8 +64,8 @@ IDisassembly disassembly = getDisassembly( frame ); hashCode = 37*hashCode + (( disassembly != null ) ? disassembly.hashCode() : 0); if ( frame != null ) { - long address = frame.getAddress(); - hashCode = 37*hashCode + (int)(address^(address>>>32)); + IAddress address = frame.getAddress(); + hashCode = 37*hashCode + address.hashCode(); } return hashCode; } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java 2004-09-17 09:16:34.000000000 +0400 @@ -13,7 +13,6 @@ import org.eclipse.cdt.debug.core.CDebugModel; import org.eclipse.cdt.debug.core.ICMemoryManager; import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.debug.core.DebugException; @@ -430,7 +429,7 @@ } } if ( getMemoryBlock() != null ) { - fAddressText.setText( CDebugUIUtils.toHexAddressString( getMemoryBlock().getStartAddress() ) ); + fAddressText.setText( getMemoryBlock().getRealStartAddress().toHexAddressString() ); handleAddressEnter(); } } diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java 2004-09-17 09:16:34.000000000 +0400 @@ -11,15 +11,16 @@ package org.eclipse.cdt.debug.internal.ui.views.memory; +import java.math.BigInteger; import java.util.Arrays; import java.util.LinkedList; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.ICMemoryManager; import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlockRow; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.debug.core.DebugException; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Display; @@ -77,7 +78,7 @@ { int offset = sb.length(); sb.append( getRowText( rows[i] ) ); - fAddressZones.add( new Point( offset, offset + getAddressLength() ) ); + fAddressZones.add( new Point( offset, offset + rows[i].getAddress().getCharsNum() ) ); } return sb.toString(); } @@ -104,7 +105,7 @@ public Point[] getChangedZones() { fChangedZones.clear(); - Long[] changedAddresses = getChangedAddresses(); + IAddress[] changedAddresses = getChangedAddresses(); for ( int i = 0; i < changedAddresses.length; ++i ) { int dataOffset = getDataItemOffsetByAddress( changedAddresses[i] ); @@ -126,7 +127,7 @@ public String getStartAddress() { - return ( fBlock != null ) ? getAddressString( fBlock.getStartAddress() ) : ""; //$NON-NLS-1$ + return ( fBlock != null ) ? fBlock.getRealStartAddress().toHexAddressString() : ""; //$NON-NLS-1$ } public String getAddressExpression() @@ -141,15 +142,10 @@ return new String( chars ); } - private String getAddressString( long address ) - { - return CDebugUIUtils.toHexAddressString( address ); - } - private String getRowText( IFormattedMemoryBlockRow row ) { - StringBuffer result = new StringBuffer( getRowLength() ); - result.append( getAddressString( row.getAddress() ) ); + StringBuffer result = new StringBuffer( getRowLength( ) ); + result.append( row.getAddress().toHexAddressString() ); result.append( getInterval( INTERVAL_BETWEEN_ADDRESS_AND_DATA ) ); String[] items = row.getData(); for ( int i = 0; i < items.length; ++i ) @@ -175,9 +171,9 @@ getDataBytesPerRow() : 0 ) + 1; } - private int getAddressLength() - { - return 10; + + private int getAddressLength() { + return fBlock.getRealStartAddress().getCharsNum(); } private boolean isInAsciiArea( int offset ) @@ -293,12 +289,12 @@ return IFormattedMemoryBlock.MEMORY_FORMAT_HEX; } - private Long[] getChangedAddresses() + private IAddress[] getChangedAddresses() { - return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new Long[0]; + return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new IAddress[0]; } - private int getDataItemOffsetByAddress( Long address ) + private int getDataItemOffsetByAddress( IAddress address ) { if ( getMemoryBlock() != null ) { @@ -307,15 +303,16 @@ { int wordSize = getMemoryBlock().getWordSize(); int numberOfColumns = getMemoryBlock().getNumberOfColumns(); - if ( address.longValue() >= rows[i].getAddress() && - address.longValue() < rows[i].getAddress() + (wordSize * numberOfColumns) ) + + if( address.compareTo( rows[i].getAddress()) >=0 && + address.compareTo( rows[i].getAddress().add(BigInteger.valueOf(wordSize * numberOfColumns))) <0) { for ( int j = 1; j <= numberOfColumns; ++j ) { - if ( address.longValue() >= rows[i].getAddress() + ((j - 1) * wordSize) && - address.longValue() < rows[i].getAddress() + (j * wordSize) ) + if( address.compareTo( rows[i].getAddress().add(BigInteger.valueOf( (j - 1) * wordSize))) >=0 && + address.compareTo( rows[i].getAddress().add(BigInteger.valueOf( j * wordSize))) <0) { - return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA; + return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + address.getCharsNum() + INTERVAL_BETWEEN_ADDRESS_AND_DATA; } } } @@ -325,7 +322,7 @@ return -1; } - private int getAsciiOffsetByAddress( Long address ) + private int getAsciiOffsetByAddress( IAddress address ) { if ( getMemoryBlock() != null ) { @@ -334,14 +331,16 @@ { IFormattedMemoryBlockRow firstRow = rows[0]; IFormattedMemoryBlockRow lastRow = rows[rows.length - 1]; - if ( address.longValue() >= firstRow.getAddress() && address.longValue() <= lastRow.getAddress() ) + + if (address.compareTo( firstRow.getAddress()) >=0 && address.compareTo( lastRow.getAddress()) <=0) + { - int asciiOffset = (int)(address.longValue() - firstRow.getAddress()); + BigInteger asciiOffset = address.distance( firstRow.getAddress()); int asciiRowlength = getMemoryBlock().getWordSize() * getMemoryBlock().getNumberOfColumns(); - int numberOfRows = asciiOffset / asciiRowlength; - int offsetInRow = asciiOffset % asciiRowlength; + int numberOfRows = asciiOffset.intValue() / asciiRowlength; + int offsetInRow = asciiOffset.intValue() % asciiRowlength; return (numberOfRows * getRowLength()) + - getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA + + address.getCharsNum() + INTERVAL_BETWEEN_ADDRESS_AND_DATA + (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) * getMemoryBlock().getNumberOfColumns() + INTERVAL_BETWEEN_DATA_AND_ASCII + offsetInRow; } @@ -513,13 +512,13 @@ { if ( getMemoryBlock() != null ) { - int index = getDataItemIndex( offset ); + int index = getDataItemIndex(offset ); if ( index != -1 ) { char[] chars = getDataItemChars( index ); if ( isInDataArea( offset ) ) { - int charIndex = getOffsetInDataItem( offset, index ); + int charIndex = getOffsetInDataItem(offset, index ); chars[charIndex] = newChar; } if ( isInAsciiArea( offset ) ) @@ -539,7 +538,7 @@ int index = getDataItemIndex( offset ); if ( index != -1 ) { - String newValue = getNewItemValue( offset, ch ); + String newValue = getNewItemValue(offset, ch ); if ( newValue != null ) { try diff -NaurbB workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java --- workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java 2004-09-17 08:43:07.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java 2004-09-17 09:16:34.000000000 +0400 @@ -13,7 +13,6 @@ import org.eclipse.cdt.debug.core.model.ICDebugTarget; import org.eclipse.cdt.debug.core.model.ICSharedLibrary; import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; import org.eclipse.cdt.debug.internal.ui.PixelConverter; import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; @@ -83,11 +82,9 @@ case 2: return ( library.areSymbolsLoaded() ) ? SharedLibrariesMessages.getString( "SharedLibrariesView.Loaded_1" ) : SharedLibrariesMessages.getString( "SharedLibrariesView.Not_loaded_1" ); //$NON-NLS-1$ //$NON-NLS-2$ case 3: - return ( library.getStartAddress() > 0 ) ? - CDebugUIUtils.toHexAddressString( library.getStartAddress() ) : ""; //$NON-NLS-1$ + return library.getStartAddress().toHexAddressString(); //$NON-NLS-1$ case 4: - return ( library.getEndAddress() > 0 ) ? - CDebugUIUtils.toHexAddressString( library.getEndAddress() ) : ""; //$NON-NLS-1$ + return library.getEndAddress().toHexAddressString(); //$NON-NLS-1$ } } return null;