View | Details | Raw Unified | Return to bug 74056 | Differences between
and this patch

Collapse All | Expand All

(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java (-1 / +3 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.core.cdi.event;
11
package org.eclipse.cdt.debug.core.cdi.event;
12
12
13
import org.eclipse.cdt.core.IAddress;
14
13
/**
15
/**
14
 * 
16
 * 
15
 * Notifies that the originator has changed.
17
 * Notifies that the originator has changed.
Lines 19-23 Link Here
19
	/**
21
	/**
20
	 * @return the modified addresses.
22
	 * @return the modified addresses.
21
	 */
23
	 */
22
	Long[] getAddresses();
24
	IAddress[] getAddresses();
23
}
25
}
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDILocation.java (-1 / +3 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.core.cdi;
11
package org.eclipse.cdt.debug.core.cdi;
12
12
13
import org.eclipse.cdt.core.IAddress;
14
13
15
14
/**
16
/**
15
 * 
17
 * 
Lines 24-30 Link Here
24
	 * 
26
	 * 
25
	 * @return the address of this location
27
	 * @return the address of this location
26
	 */
28
	 */
27
	long getAddress();
29
	IAddress getAddress();
28
	
30
	
29
	/**
31
	/**
30
	 * Returns the source file of this location or <code>null</code>
32
	 * Returns the source file of this location or <code>null</code>
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java (-1 / +2 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi;
12
package org.eclipse.cdt.debug.core.cdi;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
15
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
15
16
16
/**
17
/**
Lines 41-47 Link Here
41
	 * @return a memory block with the specified identifier
42
	 * @return a memory block with the specified identifier
42
	 * @throws CDIException on failure. Reasons include:
43
	 * @throws CDIException on failure. Reasons include:
43
	 */
44
	 */
44
	ICDIMemoryBlock createMemoryBlock(long address, int length)
45
	ICDIMemoryBlock createMemoryBlock(IAddress address, int length)
45
		throws CDIException;
46
		throws CDIException;
46
47
47
	/**
48
	/**
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java (-3 / +4 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi;
12
package org.eclipse.cdt.debug.core.cdi;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
15
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
15
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
16
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
16
17
Lines 40-46 Link Here
40
	 *  @param endAddress is the end address
41
	 *  @param endAddress is the end address
41
	 *  @throws CDIException on failure.
42
	 *  @throws CDIException on failure.
42
	 */
43
	 */
43
	ICDIInstruction[] getInstructions(long startAddress, long endAddress)
44
	ICDIInstruction[] getInstructions(IAddress startAddress, IAddress endAddress)
44
		throws CDIException;
45
		throws CDIException;
45
46
46
	/**
47
	/**
Lines 66-73 Link Here
66
	 *  @throws CDIException on failure.
67
	 *  @throws CDIException on failure.
67
	 */
68
	 */
68
	ICDIMixedInstruction[] getMixedInstructions(
69
	ICDIMixedInstruction[] getMixedInstructions(
69
		long startAddress,
70
		IAddress startAddress,
70
		long endAddress)
71
	    IAddress endAddress)
71
		throws CDIException;
72
		throws CDIException;
72
73
73
	/**
74
	/**
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java (-1 / +2 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi;
12
package org.eclipse.cdt.debug.core.cdi;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint;
15
import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint;
15
16
16
/**
17
/**
Lines 155-159 Link Here
155
	 * @param address - an address
156
	 * @param address - an address
156
	 * @return an ICDILocation object 
157
	 * @return an ICDILocation object 
157
	 */
158
	 */
158
	ICDILocation createLocation( long address );
159
	ICDILocation createLocation( IAddress address );
159
}
160
}
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java (-1 / +3 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi.model;
12
package org.eclipse.cdt.debug.core.cdi.model;
13
13
14
import org.eclipse.cdt.core.IAddress;
15
14
/**
16
/**
15
 * 
17
 * 
16
 * Represents a machine instruction.
18
 * Represents a machine instruction.
Lines 22-28 Link Here
22
	 * Returns the Address.
24
	 * Returns the Address.
23
	 * @return the address.
25
	 * @return the address.
24
	 */
26
	 */
25
	long getAdress();
27
	IAddress getAdress();
26
	
28
	
27
	/**
29
	/**
28
	 * @return the function name.
30
	 * @return the function name.
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java (-1 / +2 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi.model;
12
package org.eclipse.cdt.debug.core.cdi.model;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
16
16
/**
17
/**
Lines 26-32 Link Here
26
	 * 
27
	 * 
27
	 * @return the start address of this memory block
28
	 * @return the start address of this memory block
28
	 */
29
	 */
29
	long getStartAddress();
30
	IAddress getStartAddress();
30
	
31
	
31
	/**
32
	/**
32
	 * Returns the length of this memory block in bytes.
33
	 * Returns the length of this memory block in bytes.
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java (-2 / +3 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.core.cdi.model;
11
package org.eclipse.cdt.debug.core.cdi.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.cdi.CDIException;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
14
15
15
/**
16
/**
Lines 32-45 Link Here
32
	 * 
33
	 * 
33
	 * @return the start address of this library
34
	 * @return the start address of this library
34
	 */
35
	 */
35
	long getStartAddress();
36
	IAddress getStartAddress();
36
37
37
	/**
38
	/**
38
	 * Returns the end address of this library.
39
	 * Returns the end address of this library.
39
	 * 
40
	 * 
40
	 * @return the end address of this library
41
	 * @return the end address of this library
41
	 */
42
	 */
42
	long getEndAddress();
43
	IAddress getEndAddress();
43
44
44
	/**
45
	/**
45
	 * Returns whether the symbols of this library are read.
46
	 * Returns whether the symbols of this library are read.
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java (-1 / +2 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi.model;
12
package org.eclipse.cdt.debug.core.cdi.model;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
16
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
16
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
17
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
Lines 182-187 Link Here
182
	/**
183
	/**
183
	 * Returns a ICDILocation
184
	 * Returns a ICDILocation
184
	 */
185
	 */
185
	ICDILocation createLocation(long address);
186
	ICDILocation createLocation(IAddress address);
186
187
187
}
188
}
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java (-1 / +2 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.cdi.model.type;
12
package org.eclipse.cdt.debug.core.cdi.model.type;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
16
16
17
Lines 22-26 Link Here
22
 */
23
 */
23
public interface ICDIPointerValue extends ICDIDerivedValue {
24
public interface ICDIPointerValue extends ICDIDerivedValue {
24
	
25
	
25
	long pointerValue() throws CDIException;
26
	IAddress pointerValue() throws CDIException;
26
}
27
}
(-)workspace-orig/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java (-1 / +2 lines)
Lines 10-20 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.core.cdi.model.type;
11
package org.eclipse.cdt.debug.core.cdi.model.type;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.cdi.CDIException;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
14
15
15
/**
16
/**
16
 */
17
 */
17
public interface ICDIReferenceValue extends ICDIDerivedValue {
18
public interface ICDIReferenceValue extends ICDIDerivedValue {
18
19
19
	long referenceValue() throws CDIException;
20
	IAddress referenceValue() throws CDIException;
20
}
21
}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java (-25 lines)
Lines 91-109 Link Here
91
		}
91
		}
92
	}
92
	}
93
	
93
	
94
	public static String toHexAddressString( long address )
95
	{
96
		String addressString = Long.toHexString( address );
97
		StringBuffer sb = new StringBuffer( 10 );
98
		sb.append( "0x" ); //$NON-NLS-1$
99
		for ( int i = 0; i < 8 - addressString.length(); ++i )
100
		{
101
			sb.append( '0' );
102
		}
103
		sb.append( addressString );
104
		return sb.toString();
105
	}
106
107
	public static char[] getByteText( byte b )
94
	public static char[] getByteText( byte b )
108
	{
95
	{
109
		return new char[]{ charFromByte( (byte)((b >>> 4) & 0x0f) ), 
96
		return new char[]{ charFromByte( (byte)((b >>> 4) & 0x0f) ), 
Lines 201-218 Link Here
201
		return Long.parseLong( bytesToString( bytes, le, false ), 16 );
188
		return Long.parseLong( bytesToString( bytes, le, false ), 16 );
202
	}  
189
	}  
203
	
190
	
204
	public static long toLongLong( char[] bytes, boolean le )
205
	{
206
		if ( bytes.length != 16 )
207
			return 0;
208
		return Long.parseLong( bytesToString( bytes, le, false ), 16 );
209
	}
210
	
211
	public static long toUnsignedLongLong( char[] bytes, boolean le )
212
	{
213
		return 0;
214
	}
215
	
216
	private static String bytesToString( char[] bytes, boolean le, boolean signed )
191
	private static String bytesToString( char[] bytes, boolean le, boolean signed )
217
	{
192
	{
218
		char[] copy = new char[bytes.length];
193
		char[] copy = new char[bytes.length];
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java (-2 / +4 lines)
Lines 12-17 Link Here
12
12
13
import java.text.MessageFormat;
13
import java.text.MessageFormat;
14
import java.util.HashMap;
14
import java.util.HashMap;
15
16
import org.eclipse.cdt.core.IAddress;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
17
import org.eclipse.cdt.debug.core.cdi.CDIException;
16
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
18
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
17
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
19
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
Lines 255-261 Link Here
255
	 */
257
	 */
256
	public static ICAddressBreakpoint createAddressBreakpoint( String sourceHandle, 
258
	public static ICAddressBreakpoint createAddressBreakpoint( String sourceHandle, 
257
															   IResource resource, 
259
															   IResource resource, 
258
															   long address, 
260
															   IAddress address, 
259
															   boolean enabled, 
261
															   boolean enabled, 
260
															   int ignoreCount, 
262
															   int ignoreCount, 
261
															   String condition, 
263
															   String condition, 
Lines 266-272 Link Here
266
		attributes.put( IMarker.CHAR_END, new Integer( 0 ) );
268
		attributes.put( IMarker.CHAR_END, new Integer( 0 ) );
267
		attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) );
269
		attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) );
268
		attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) );
270
		attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) );
269
		attributes.put( ICLineBreakpoint.ADDRESS, Long.toString( address ) );
271
		attributes.put( ICLineBreakpoint.ADDRESS, address.toHexAddressString() );
270
		attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) );
272
		attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) );
271
		attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) );
273
		attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) );
272
		attributes.put( ICBreakpoint.CONDITION, condition );
274
		attributes.put( ICBreakpoint.CONDITION, condition );
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IAsmInstruction.java (-1 / +3 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
14
13
/**
15
/**
14
 * An instruction of disassemby.
16
 * An instruction of disassemby.
15
 */
17
 */
Lines 20-26 Link Here
20
	 * 
22
	 * 
21
	 * @return the address of this instruction
23
	 * @return the address of this instruction
22
	 */
24
	 */
23
	long getAdress();
25
	IAddress getAdress();
24
	
26
	
25
	/**
27
	/**
26
	 * Returns the function name of this instruction, 
28
	 * Returns the function name of this instruction, 
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java (-1 / +2 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.DebugException;
14
15
15
/**
16
/**
Lines 30-34 Link Here
30
	 * @return the target address of the given breakpoint
31
	 * @return the target address of the given breakpoint
31
	 * @throws DebugException if the address is not available
32
	 * @throws DebugException if the address is not available
32
	 */
33
	 */
33
	long getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException;
34
	IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException;
34
}
35
}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java (-2 / +3 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.model.IDebugElement;
15
import org.eclipse.debug.core.model.IDebugElement;
15
16
Lines 30-43 Link Here
30
	 * 
31
	 * 
31
	 * @return the start address of this library
32
	 * @return the start address of this library
32
	 */
33
	 */
33
	long getStartAddress();
34
	IAddress getStartAddress();
34
35
35
	/**
36
	/**
36
	 * Returns the end address of this library.
37
	 * Returns the end address of this library.
37
	 * 
38
	 * 
38
	 * @return the end address of this library
39
	 * @return the end address of this library
39
	 */
40
	 */
40
	long getEndAddress();
41
	IAddress getEndAddress();
41
42
42
	/**
43
	/**
43
	 * Returns whether the symbols of this library are read.
44
	 * Returns whether the symbols of this library are read.
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICStackFrame.java (-1 / +2 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.model.IStackFrame;
15
import org.eclipse.debug.core.model.IStackFrame;
15
import org.eclipse.debug.core.model.IValue;
16
import org.eclipse.debug.core.model.IValue;
Lines 24-30 Link Here
24
	 * 
25
	 * 
25
	 * @return the address of this stack frame
26
	 * @return the address of this stack frame
26
	 */
27
	 */
27
	public long getAddress();
28
	public IAddress getAddress();
28
	
29
	
29
	/**
30
	/**
30
	 * Returns the source file of this stack frame or <code>null</code>
31
	 * Returns the source file of this stack frame or <code>null</code>
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java (-5 / +8 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.model.IMemoryBlock;
15
import org.eclipse.debug.core.model.IMemoryBlock;
15
16
Lines 104-116 Link Here
104
105
105
	char getPaddingCharacter();
106
	char getPaddingCharacter();
106
107
107
	long nextRowAddress();
108
	public IAddress getRealStartAddress();
108
	
109
	
109
	long previousRowAddress();
110
	IAddress nextRowAddress();
110
	
111
	
111
	long nextPageAddress();
112
	IAddress previousRowAddress();
112
	
113
	
113
	long previousPageAddress();
114
	IAddress nextPageAddress();
115
	
116
	IAddress previousPageAddress();
114
117
115
	void reformat( int format,
118
	void reformat( int format,
116
				   int wordSize,
119
				   int wordSize,
Lines 124-130 Link Here
124
				   char paddingChar ) throws DebugException;
127
				   char paddingChar ) throws DebugException;
125
	void dispose();
128
	void dispose();
126
129
127
	Long[] getChangedAddresses();
130
	IAddress[] getChangedAddresses();
128
	
131
	
129
	boolean isFrozen();
132
	boolean isFrozen();
130
	
133
	
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java (-1 / +3 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.core.model;
12
package org.eclipse.cdt.debug.core.model;
13
13
14
import org.eclipse.cdt.core.IAddress;
15
14
/**
16
/**
15
 * 
17
 * 
16
 * Represents a row in the output table of formatted memory block.
18
 * Represents a row in the output table of formatted memory block.
Lines 24-30 Link Here
24
	 * 
26
	 * 
25
	 * @return the address of this row
27
	 * @return the address of this row
26
	 */
28
	 */
27
	long getAddress();
29
	IAddress getAddress();
28
30
29
	/**
31
	/**
30
	 * Returns the array of memory words.
32
	 * Returns the array of memory words.
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java (-2 / +3 lines)
Lines 10-15 Link Here
10
 ***********************************************************************/
10
 ***********************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.DebugException;
14
15
15
/**
16
/**
Lines 22-33 Link Here
22
	 * 
23
	 * 
23
	 * @return whether this operation is currently available
24
	 * @return whether this operation is currently available
24
	 */
25
	 */
25
	public boolean canJumpToAddress( long address );
26
	public boolean canJumpToAddress( IAddress address );
26
27
27
	/**
28
	/**
28
	 * Causes this element to resume the execution at the specified address.
29
	 * Causes this element to resume the execution at the specified address.
29
	 * 
30
	 * 
30
	 * @exception DebugException on failure. Reasons include:
31
	 * @exception DebugException on failure. Reasons include:
31
	 */
32
	 */
32
	public void jumpToAddress( long address ) throws DebugException;
33
	public void jumpToAddress( IAddress address ) throws DebugException;
33
}
34
}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java (-2 / +3 lines)
Lines 10-15 Link Here
10
 ***********************************************************************/
10
 ***********************************************************************/
11
package org.eclipse.cdt.debug.core.model;
11
package org.eclipse.cdt.debug.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.debug.core.DebugException;
14
import org.eclipse.debug.core.DebugException;
14
15
15
/**
16
/**
Lines 22-33 Link Here
22
	 * 
23
	 * 
23
	 * @return whether this operation is currently available
24
	 * @return whether this operation is currently available
24
	 */
25
	 */
25
	public boolean canRunToAddress( long address );
26
	public boolean canRunToAddress( IAddress  address );
26
27
27
	/**
28
	/**
28
	 * Causes this element to run to specified address.
29
	 * Causes this element to run to specified address.
29
	 * 
30
	 * 
30
	 * @exception DebugException on failure. Reasons include:
31
	 * @exception DebugException on failure. Reasons include:
31
	 */
32
	 */
32
	public void runToAddress( long address, boolean skipBreakpoints ) throws DebugException;
33
	public void runToAddress( IAddress  address, boolean skipBreakpoints ) throws DebugException;
33
}
34
}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java (-4 / +2 lines)
Lines 10-22 Link Here
10
 ***********************************************************************/
10
 ***********************************************************************/
11
package org.eclipse.cdt.debug.internal.core.breakpoints;
11
package org.eclipse.cdt.debug.internal.core.breakpoints;
12
12
13
import java.text.MessageFormat;
14
import java.util.Map;
13
import java.util.Map;
15
14
16
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
15
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
17
import org.eclipse.cdt.debug.internal.core.CDebugUtils;
18
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.resources.IResource;
19
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.osgi.framework.msg.MessageFormat;
20
19
21
/**
20
/**
22
 * A breakpoint that suspend the execution when a particular address is reached.
21
 * A breakpoint that suspend the execution when a particular address is reached.
Lines 58-65 Link Here
58
			sb.append( name );
57
			sb.append( name );
59
		}
58
		}
60
		try {
59
		try {
61
			long address = Long.parseLong( getAddress() );
60
			sb.append( MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.2" ), new String[] { getAddress() } ) ); //$NON-NLS-1$
62
			sb.append( MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.2" ), new String[] { CDebugUtils.toHexAddressString( address ) } ) ); //$NON-NLS-1$
63
		}
61
		}
64
		catch( NumberFormatException e ) {
62
		catch( NumberFormatException e ) {
65
		}
63
		}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java (-5 / +7 lines)
Lines 15-20 Link Here
15
import java.util.HashMap;
15
import java.util.HashMap;
16
import java.util.Map;
16
import java.util.Map;
17
import java.util.Set;
17
import java.util.Set;
18
19
import org.eclipse.cdt.core.IAddress;
18
import org.eclipse.cdt.debug.core.CDIDebugModel;
20
import org.eclipse.cdt.debug.core.CDIDebugModel;
19
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
21
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
20
import org.eclipse.cdt.debug.core.CDebugUtils;
22
import org.eclipse.cdt.debug.core.CDebugUtils;
Lines 256-262 Link Here
256
		return getBreakpointMap().getCBreakpoint( cdiBreakpoint );
258
		return getBreakpointMap().getCBreakpoint( cdiBreakpoint );
257
	}
259
	}
258
260
259
	public long getBreakpointAddress( ICBreakpoint breakpoint ) {
261
	public IAddress getBreakpointAddress( ICBreakpoint breakpoint ) {
260
		if ( breakpoint != null ) {
262
		if ( breakpoint != null ) {
261
			ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
263
			ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
262
			if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) {
264
			if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) {
Lines 269-275 Link Here
269
				}
271
				}
270
			}
272
			}
271
		}
273
		}
272
		return 0;
274
		return fDebugTarget.getAddressFactory().getZero();
273
	}
275
	}
274
276
275
	public void setBreakpoint( ICBreakpoint breakpoint ) throws DebugException {
277
	public void setBreakpoint( ICBreakpoint breakpoint ) throws DebugException {
Lines 493-499 Link Here
493
495
494
	private ICDIBreakpoint setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException {
496
	private ICDIBreakpoint setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException {
495
		ICDITarget cdiTarget = getCDITarget();
497
		ICDITarget cdiTarget = getCDITarget();
496
		ICDILocation location = cdiTarget.createLocation( Long.parseLong( breakpoint.getAddress() ) );
498
		ICDILocation location = cdiTarget.createLocation( getDebugTarget().getAddressFactory().createAddress(breakpoint.getAddress()));
497
		ICDIBreakpoint cdiBreakpoint = null;
499
		ICDIBreakpoint cdiBreakpoint = null;
498
		synchronized ( getBreakpointMap() ) {
500
		synchronized ( getBreakpointMap() ) {
499
			cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
501
			cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
Lines 563-569 Link Here
563
					else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
565
					else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
564
						breakpoint = createFunctionBreakpoint( cdiBreakpoint );
566
						breakpoint = createFunctionBreakpoint( cdiBreakpoint );
565
					}
567
					}
566
					else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) {
568
					else if ( ! cdiBreakpoint.getLocation().getAddress().isZero() ) {
567
						breakpoint = createAddressBreakpoint( cdiBreakpoint );
569
						breakpoint = createAddressBreakpoint( cdiBreakpoint );
568
					}
570
					}
569
				}
571
				}
Lines 571-577 Link Here
571
			else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
573
			else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
572
				breakpoint = createFunctionBreakpoint( cdiBreakpoint );
574
				breakpoint = createFunctionBreakpoint( cdiBreakpoint );
573
			}
575
			}
574
			else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) {
576
			else if ( ! cdiBreakpoint.getLocation().getAddress().isZero()) {
575
				breakpoint = createAddressBreakpoint( cdiBreakpoint );
577
				breakpoint = createAddressBreakpoint( cdiBreakpoint );
576
			}
578
			}
577
		}
579
		}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java (-1 / +2 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.internal.core.model;
11
package org.eclipse.cdt.debug.internal.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
14
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
14
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
15
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
15
16
Lines 30-36 Link Here
30
	/* (non-Javadoc)
31
	/* (non-Javadoc)
31
	 * @see org.eclipse.cdt.debug.core.model.IAsmInstruction#getAdress()
32
	 * @see org.eclipse.cdt.debug.core.model.IAsmInstruction#getAdress()
32
	 */
33
	 */
33
	public long getAdress() {
34
	public IAddress getAdress() {
34
		return fCDIInstruction.getAdress();
35
		return fCDIInstruction.getAdress();
35
	}
36
	}
36
37
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java (-7 / +28 lines)
Lines 15-21 Link Here
15
import java.util.Iterator;
15
import java.util.Iterator;
16
import java.util.List;
16
import java.util.List;
17
import java.util.StringTokenizer;
17
import java.util.StringTokenizer;
18
18
import org.eclipse.cdt.core.CCorePlugin;
19
import org.eclipse.cdt.core.CCorePlugin;
20
import org.eclipse.cdt.core.IAddress;
21
import org.eclipse.cdt.core.IAddressFactory;
19
import org.eclipse.cdt.core.model.CModelException;
22
import org.eclipse.cdt.core.model.CModelException;
20
import org.eclipse.cdt.core.model.CoreModel;
23
import org.eclipse.cdt.core.model.CoreModel;
21
import org.eclipse.cdt.core.model.IBinary;
24
import org.eclipse.cdt.core.model.IBinary;
Lines 205-210 Link Here
205
	 */
208
	 */
206
	private Preferences fPreferences = null;
209
	private Preferences fPreferences = null;
207
210
211
	private IAddressFactory fAddressFactory;
212
208
	/**
213
	/**
209
	 * Constructor for CDebugTarget.
214
	 * Constructor for CDebugTarget.
210
	 */
215
	 */
Lines 754-760 Link Here
754
	 * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long)
759
	 * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long)
755
	 */
760
	 */
756
	public IMemoryBlock getMemoryBlock( long startAddress, long length ) throws DebugException {
761
	public IMemoryBlock getMemoryBlock( long startAddress, long length ) throws DebugException {
757
		return null;
762
 		//IPF_TODO look into implementation
763
 		throw new RuntimeException("Method getMemoryBlock should not be called from CDT");
758
	}
764
	}
759
765
760
	/* (non-Javadoc)
766
	/* (non-Javadoc)
Lines 1498-1504 Link Here
1498
	/* (non-Javadoc)
1504
	/* (non-Javadoc)
1499
	 * @see org.eclipse.cdt.debug.core.model.IRunToAddress#canRunToAddress(long)
1505
	 * @see org.eclipse.cdt.debug.core.model.IRunToAddress#canRunToAddress(long)
1500
	 */
1506
	 */
1501
	public boolean canRunToAddress( long address ) {
1507
	public boolean canRunToAddress( IAddress address ) {
1502
		// for now
1508
		// for now
1503
		return canResume();
1509
		return canResume();
1504
	}
1510
	}
Lines 1506-1512 Link Here
1506
	/* (non-Javadoc)
1512
	/* (non-Javadoc)
1507
	 * @see org.eclipse.cdt.debug.core.model.IRunToAddress#runToAddress(long, boolean)
1513
	 * @see org.eclipse.cdt.debug.core.model.IRunToAddress#runToAddress(long, boolean)
1508
	 */
1514
	 */
1509
	public void runToAddress( long address, boolean skipBreakpoints ) throws DebugException {
1515
	public void runToAddress( IAddress address, boolean skipBreakpoints ) throws DebugException {
1510
		if ( !canRunToAddress( address ) )
1516
		if ( !canRunToAddress( address ) )
1511
			return;
1517
			return;
1512
		if ( skipBreakpoints ) {
1518
		if ( skipBreakpoints ) {
Lines 1602-1608 Link Here
1602
	/* (non-Javadoc)
1608
	/* (non-Javadoc)
1603
	 * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#canJumpToAddress(long)
1609
	 * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#canJumpToAddress(long)
1604
	 */
1610
	 */
1605
	public boolean canJumpToAddress( long address ) {
1611
	public boolean canJumpToAddress( IAddress address ) {
1606
		// check if supports jump to address
1612
		// check if supports jump to address
1607
		return canResume();
1613
		return canResume();
1608
	}
1614
	}
Lines 1610-1616 Link Here
1610
	/* (non-Javadoc)
1616
	/* (non-Javadoc)
1611
	 * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#jumpToAddress(long)
1617
	 * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#jumpToAddress(long)
1612
	 */
1618
	 */
1613
	public void jumpToAddress( long address ) throws DebugException {
1619
	public void jumpToAddress( IAddress address ) throws DebugException {
1614
		if ( !canJumpToAddress( address ) )
1620
		if ( !canJumpToAddress( address ) )
1615
			return;
1621
			return;
1616
		ICDILocation location = getCDITarget().createLocation( address );
1622
		ICDILocation location = getCDITarget().createLocation( address );
Lines 1760-1767 Link Here
1760
	/* (non-Javadoc)
1766
	/* (non-Javadoc)
1761
	 * @see org.eclipse.cdt.debug.core.model.IBreakpointTarget#getBreakpointAddress(org.eclipse.cdt.debug.core.model.ICLineBreakpoint)
1767
	 * @see org.eclipse.cdt.debug.core.model.IBreakpointTarget#getBreakpointAddress(org.eclipse.cdt.debug.core.model.ICLineBreakpoint)
1762
	 */
1768
	 */
1763
	public long getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException {
1769
	public IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException {
1764
		return (getBreakpointManager() != null) ? getBreakpointManager().getBreakpointAddress( breakpoint ) : 0;
1770
		return (getBreakpointManager() != null) ? getBreakpointManager().getBreakpointAddress( breakpoint ) : getAddressFactory().getZero();
1765
	}
1771
	}
1766
1772
1767
	/* (non-Javadoc)
1773
	/* (non-Javadoc)
Lines 1838-1841 Link Here
1838
	public boolean isPostMortem() {
1844
	public boolean isPostMortem() {
1839
		return false;
1845
		return false;
1840
	}
1846
	}
1847
 	public IAddressFactory getAddressFactory()
1848
 	{
1849
 		if ( fAddressFactory == null )
1850
 		{
1851
 			if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) )
1852
 			{
1853
 				ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() );
1854
 				if ( cFile instanceof IBinary )
1855
 				{
1856
 					fAddressFactory = ((IBinary)cFile).getAddressFactory();
1857
 				}
1858
 			}
1859
 		}
1860
 		return fAddressFactory;
1861
 	}
1841
}
1862
}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java (-21 / +29 lines)
Lines 10-18 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.internal.core.model;
11
package org.eclipse.cdt.debug.internal.core.model;
12
12
13
import java.math.BigInteger;
13
import java.util.ArrayList;
14
import java.util.ArrayList;
14
import java.util.List;
15
import java.util.List;
15
16
17
import org.eclipse.cdt.core.IAddress;
16
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
18
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
17
import org.eclipse.cdt.debug.core.CDebugUtils;
19
import org.eclipse.cdt.debug.core.CDebugUtils;
18
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.CDIException;
Lines 43-56 Link Here
43
{
45
{
44
	class CFormattedMemoryBlockRow implements IFormattedMemoryBlockRow
46
	class CFormattedMemoryBlockRow implements IFormattedMemoryBlockRow
45
	{
47
	{
46
		private long fAddress;
48
		private IAddress fAddress;
47
		private String[] fData;
49
		private String[] fData;
48
		private String fAscii;
50
		private String fAscii;
49
51
50
		/**
52
		/**
51
		 * Constructor for CFormattedMemoryBlockRow.
53
		 * Constructor for CFormattedMemoryBlockRow.
52
		 */
54
		 */
53
		public CFormattedMemoryBlockRow( long address, String[] data, String ascii )
55
		public CFormattedMemoryBlockRow( IAddress address, String[] data, String ascii )
54
		{
56
		{
55
			fAddress = address;
57
			fAddress = address;
56
			fData = data;
58
			fData = data;
Lines 60-66 Link Here
60
		/* (non-Javadoc)
62
		/* (non-Javadoc)
61
		 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getAddress()
63
		 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getAddress()
62
		 */
64
		 */
63
		public long getAddress()
65
		public IAddress getAddress()
64
		{
66
		{
65
			return fAddress;
67
			return fAddress;
66
		}
68
		}
Lines 92-98 Link Here
92
	private boolean fDisplayAscii = true;
94
	private boolean fDisplayAscii = true;
93
	private char fPaddingChar = '.';
95
	private char fPaddingChar = '.';
94
	private List fRows = null;
96
	private List fRows = null;
95
	private Long[] fChangedAddresses = new Long[0];
97
	private IAddress[] fChangedAddresses = new IAddress[0];
96
	private boolean fStartAddressChanged = false;
98
	private boolean fStartAddressChanged = false;
97
99
98
	/**
100
	/**
Lines 219-251 Link Here
219
	/* (non-Javadoc)
221
	/* (non-Javadoc)
220
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextRowAddress()
222
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextRowAddress()
221
	 */
223
	 */
222
	public long nextRowAddress()
224
	public IAddress nextRowAddress()
223
	{
225
	{
224
		return 0;
226
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
225
	}
227
	}
226
228
227
	/* (non-Javadoc)
229
	/* (non-Javadoc)
228
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousRowAddress()
230
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousRowAddress()
229
	 */
231
	 */
230
	public long previousRowAddress()
232
	public IAddress previousRowAddress()
231
	{
233
	{
232
		return 0;
234
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
233
	}
235
	}
234
236
235
	/* (non-Javadoc)
237
	/* (non-Javadoc)
236
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextPageAddress()
238
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextPageAddress()
237
	 */
239
	 */
238
	public long nextPageAddress()
240
	public IAddress nextPageAddress()
239
	{
241
	{
240
		return 0;
242
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
241
	}
243
	}
242
244
243
	/* (non-Javadoc)
245
	/* (non-Javadoc)
244
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousPageAddress()
246
	 * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousPageAddress()
245
	 */
247
	 */
246
	public long previousPageAddress()
248
	public IAddress previousPageAddress()
247
	{
249
	{
248
		return 0;
250
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
249
	}
251
	}
250
252
251
	/* (non-Javadoc)
253
	/* (non-Javadoc)
Lines 285-297 Link Here
285
	 */
287
	 */
286
	public long getStartAddress()
288
	public long getStartAddress()
287
	{
289
	{
290
		//IPF_TODO look into implementation
291
		throw new RuntimeException("Method IMemoryBlock.getStartAddress shoud not be called in CDT debug");
292
	}
293
294
	public IAddress getRealStartAddress()
295
	{
288
		if ( fCDIMemoryBlock != null )
296
		if ( fCDIMemoryBlock != null )
289
		{
297
		{
290
			return fCDIMemoryBlock.getStartAddress();
298
			return fCDIMemoryBlock.getStartAddress();
291
		}
299
		}
292
		return 0;
300
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
293
	}
301
	}
294
295
	/* (non-Javadoc)
302
	/* (non-Javadoc)
296
	 * @see org.eclipse.debug.core.model.IMemoryBlock#getLength()
303
	 * @see org.eclipse.debug.core.model.IMemoryBlock#getLength()
297
	 */
304
	 */
Lines 510-528 Link Here
510
		fireTerminateEvent();
517
		fireTerminateEvent();
511
	}
518
	}
512
	
519
	
513
	public Long[] getChangedAddresses()
520
	public IAddress[] getChangedAddresses()
514
	{
521
	{
515
		return fChangedAddresses;
522
		return fChangedAddresses;
516
	}
523
	}
517
524
518
	protected void setChangedAddresses( Long[] changedAddresses )
525
	protected void setChangedAddresses( IAddress[] changedAddresses )
519
	{
526
	{
520
		fChangedAddresses = changedAddresses;
527
		fChangedAddresses = changedAddresses;
521
	}
528
	}
522
	
529
	
523
	protected void resetChangedAddresses()
530
	protected void resetChangedAddresses()
524
	{
531
	{
525
		fChangedAddresses = new Long[0];
532
		fChangedAddresses = new IAddress[0];
526
	}
533
	}
527
534
528
	/**
535
	/**
Lines 679-690 Link Here
679
		return fStartAddressChanged;
686
		return fStartAddressChanged;
680
	}
687
	}
681
	
688
	
682
	private long getRowAddress( int offset )
689
	private IAddress getRowAddress(int offset )
683
	{
690
	{
684
		long result = getStartAddress() + offset;		
691
		IAddress result = getRealStartAddress().add(BigInteger.valueOf(offset));
685
		if ( result > 0xFFFFFFFFL )
692
		IAddress max = ((CDebugTarget)getDebugTarget()).getAddressFactory().getMax();
693
		if ( result.compareTo(max) > 0 )
686
		{
694
		{
687
			result -= 0xFFFFFFFFL;
695
			result = result.add(result.getMaxOffset().negate());
688
		}
696
		}
689
		return result;
697
		return result;
690
	}
698
	}
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java (-4 / +5 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.internal.core.model;
11
package org.eclipse.cdt.debug.internal.core.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.cdi.CDIException;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
14
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
15
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
15
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
16
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
Lines 52-72 Link Here
52
	/* (non-Javadoc)
53
	/* (non-Javadoc)
53
	 * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getStartAddress()
54
	 * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getStartAddress()
54
	 */
55
	 */
55
	public long getStartAddress()
56
	public IAddress getStartAddress()
56
	{
57
	{
57
		if ( getCDISharedLibrary() != null )
58
		if ( getCDISharedLibrary() != null )
58
			return getCDISharedLibrary().getStartAddress();
59
			return getCDISharedLibrary().getStartAddress();
59
		return 0;
60
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
60
	}
61
	}
61
62
62
	/* (non-Javadoc)
63
	/* (non-Javadoc)
63
	 * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getEndAddress()
64
	 * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getEndAddress()
64
	 */
65
	 */
65
	public long getEndAddress()
66
	public IAddress getEndAddress()
66
	{
67
	{
67
		if ( getCDISharedLibrary() != null )
68
		if ( getCDISharedLibrary() != null )
68
			return getCDISharedLibrary().getEndAddress();
69
			return getCDISharedLibrary().getEndAddress();
69
		return 0;
70
		return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero();
70
	}
71
	}
71
72
72
	/* (non-Javadoc)
73
	/* (non-Javadoc)
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java (-1 / +3 lines)
Lines 16-21 Link Here
16
import java.util.Arrays;
16
import java.util.Arrays;
17
import java.util.Iterator;
17
import java.util.Iterator;
18
import java.util.List;
18
import java.util.List;
19
20
import org.eclipse.cdt.core.IAddress;
19
import org.eclipse.cdt.debug.core.cdi.CDIException;
21
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
22
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
21
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
23
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
Lines 529-535 Link Here
529
	/* (non-Javadoc)
531
	/* (non-Javadoc)
530
	 * @see org.eclipse.cdt.debug.core.model.ICStackFrame#getAddress()
532
	 * @see org.eclipse.cdt.debug.core.model.ICStackFrame#getAddress()
531
	 */
533
	 */
532
	public long getAddress() {
534
	public IAddress getAddress() {
533
		return getCDIStackFrame().getLocation().getAddress();
535
		return getCDIStackFrame().getLocation().getAddress();
534
	}
536
	}
535
537
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java (-27 / +36 lines)
Lines 16-21 Link Here
16
import java.util.Collections;
16
import java.util.Collections;
17
import java.util.Iterator;
17
import java.util.Iterator;
18
import java.util.List;
18
import java.util.List;
19
20
import org.eclipse.cdt.core.IAddress;
19
import org.eclipse.cdt.debug.core.cdi.CDIException;
21
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
22
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
21
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
23
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
Lines 274-285 Link Here
274
	private String getLongValueString( ICDILongValue value ) throws CDIException {
276
	private String getLongValueString( ICDILongValue value ) throws CDIException {
275
		CVariableFormat format = getParentVariable().getFormat(); 
277
		CVariableFormat format = getParentVariable().getFormat(); 
276
		if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) {
278
		if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) {
277
			return (isUnsigned()) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() );
279
			if ( isUnsigned() ) {
280
				BigInteger bigValue = new BigInteger( value.getValueString() );
281
				return bigValue.toString();
282
			}
283
			return Long.toString( value.longValue() );
278
		}
284
		}
279
		else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) {
285
		else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) {
280
			StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
286
			StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
281
			String stringValue = Long.toHexString( (isUnsigned()) ? value.longValue() : value.intValue() );
287
			if ( isUnsigned() ) {
282
			sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
288
				BigInteger bigValue = new BigInteger( value.getValueString() );
289
				sb.append( bigValue.toString( 16 ) );
290
			}
291
			else
292
				sb.append( Long.toHexString( value.longValue() ) );
283
			return sb.toString();
293
			return sb.toString();
284
		}
294
		}
285
		return null;
295
		return null;
Lines 351-383 Link Here
351
		return null;
361
		return null;
352
	}
362
	}
353
363
354
	private String getPointerValueString( ICDIPointerValue value ) throws CDIException {
364
  	private String getPointerValueString( ICDIPointerValue value ) throws CDIException
355
		long longValue = value.pointerValue();
365
  	{
356
		CVariableFormat format = getParentVariable().getFormat(); 
366
 		//IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references
357
		if ( CVariableFormat.DECIMAL.equals( format ) ) {
367
 		IAddress address = value.pointerValue();
358
			return Long.toString( longValue );
368
 		if(address == null) return "";
359
		}
369
		CVariableFormat format = getParentVariable().getFormat(); 
360
		else if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) ) {
370
        if( CVariableFormat.NATURAL.equals( format ) ||
361
			StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
371
            CVariableFormat.HEXADECIMAL.equals( format ) )
362
			String stringValue = Long.toHexString( longValue );
372
            return address.toHexAddressString();
363
			sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
373
		if( CVariableFormat.DECIMAL.equals( format ))
364
			return sb.toString();
374
  			return address.toString();
365
		}
366
		return null;
375
		return null;
367
	}
376
	}
368
377
369
	private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException {
378
  	private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException
370
		long longValue = value.referenceValue();
379
  	{
371
		CVariableFormat format = getParentVariable().getFormat(); 
380
  		//NOTE: Reference should be displayed identically to address
372
		if ( CVariableFormat.DECIMAL.equals( format ) ) {
381
 		//IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references
373
			return Long.toString( longValue );
382
 		IAddress address = value.referenceValue();
374
		}
383
 		if(address == null) return "";
375
		else if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) ) {
384
		CVariableFormat format = getParentVariable().getFormat(); 
376
			StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
385
        if( CVariableFormat.NATURAL.equals( format ) ||
377
			String stringValue = Long.toHexString( longValue );
386
            CVariableFormat.HEXADECIMAL.equals( format ) )
378
			sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue );
387
            return address.toHexAddressString();
379
			return sb.toString();
388
        if( CVariableFormat.DECIMAL.equals( format ))
380
		}
389
            return address.toString();
381
		return null;
390
		return null;
382
	}
391
	}
383
392
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java (-4 / +6 lines)
Lines 16-21 Link Here
16
import java.io.IOException;
16
import java.io.IOException;
17
import java.io.LineNumberReader;
17
import java.io.LineNumberReader;
18
18
19
import org.eclipse.cdt.core.IAddress;
19
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
20
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
20
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
21
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
21
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
22
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
Lines 39-47 Link Here
39
	
40
	
40
	private IAsmSourceLine[] fSourceLines;
41
	private IAsmSourceLine[] fSourceLines;
41
42
42
	private long fStartAddress = 0;
43
	private IAddress fStartAddress;
43
44
44
	private long fEndAddress = 0;
45
	private IAddress fEndAddress;
45
	
46
	
46
	private boolean fMixedMode = false;
47
	private boolean fMixedMode = false;
47
48
Lines 100-107 Link Here
100
	public boolean contains( ICStackFrame frame ) {
101
	public boolean contains( ICStackFrame frame ) {
101
		if ( !getDisassembly().getDebugTarget().equals( frame.getDebugTarget() ) )
102
		if ( !getDisassembly().getDebugTarget().equals( frame.getDebugTarget() ) )
102
			return false;
103
			return false;
103
		long address = frame.getAddress();
104
		IAddress address = frame.getAddress();
104
		return (address >= fStartAddress && address <= fEndAddress);
105
		return ( address.compareTo(fStartAddress) >= 0 && 
106
				 address.compareTo(fEndAddress)   <= 0    );
105
	}
107
	}
106
108
107
	/* (non-Javadoc)
109
	/* (non-Javadoc)
(-)workspace-orig/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/Disassembly.java (-7 / +7 lines)
Lines 10-17 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.internal.core.model;
11
package org.eclipse.cdt.debug.internal.core.model;
12
12
13
import java.math.BigInteger;
13
import java.util.ArrayList;
14
import java.util.ArrayList;
14
15
16
import org.eclipse.cdt.core.IAddress;
15
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
17
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
16
import org.eclipse.cdt.debug.core.ICDebugConstants;
18
import org.eclipse.cdt.debug.core.ICDebugConstants;
17
import org.eclipse.cdt.debug.core.cdi.CDIException;
19
import org.eclipse.cdt.debug.core.cdi.CDIException;
Lines 62-68 Link Here
62
				String fileName = frame.getFile();
64
				String fileName = frame.getFile();
63
				int lineNumber = frame.getLineNumber();
65
				int lineNumber = frame.getLineNumber();
64
				ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
66
				ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
65
				long address = frame.getAddress();				
67
				IAddress address = frame.getAddress();				
66
				if ( fileName != null && fileName.length() > 0 ) {
68
				if ( fileName != null && fileName.length() > 0 ) {
67
					try {
69
					try {
68
						mixedInstrs = sm.getMixedInstructions( fileName, 
70
						mixedInstrs = sm.getMixedInstructions( fileName, 
Lines 73-91 Link Here
73
						targetRequestFailed( e.getMessage(), e );
75
						targetRequestFailed( e.getMessage(), e );
74
					}
76
					}
75
				}
77
				}
76
				if ( mixedInstrs.length == 0 ||
77
				// Double check if debugger returns correct address range.
78
				// Double check if debugger returns correct address range.
79
				if ( mixedInstrs.length == 0 ||
78
						!containsAddress( mixedInstrs, address ) ) {
80
						!containsAddress( mixedInstrs, address ) ) {
79
					if ( address >= 0 ) {
80
						try {
81
						try {
81
							ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( address, address + DISASSEMBLY_BLOCK_SIZE ) );
82
							ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( address, address.add(BigInteger.valueOf(DISASSEMBLY_BLOCK_SIZE)) ) );
82
							return DisassemblyBlock.create( this, instructions );
83
							return DisassemblyBlock.create( this, instructions );
83
						}
84
						}
84
						catch( CDIException e ) {
85
						catch( CDIException e ) {
85
							targetRequestFailed( e.getMessage(), e );
86
							targetRequestFailed( e.getMessage(), e );
86
						}
87
						}
87
					}
88
					}
88
				}
89
				else {
89
				else {
90
					return DisassemblyBlock.create( this, mixedInstrs );
90
					return DisassemblyBlock.create( this, mixedInstrs );
91
				}
91
				}
Lines 94-104 Link Here
94
		return null;
94
		return null;
95
	}
95
	}
96
96
97
	private boolean containsAddress( ICDIMixedInstruction[] mi, long address ) {
97
	private boolean containsAddress( ICDIMixedInstruction[] mi, IAddress address ) {
98
		for( int i = 0; i < mi.length; ++i ) {
98
		for( int i = 0; i < mi.length; ++i ) {
99
			ICDIInstruction[] instructions = mi[i].getInstructions();
99
			ICDIInstruction[] instructions = mi[i].getInstructions();
100
			for ( int j = 0; j < instructions.length; ++j )
100
			for ( int j = 0; j < instructions.length; ++j )
101
				if ( instructions[j].getAdress() == address )
101
				if ( address.equals(instructions[j].getAdress()))
102
					return true;
102
					return true;
103
		}
103
		}
104
		return false;
104
		return false;
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java (-1 / +2 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.internal.ui.actions;
11
package org.eclipse.cdt.debug.internal.ui.actions;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.core.resources.FileStorage;
14
import org.eclipse.cdt.core.resources.FileStorage;
14
import org.eclipse.cdt.debug.core.model.IJumpToAddress;
15
import org.eclipse.cdt.debug.core.model.IJumpToAddress;
15
import org.eclipse.cdt.debug.core.model.IJumpToLine;
16
import org.eclipse.cdt.debug.core.model.IJumpToLine;
Lines 176-182 Link Here
176
		}
177
		}
177
	}
178
	}
178
179
179
	protected void jumpToAddress( long address )
180
	protected void jumpToAddress( IAddress address )
180
	{
181
	{
181
		IJumpToAddress target = (IJumpToAddress)getDebugTarget().getAdapter( IJumpToAddress.class );
182
		IJumpToAddress target = (IJumpToAddress)getDebugTarget().getAdapter( IJumpToAddress.class );
182
		if ( target != null )
183
		if ( target != null )
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java (-2 / +3 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.internal.ui.actions;
11
package org.eclipse.cdt.debug.internal.ui.actions;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.CDIDebugModel;
14
import org.eclipse.cdt.debug.core.CDIDebugModel;
14
import org.eclipse.cdt.debug.core.model.IJumpToAddress;
15
import org.eclipse.cdt.debug.core.model.IJumpToAddress;
15
import org.eclipse.cdt.debug.core.model.IJumpToLine;
16
import org.eclipse.cdt.debug.core.model.IJumpToLine;
Lines 247-253 Link Here
247
			}
248
			}
248
			ITextSelection textSelection = (ITextSelection)selection;
249
			ITextSelection textSelection = (ITextSelection)selection;
249
			int lineNumber = textSelection.getStartLine() + 1;
250
			int lineNumber = textSelection.getStartLine() + 1;
250
			long address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
251
			IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
251
			return jumpToAddress.canJumpToAddress( address );
252
			return jumpToAddress.canJumpToAddress( address );
252
		}
253
		}
253
		return false;
254
		return false;
Lines 287-293 Link Here
287
			else {
288
			else {
288
				ITextSelection textSelection = (ITextSelection)selection;
289
				ITextSelection textSelection = (ITextSelection)selection;
289
				int lineNumber = textSelection.getStartLine() + 1;
290
				int lineNumber = textSelection.getStartLine() + 1;
290
				long address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
291
				IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
291
				IJumpToAddress jumpToAddress = (IJumpToAddress)((IAdaptable)debugTarget).getAdapter( IJumpToAddress.class );
292
				IJumpToAddress jumpToAddress = (IJumpToAddress)((IAdaptable)debugTarget).getAdapter( IJumpToAddress.class );
292
				if ( jumpToAddress != null )
293
				if ( jumpToAddress != null )
293
					jumpToAddress.jumpToAddress( address );
294
					jumpToAddress.jumpToAddress( address );
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java (-1 / +2 lines)
Lines 10-15 Link Here
10
 ***********************************************************************/
10
 ***********************************************************************/
11
package org.eclipse.cdt.debug.internal.ui.actions;
11
package org.eclipse.cdt.debug.internal.ui.actions;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.CDIDebugModel;
14
import org.eclipse.cdt.debug.core.CDIDebugModel;
14
import org.eclipse.cdt.debug.core.model.IRunToAddress;
15
import org.eclipse.cdt.debug.core.model.IRunToAddress;
15
import org.eclipse.cdt.debug.core.model.IRunToLine;
16
import org.eclipse.cdt.debug.core.model.IRunToLine;
Lines 83-89 Link Here
83
			else {
84
			else {
84
				ITextSelection textSelection = (ITextSelection)selection;
85
				ITextSelection textSelection = (ITextSelection)selection;
85
				int lineNumber = textSelection.getStartLine() + 1;
86
				int lineNumber = textSelection.getStartLine() + 1;
86
				long address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
87
				IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
87
				if ( target instanceof IAdaptable ) {
88
				if ( target instanceof IAdaptable ) {
88
					IRunToAddress runToAddress = (IRunToAddress)((IAdaptable)target).getAdapter( IRunToAddress.class );
89
					IRunToAddress runToAddress = (IRunToAddress)((IAdaptable)target).getAdapter( IRunToAddress.class );
89
					if ( runToAddress != null && runToAddress.canRunToAddress( address ) ) {
90
					if ( runToAddress != null && runToAddress.canRunToAddress( address ) ) {
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java (-2 / +3 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.internal.ui.actions;
11
package org.eclipse.cdt.debug.internal.ui.actions;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.core.model.CModelException;
14
import org.eclipse.cdt.core.model.CModelException;
14
import org.eclipse.cdt.core.model.IDeclaration;
15
import org.eclipse.cdt.core.model.IDeclaration;
15
import org.eclipse.cdt.core.model.IFunction;
16
import org.eclipse.cdt.core.model.IFunction;
Lines 110-117 Link Here
110
					errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$
111
					errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$
111
				}
112
				}
112
				else {
113
				else {
113
					long address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
114
					IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber );
114
					if ( address == 0 ) {
115
					if ( address == null ) {
115
						errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$						
116
						errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$						
116
					}
117
					}
117
					else {
118
					else {
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java (-10 / +1 lines)
Lines 24-39 Link Here
24
 */
24
 */
25
public class CDebugUIUtils
25
public class CDebugUIUtils
26
{
26
{
27
	static public String toHexAddressString( long address )
27
28
	{
29
		String tmp = Long.toHexString( address );
30
		char[] prefix = new char[10 - tmp.length()];
31
		prefix[0] = '0';
32
		prefix[1] = 'x';
33
		for ( int i = 2; i < prefix.length; ++i )
34
			prefix[i] = '0';
35
		return new String( prefix ) + tmp;
36
	} 
37
28
38
	static public IRegion findWord( IDocument document, int offset ) 
29
	static public IRegion findWord( IDocument document, int offset ) 
39
	{
30
	{
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java (-2 / +1 lines)
Lines 703-711 Link Here
703
703
704
	protected StringBuffer appendAddress( ICAddressBreakpoint breakpoint, StringBuffer label ) throws CoreException {
704
	protected StringBuffer appendAddress( ICAddressBreakpoint breakpoint, StringBuffer label ) throws CoreException {
705
		try {
705
		try {
706
			long address = Long.parseLong( breakpoint.getAddress() );
707
			label.append( ' ' );
706
			label.append( ' ' );
708
			label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.27" ), new String[]{ CDebugUtils.toHexAddressString( address ) } ) ); //$NON-NLS-1$
707
			label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.27" ), new String[]{ breakpoint.getAddress() } ) ); //$NON-NLS-1$
709
		}
708
		}
710
		catch( NumberFormatException e ) {
709
		catch( NumberFormatException e ) {
711
		}
710
		}
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java (-8 / +1 lines)
Lines 13-19 Link Here
13
import java.util.ArrayList;
13
import java.util.ArrayList;
14
import java.util.Iterator;
14
import java.util.Iterator;
15
import java.util.List;
15
import java.util.List;
16
import org.eclipse.cdt.debug.core.CDebugUtils;
16
17
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
17
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
18
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
18
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
19
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
19
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
Lines 293-305 Link Here
293
			ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint;
293
			ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint;
294
			addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.6" ) ) );  //$NON-NLS-1$//$NON-NLS-2$
294
			addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.6" ) ) );  //$NON-NLS-1$//$NON-NLS-2$
295
			String address = PropertyPageMessages.getString( "CBreakpointPropertyPage.4" ); //$NON-NLS-1$
295
			String address = PropertyPageMessages.getString( "CBreakpointPropertyPage.4" ); //$NON-NLS-1$
296
			try {
297
				address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) );
298
			}
299
			catch( CoreException e ) {
300
			}
301
			catch( NumberFormatException e ) {
302
			}
303
			if ( address != null ) {
296
			if ( address != null ) {
304
				addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.5" ), address ) ); //$NON-NLS-1$
297
				addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.5" ), address ) ); //$NON-NLS-1$
305
			}
298
			}
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java (-19 / +23 lines)
Lines 11-16 Link Here
11
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
11
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
12
12
13
import java.util.Arrays;
13
import java.util.Arrays;
14
15
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.CDIDebugModel;
16
import org.eclipse.cdt.debug.core.CDIDebugModel;
15
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
17
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
16
import org.eclipse.cdt.debug.core.model.IAsmSourceLine;
18
import org.eclipse.cdt.debug.core.model.IAsmSourceLine;
Lines 20-26 Link Here
20
import org.eclipse.cdt.debug.core.model.ICStackFrame;
22
import org.eclipse.cdt.debug.core.model.ICStackFrame;
21
import org.eclipse.cdt.debug.core.model.IDisassembly;
23
import org.eclipse.cdt.debug.core.model.IDisassembly;
22
import org.eclipse.cdt.debug.core.model.IDisassemblyBlock;
24
import org.eclipse.cdt.debug.core.model.IDisassemblyBlock;
23
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
24
import org.eclipse.core.runtime.CoreException;
25
import org.eclipse.core.runtime.CoreException;
25
import org.eclipse.debug.core.DebugException;
26
import org.eclipse.debug.core.DebugException;
26
import org.eclipse.debug.core.DebugPlugin;
27
import org.eclipse.debug.core.DebugPlugin;
Lines 67-73 Link Here
67
	 * @param disassembly
68
	 * @param disassembly
68
	 * @param instructions
69
	 * @param instructions
69
	 */
70
	 */
70
	private DisassemblyEditorInput( IDisassemblyBlock block ) {
71
	private DisassemblyEditorInput( IDisassemblyBlock block) {
71
		fBlock = block;
72
		fBlock = block;
72
		createContents();
73
		createContents();
73
	}
74
	}
Lines 125-131 Link Here
125
		return fContents;
126
		return fContents;
126
	}
127
	}
127
128
128
	public int getInstructionLine( long address ) {
129
	public int getInstructionLine( IAddress address ) {
129
		if ( fBlock != null ) {
130
		if ( fBlock != null ) {
130
			IAsmSourceLine[] lines = fBlock.getSourceLines();
131
			IAsmSourceLine[] lines = fBlock.getSourceLines();
131
			int result = 0;
132
			int result = 0;
Lines 134-146 Link Here
134
				++result;
135
				++result;
135
				for ( int j = 0; j < instructions.length; ++j ) {
136
				for ( int j = 0; j < instructions.length; ++j ) {
136
					++result;
137
					++result;
137
					if ( instructions[j].getAdress() == address ) {
138
					if ( address.compareTo(instructions[j].getAdress()) ==  0) {
138
						return result;
139
						return result;
139
					}
140
					}
140
				}
141
				}
141
			}
142
			}
142
		}
143
		}
143
		return 0;
144
		return -1;
144
	}
145
	}
145
146
146
	public int getInstructionLine( ICLineBreakpoint breakpoint ) {
147
	public int getInstructionLine( ICLineBreakpoint breakpoint ) {
Lines 150-157 Link Here
150
				IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class );
151
				IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class );
151
				if ( bt != null ) {
152
				if ( bt != null ) {
152
					try {
153
					try {
153
						long address = bt.getBreakpointAddress( breakpoint );
154
						IAddress address = bt.getBreakpointAddress( breakpoint );
154
						if ( address != 0 )
155
						if ( ! address.isZero()  )
155
							return getInstructionLine( address );
156
							return getInstructionLine( address );
156
					}
157
					}
157
					catch( DebugException e ) {
158
					catch( DebugException e ) {
Lines 159-168 Link Here
159
				}
160
				}
160
			}
161
			}
161
		}
162
		}
162
		return 0;
163
		return -1;
163
	}
164
	}
164
165
165
	public long getAddress( int lineNumber ) {
166
	public IAddress getAddress( int lineNumber ) {
166
		if ( fBlock != null ) {
167
		if ( fBlock != null ) {
167
			IAsmSourceLine[] lines = fBlock.getSourceLines();
168
			IAsmSourceLine[] lines = fBlock.getSourceLines();
168
			int current = 0;
169
			int current = 0;
Lines 176-182 Link Here
176
				current += instructions.length;
177
				current += instructions.length;
177
			}
178
			}
178
		}
179
		}
179
		return 0;
180
		return null;
180
	}
181
	}
181
182
182
	public String getModuleFile() {
183
	public String getModuleFile() {
Lines 185-194 Link Here
185
186
186
	public static DisassemblyEditorInput create( ICStackFrame frame ) throws DebugException {
187
	public static DisassemblyEditorInput create( ICStackFrame frame ) throws DebugException {
187
		DisassemblyEditorInput input = null;
188
		DisassemblyEditorInput input = null;
188
		IDisassembly disassembly = ((ICDebugTarget)frame.getDebugTarget()).getDisassembly();
189
		ICDebugTarget target = ((ICDebugTarget)frame.getDebugTarget());
190
		IDisassembly disassembly = target.getDisassembly();
189
		if ( disassembly != null ) {
191
		if ( disassembly != null ) {
190
			IDisassemblyBlock block = disassembly.getDisassemblyBlock( frame );
192
			IDisassemblyBlock block = disassembly.getDisassemblyBlock( frame );
191
			input = new DisassemblyEditorInput( block );
193
			input = new DisassemblyEditorInput( block);
192
		}
194
		}
193
		return input;
195
		return input;
194
	}
196
	}
Lines 216-222 Link Here
216
					}
218
					}
217
				}
219
				}
218
			}
220
			}
219
			int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset );
221
			int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset,
222
														 fBlock.getSourceLines()[0].getInstructions()[0].getAdress().getCharsNum());
220
			int argPosition = instrPos + maxOpcodeLength + 1;
223
			int argPosition = instrPos + maxOpcodeLength + 1;
221
			if ( fBlock.isMixedMode() )
224
			if ( fBlock.isMixedMode() )
222
				fSourceRegions = new IRegion[mi.length]; 
225
				fSourceRegions = new IRegion[mi.length]; 
Lines 241-247 Link Here
241
		Arrays.fill( spaces, ' ' );
244
		Arrays.fill( spaces, ' ' );
242
		StringBuffer sb = new StringBuffer();
245
		StringBuffer sb = new StringBuffer();
243
		if ( instruction != null ) {
246
		if ( instruction != null ) {
244
			sb.append( CDebugUIUtils.toHexAddressString( instruction.getAdress() ) );
247
			sb.append( instruction.getAdress().toHexAddressString() );
245
			sb.append( ' ' );
248
			sb.append( ' ' );
246
			String functionName = instruction.getFunctionName();
249
			String functionName = instruction.getFunctionName();
247
			if ( functionName != null && functionName.length() > 0 ) {
250
			if ( functionName != null && functionName.length() > 0 ) {
Lines 262-269 Link Here
262
		return sb.toString();
265
		return sb.toString();
263
	}
266
	}
264
267
265
	private int calculateInstructionPosition( int maxFunctionName, long maxOffset ) {
268
	private int calculateInstructionPosition( int maxFunctionName, long maxOffset, int addressLength ) {
266
		return (16 + maxFunctionName + Long.toString( maxOffset ).length());
269
	    //(Address prefix address representation in chars) + (space) + (<) + (+) + (>) + (:) + (space)
270
	    return ( addressLength + 6 + maxFunctionName + Long.toString( maxOffset ).length() );
267
	}
271
	}
268
272
269
	private String getSourceLineString( IAsmSourceLine line ) {
273
	private String getSourceLineString( IAsmSourceLine line ) {
Lines 282-289 Link Here
282
		return ( fBlock != null ) ? fBlock.getDisassembly() : null;
286
		return ( fBlock != null ) ? fBlock.getDisassembly() : null;
283
	}
287
	}
284
288
285
	public ICLineBreakpoint breakpointExists( long address ) throws CoreException {
289
	public ICLineBreakpoint breakpointExists( IAddress address ) throws CoreException {
286
		Assert.isTrue( address != 0 );
290
		Assert.isTrue( address != null );
287
		IDisassembly dis = getDisassembly();
291
		IDisassembly dis = getDisassembly();
288
		if ( dis != null ) {
292
		if ( dis != null ) {
289
			IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class );
293
			IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class );
Lines 294-300 Link Here
294
					if ( bps[i] instanceof ICLineBreakpoint ) {
298
					if ( bps[i] instanceof ICLineBreakpoint ) {
295
						ICLineBreakpoint b = (ICLineBreakpoint)bps[i];
299
						ICLineBreakpoint b = (ICLineBreakpoint)bps[i];
296
						try {
300
						try {
297
							if ( address == bt.getBreakpointAddress( b )  )
301
							if ( address.compareTo(bt.getBreakpointAddress( b )) == 0)
298
								return b;
302
								return b;
299
						}
303
						}
300
						catch( NumberFormatException e ) {
304
						catch( NumberFormatException e ) {
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java (-2 / +3 lines)
Lines 10-15 Link Here
10
***********************************************************************/
10
***********************************************************************/
11
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
11
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
14
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
14
import org.eclipse.cdt.debug.core.model.ICStackFrame;
15
import org.eclipse.cdt.debug.core.model.ICStackFrame;
15
import org.eclipse.cdt.debug.core.model.IDisassembly;
16
import org.eclipse.cdt.debug.core.model.IDisassembly;
Lines 63-70 Link Here
63
		IDisassembly disassembly = getDisassembly( frame );
64
		IDisassembly disassembly = getDisassembly( frame );
64
		hashCode = 37*hashCode + (( disassembly != null ) ? disassembly.hashCode() : 0);
65
		hashCode = 37*hashCode + (( disassembly != null ) ? disassembly.hashCode() : 0);
65
		if ( frame != null ) {
66
		if ( frame != null ) {
66
			long address = frame.getAddress();
67
			IAddress address = frame.getAddress();
67
			hashCode = 37*hashCode + (int)(address^(address>>>32));
68
			hashCode = 37*hashCode + address.hashCode();
68
		}
69
		}
69
		return hashCode;
70
		return hashCode;
70
	}
71
	}
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java (-2 / +1 lines)
Lines 13-19 Link Here
13
import org.eclipse.cdt.debug.core.CDebugModel;
13
import org.eclipse.cdt.debug.core.CDebugModel;
14
import org.eclipse.cdt.debug.core.ICMemoryManager;
14
import org.eclipse.cdt.debug.core.ICMemoryManager;
15
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
15
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
16
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
17
import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
16
import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
18
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
17
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
19
import org.eclipse.debug.core.DebugException;
18
import org.eclipse.debug.core.DebugException;
Lines 430-436 Link Here
430
				}
429
				}
431
			}
430
			}
432
			if ( getMemoryBlock() != null ) {
431
			if ( getMemoryBlock() != null ) {
433
				fAddressText.setText( CDebugUIUtils.toHexAddressString( getMemoryBlock().getStartAddress() ) );
432
				fAddressText.setText( getMemoryBlock().getRealStartAddress().toHexAddressString() );
434
				handleAddressEnter();
433
				handleAddressEnter();
435
			}
434
			}
436
		}
435
		}
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java (-31 / +30 lines)
Lines 11-25 Link Here
11
11
12
package org.eclipse.cdt.debug.internal.ui.views.memory;
12
package org.eclipse.cdt.debug.internal.ui.views.memory;
13
13
14
import java.math.BigInteger;
14
import java.util.Arrays;
15
import java.util.Arrays;
15
import java.util.LinkedList;
16
import java.util.LinkedList;
16
import java.util.List;
17
import java.util.List;
17
18
19
import org.eclipse.cdt.core.IAddress;
18
import org.eclipse.cdt.debug.core.CDebugUtils;
20
import org.eclipse.cdt.debug.core.CDebugUtils;
19
import org.eclipse.cdt.debug.core.ICMemoryManager;
21
import org.eclipse.cdt.debug.core.ICMemoryManager;
20
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
22
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
21
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlockRow;
23
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlockRow;
22
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
23
import org.eclipse.debug.core.DebugException;
24
import org.eclipse.debug.core.DebugException;
24
import org.eclipse.swt.graphics.Point;
25
import org.eclipse.swt.graphics.Point;
25
import org.eclipse.swt.widgets.Display;
26
import org.eclipse.swt.widgets.Display;
Lines 77-83 Link Here
77
		{
78
		{
78
			int offset = sb.length();
79
			int offset = sb.length();
79
			sb.append( getRowText( rows[i] ) );
80
			sb.append( getRowText( rows[i] ) );
80
			fAddressZones.add( new Point( offset, offset + getAddressLength() ) );
81
			fAddressZones.add( new Point( offset, offset + rows[i].getAddress().getCharsNum()  ) );
81
		}
82
		}
82
		return sb.toString();
83
		return sb.toString();
83
	}
84
	}
Lines 104-110 Link Here
104
	public Point[] getChangedZones()
105
	public Point[] getChangedZones()
105
	{
106
	{
106
		fChangedZones.clear();
107
		fChangedZones.clear();
107
		Long[] changedAddresses = getChangedAddresses();
108
		IAddress[] changedAddresses = getChangedAddresses();
108
		for ( int i = 0; i < changedAddresses.length; ++i )
109
		for ( int i = 0; i < changedAddresses.length; ++i )
109
		{
110
		{
110
			int dataOffset = getDataItemOffsetByAddress( changedAddresses[i] );
111
			int dataOffset = getDataItemOffsetByAddress( changedAddresses[i] );
Lines 126-132 Link Here
126
	
127
	
127
	public String getStartAddress()
128
	public String getStartAddress()
128
	{
129
	{
129
		return ( fBlock != null ) ? getAddressString( fBlock.getStartAddress() ) : "";  //$NON-NLS-1$
130
		return ( fBlock != null ) ? fBlock.getRealStartAddress().toHexAddressString() : "";  //$NON-NLS-1$
130
	}
131
	}
131
132
132
	public String getAddressExpression()
133
	public String getAddressExpression()
Lines 141-155 Link Here
141
		return new String( chars );
142
		return new String( chars );
142
	}
143
	}
143
144
144
	private String getAddressString( long address )
145
	{
146
		return CDebugUIUtils.toHexAddressString( address );
147
	}
148
149
	private String getRowText( IFormattedMemoryBlockRow row )
145
	private String getRowText( IFormattedMemoryBlockRow row )
150
	{
146
	{
151
		StringBuffer result = new StringBuffer( getRowLength() ); 
147
		StringBuffer result = new StringBuffer( getRowLength( ) ); 
152
		result.append( getAddressString( row.getAddress() ) ); 
148
		result.append(  row.getAddress().toHexAddressString() ); 
153
		result.append( getInterval( INTERVAL_BETWEEN_ADDRESS_AND_DATA ) );
149
		result.append( getInterval( INTERVAL_BETWEEN_ADDRESS_AND_DATA ) );
154
		String[] items = row.getData();
150
		String[] items = row.getData();
155
		for ( int i = 0; i < items.length; ++i )
151
		for ( int i = 0; i < items.length; ++i )
Lines 175-183 Link Here
175
			   getDataBytesPerRow() : 0 ) + 1;
171
			   getDataBytesPerRow() : 0 ) + 1;
176
	}
172
	}
177
173
178
	private int getAddressLength()
174
179
	{
175
   private int getAddressLength() {
180
		return 10;
176
   		return fBlock.getRealStartAddress().getCharsNum();
181
	}
177
	}
182
	
178
	
183
	private boolean isInAsciiArea( int offset )
179
	private boolean isInAsciiArea( int offset )
Lines 293-304 Link Here
293
		return IFormattedMemoryBlock.MEMORY_FORMAT_HEX;
289
		return IFormattedMemoryBlock.MEMORY_FORMAT_HEX;
294
	}
290
	}
295
	
291
	
296
	private Long[] getChangedAddresses()
292
	private IAddress[] getChangedAddresses()
297
	{
293
	{
298
		return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new Long[0];
294
		return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new IAddress[0];
299
	}
295
	}
300
	
296
	
301
	private int getDataItemOffsetByAddress( Long address )
297
	private int getDataItemOffsetByAddress( IAddress address )
302
	{
298
	{
303
		if ( getMemoryBlock() != null )
299
		if ( getMemoryBlock() != null )
304
		{
300
		{
Lines 307-321 Link Here
307
			{
303
			{
308
				int wordSize = getMemoryBlock().getWordSize();
304
				int wordSize = getMemoryBlock().getWordSize();
309
				int numberOfColumns = getMemoryBlock().getNumberOfColumns();
305
				int numberOfColumns = getMemoryBlock().getNumberOfColumns();
310
				if ( address.longValue() >= rows[i].getAddress() && 
306
311
					 address.longValue() < rows[i].getAddress() + (wordSize * numberOfColumns) )
307
				if(  address.compareTo( rows[i].getAddress())  >=0 && 
308
					 address.compareTo( rows[i].getAddress().add(BigInteger.valueOf(wordSize * numberOfColumns)))  <0)
312
				{
309
				{
313
					for ( int j = 1; j <= numberOfColumns; ++j )
310
					for ( int j = 1; j <= numberOfColumns; ++j )
314
					{
311
					{
315
						if ( address.longValue() >= rows[i].getAddress() + ((j - 1) * wordSize) &&
312
						if(  address.compareTo( rows[i].getAddress().add(BigInteger.valueOf( (j - 1) * wordSize)))    >=0 && 
316
							 address.longValue() < rows[i].getAddress() + (j * wordSize) )
313
							 address.compareTo( rows[i].getAddress().add(BigInteger.valueOf(    j      * wordSize)))      <0)
317
						{
314
						{
318
							return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA;
315
							return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + address.getCharsNum()  + INTERVAL_BETWEEN_ADDRESS_AND_DATA;
319
						}
316
						}
320
					}
317
					}
321
				}
318
				}
Lines 325-331 Link Here
325
		return -1;
322
		return -1;
326
	}
323
	}
327
	
324
	
328
	private int getAsciiOffsetByAddress( Long address )
325
	private int getAsciiOffsetByAddress( IAddress address )
329
	{
326
	{
330
		if ( getMemoryBlock() != null )
327
		if ( getMemoryBlock() != null )
331
		{
328
		{
Lines 334-347 Link Here
334
			{
331
			{
335
				IFormattedMemoryBlockRow firstRow = rows[0];
332
				IFormattedMemoryBlockRow firstRow = rows[0];
336
				IFormattedMemoryBlockRow lastRow = rows[rows.length - 1];
333
				IFormattedMemoryBlockRow lastRow = rows[rows.length - 1];
337
				if ( address.longValue() >= firstRow.getAddress() && address.longValue() <= lastRow.getAddress() )
334
				
335
				if (address.compareTo( firstRow.getAddress()) >=0 && address.compareTo( lastRow.getAddress()) <=0)
336
				
338
				{
337
				{
339
					int asciiOffset = (int)(address.longValue() - firstRow.getAddress());
338
					BigInteger asciiOffset = address.distance( firstRow.getAddress());
340
					int asciiRowlength = getMemoryBlock().getWordSize() * getMemoryBlock().getNumberOfColumns();
339
					int asciiRowlength = getMemoryBlock().getWordSize() * getMemoryBlock().getNumberOfColumns();
341
					int numberOfRows = asciiOffset / asciiRowlength;
340
					int numberOfRows = asciiOffset.intValue()  / asciiRowlength;
342
					int offsetInRow = asciiOffset % asciiRowlength;
341
					int offsetInRow = asciiOffset.intValue()  % asciiRowlength;
343
					return (numberOfRows * getRowLength()) + 
342
					return (numberOfRows * getRowLength()) + 
344
						   getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA +
343
						   address.getCharsNum() + INTERVAL_BETWEEN_ADDRESS_AND_DATA +
345
						   (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) * getMemoryBlock().getNumberOfColumns() +
344
						   (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) * getMemoryBlock().getNumberOfColumns() +
346
						   INTERVAL_BETWEEN_DATA_AND_ASCII + offsetInRow;
345
						   INTERVAL_BETWEEN_DATA_AND_ASCII + offsetInRow;
347
				}
346
				}
Lines 513-525 Link Here
513
	{
512
	{
514
		if ( getMemoryBlock() != null )
513
		if ( getMemoryBlock() != null )
515
		{
514
		{
516
			int index = getDataItemIndex( offset );
515
			int index = getDataItemIndex(offset );
517
			if ( index != -1 )
516
			if ( index != -1 )
518
			{
517
			{
519
				char[] chars = getDataItemChars( index );
518
				char[] chars = getDataItemChars( index );
520
				if ( isInDataArea( offset ) )
519
				if ( isInDataArea( offset ) )
521
				{
520
				{
522
					int charIndex = getOffsetInDataItem( offset, index );
521
					int charIndex = getOffsetInDataItem(offset, index );
523
					chars[charIndex] = newChar;
522
					chars[charIndex] = newChar;
524
				}
523
				}
525
				if ( isInAsciiArea( offset ) )
524
				if ( isInAsciiArea( offset ) )
Lines 539-545 Link Here
539
			int index = getDataItemIndex( offset );
538
			int index = getDataItemIndex( offset );
540
			if ( index != -1 )
539
			if ( index != -1 )
541
			{
540
			{
542
				String newValue = getNewItemValue( offset, ch );
541
				String newValue = getNewItemValue(offset, ch );
543
				if ( newValue != null )
542
				if ( newValue != null )
544
				{
543
				{
545
					try
544
					try
(-)workspace-orig/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java (-5 / +2 lines)
Lines 13-19 Link Here
13
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
13
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
14
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
14
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
15
import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation;
15
import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation;
16
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
17
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
16
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
18
import org.eclipse.cdt.debug.internal.ui.PixelConverter;
17
import org.eclipse.cdt.debug.internal.ui.PixelConverter;
19
import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler;
18
import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler;
Lines 83-93 Link Here
83
					case 2:
82
					case 2:
84
						return ( library.areSymbolsLoaded() ) ? SharedLibrariesMessages.getString( "SharedLibrariesView.Loaded_1" ) : SharedLibrariesMessages.getString( "SharedLibrariesView.Not_loaded_1" ); //$NON-NLS-1$ //$NON-NLS-2$
83
						return ( library.areSymbolsLoaded() ) ? SharedLibrariesMessages.getString( "SharedLibrariesView.Loaded_1" ) : SharedLibrariesMessages.getString( "SharedLibrariesView.Not_loaded_1" ); //$NON-NLS-1$ //$NON-NLS-2$
85
					case 3:
84
					case 3:
86
						return ( library.getStartAddress() > 0 ) ? 
85
						return library.getStartAddress().toHexAddressString(); //$NON-NLS-1$
87
									CDebugUIUtils.toHexAddressString( library.getStartAddress() ) : ""; //$NON-NLS-1$
88
					case 4:
86
					case 4:
89
						return ( library.getEndAddress() > 0 ) ? 
87
						return library.getEndAddress().toHexAddressString(); //$NON-NLS-1$
90
									CDebugUIUtils.toHexAddressString( library.getEndAddress() ) : ""; //$NON-NLS-1$
91
				}
88
				}
92
			}
89
			}
93
			return null;
90
			return null;

Return to bug 74056